Difference between revisions of "NATS4 API Get Member Details"
From TMM Wiki
Jump to navigationJump to search(One intermediate revision by the same user not shown) | |
(No difference)
|
Latest revision as of 13:52, 8 September 2016
The Get Member Details API function is a feature in NATS4 that allows you to access a member's details.
There are two types of parameters for this function.
Filters
These are parameters used to specify which member you're looking for. This function will only return one member; use these filters to choose which one.
- memberid
- session
- memberidx (Ex: If the member joined under Epoch with subscriptionid 12345, their memberidx would be EPOCH:12345)
- username
- siteid
- transactionid
- status
- token_hash
- subscriptionid
Options
These parameters allow you to specify what data you want to be returned. The member's main information will be returned by default; this specifies what you want in addition to that.
- subscriptions -- return all subscriptions for the member
- transactions -- return all transactions for the member (implies subscriptions).
- full_info -- whether to also get the info from the member_info table (name, address, zip, country, etc)
- ident_details -- whether to also return all the identifier information (ie, instead of just returning identid 1234, also return what programid, siteid, tourid, biller, etc that is)
- Starting with NATS version 4.1.11.1+ we have a config option in Configuration Admin > Misc section > "API_INCLUDE_BILLER_OPTION_INFO"
- Which you will need to enable to add biller specific option info to get_member_details API function.
Examples
Here's an example of the request:
<?xml version="1.0" encoding="ISO-8859-1"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:natsapiadmin_wsdl"> <SOAP-ENV:Body> <tns:get_member_details xmlns:tns="urn:natsapiadmin_wsdl"> <memberid xsi:type="xsd:int">544</memberid> <session xsi:type="xsd:string">797e62f8f1dfbe20f7c6c37754e0b880</session> <memberidx xsi:nil="true" xsi:type="xsd:string"/> <username xsi:nil="true" xsi:type="xsd:string"/> <siteid xsi:nil="true" xsi:type="xsd:int"/> <transactionid xsi:nil="true" xsi:type="xsd:string"/> <email xsi:nil="true" xsi:type="xsd:string"/> <status xsi:nil="true" xsi:type="xsd:int"/> <token_hash xsi:nil="true" xsi:type="xsd:string"/> <subscriptionid xsi:nil="true" xsi:type="xsd:int"/> <full_info xsi:nil="true" xsi:type="xsd:boolean"/> <subscriptions xsi:nil="true" xsi:type="xsd:boolean"/> <transactions xsi:nil="true" xsi:type="xsd:boolean"/> <ident_details xsi:nil="true" xsi:type="xsd:boolean"/> </tns:get_member_details> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
You will get a response similar to:
<?xml version="1.0" encoding="ISO-8859-1"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:natsapiadmin_wsdl"> <SOAP-ENV:Body> <ns1:get_member_detailsResponse xmlns:ns1="urn:natsapiadmin_wsdl"> <return xsi:type="tns:Member"> <memberid xsi:type="xsd:int">544</memberid> <identid xsi:type="xsd:int">82</identid> <loginid xsi:type="xsd:int">1</loginid> <loginid_nice xsi:type="xsd:string">tmm8zpnk9g9xa</loginid_nice> <refurl_lookup_id xsi:type="xsd:int">5</refurl_lookup_id> <refurl xsi:type="xsd:string">No Referring URL</refurl> <status xsi:type="xsd:int">1</status> <trial xsi:type="xsd:int">0</trial> <joined xsi:type="xsd:int">1286206502</joined> <expired xsi:type="xsd:int">0</expired> <last_login xsi:type="xsd:int">0</last_login> <stamp xsi:type="xsd:int">1286206503</stamp> <siteid xsi:type="xsd:int">1</siteid> <username xsi:type="xsd:string">tmmjoetest140</username> <password xsi:type="xsd:string">666665555</password> <cryptpass xsi:type="xsd:string">4e2IaVxacZGew</cryptpass> <ip xsi:type="xsd:int">75.99.182.234</ip> <email xsi:type="xsd:string">joe6@joe.com</email> <session xsi:type="xsd:string">797e62f8f1dfbe20f7c6c37754e0b880</session> <mailok xsi:type="xsd:int">1</mailok> <flat_price xsi:type="xsd:int">0</flat_price> <first_login xsi:type="xsd:int">0</first_login> <third_party_partner_id xsi:type="xsd:int">0</third_party_partner_id> <cascadeid xsi:type="xsd:int">25</cascadeid> <cascade_item_id xsi:type="xsd:int">26</cascade_item_id> <token xsi:type="xsd:int">0</token> <original_username xsi:type="xsd:string">tmmjoetest140</original_username> <renamed xsi:type="xsd:int">0</renamed> <marked xsi:type="xsd:int">0</marked> <token_hash xsi:type="xsd:string">c3a8347fec86bd852818f34fd5935549</token_hash> <member_subscription_id xsi:type="xsd:int">603</member_subscription_id> <memberidx xsi:type="xsd:string">EXBILLER:38ed7ed835131c896f62409f74a18f800622b0a1</memberidx> <billerid xsi:type="xsd:int">30</billerid> <biller xsi:type="xsd:string">EXBILLER</biller> <statid xsi:type="xsd:string">04ca9edf44caf6</statid> <cost xsi:type="xsd:int">0</cost> <cost_charge xsi:type="xsd:int">0</cost_charge> <spent xsi:type="xsd:int">50</spent> <refunded xsi:type="xsd:int">0</refunded> <charges xsi:type="xsd:int">1</charges> <next_rebill xsi:type="xsd:int">1286379302</next_rebill> <optionid xsi:type="xsd:int">55</optionid> <rebills xsi:type="xsd:int">0</rebills> <active xsi:type="xsd:int">1</active> <upgradeid xsi:type="xsd:string"> </upgradeid> <expires xsi:type="xsd:int">1286379302</expires> <nats_expires xsi:type="xsd:int">1286379302</nats_expires> <biller_expires xsi:type="xsd:int">0</biller_expires> <original_optionid xsi:type="xsd:int">55</original_optionid> <created_date xsi:type="xsd:int">1286204916</created_date> </return> </ns1:get_member_detailsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
NuSOAP Example (continuing from main article NuSOAP Example):
$values = array( 'memberid' => 544, 'session' => '797e62f8f1dfbe20f7c6c37754e0b880' ); $result = $client->call('get_member_details', $values, 'natsapiadmin_wsdl'); var_dump($result);
Output:
Array ( [memberid] => 544 [identid] => 82 [loginid] => 1 [loginid_nice] => tmm8zpnk9g9xa [refurl_lookup_id] => 5 [refurl] => No Referring URL [status] => 1 [trial] => 0 [joined] => 1286206502 [expired] => 0 [last_login] => 0 [stamp] => 1286206503 [siteid] => 1 [username] => tmmjoetest140 [password] => 666665555 [cryptpass] => 4e2IaVxacZGew [ip] => 75 [email] => joe6@joe.com [session] => 797e62f8f1dfbe20f7c6c37754e0b880 [mailok] => 1 [flat_price] => 0 [first_login] => 0 [third_party_partner_id] => 0 [cascadeid] => 25 [cascade_item_id] => 26 [token] => 0 [original_username] => tmmjoetest140 [renamed] => 0 [marked] => 0 [token_hash] => c3a8347fec86bd852818f34fd5935549 [member_subscription_id] => 603 [memberidx] => EXBILLER:38ed7ed835131c896f62409f74a18f800622b0a1 [billerid] => 30 [biller] => EXBILLER [statid] => 04ca9edf44caf6 [cost] => 0 [cost_charge] => 0 [spent] => 50 [refunded] => 0 [charges] => 1 [next_rebill] => 1286379302 [optionid] => 55 [rebills] => 0 [active] => 1 [upgradeid] => [expires] => 1286379302 [nats_expires] => 1286379302 [biller_expires] => 0 [original_optionid] => 55 [created_date] => 1286204916 )
Example request with all the additional optional information:
$values = array( 'memberid' => 544, 'session' => '797e62f8f1dfbe20f7c6c37754e0b880' 'subscriptions' => true, 'transactions' => true, 'full_info' => true, 'ident_details' => true, ); $result = $client->call('get_member_details', $values, 'natsapiadmin_wsdl'); var_dump($result);
Response:
Array ( [memberid] => 544 [identid] => 82 [loginid] => 1 [loginid_nice] => tmm8zpnk9g9xa [refurl_lookup_id] => 5 [refurl] => No Referring URL [status] => 1 [trial] => 0 [joined] => 1286206502 [expired] => 0 [last_login] => 0 [stamp] => 1286206503 [siteid] => 1 [username] => tmmjoetest140 [password] => 666665555 [cryptpass] => 4e2IaVxacZGew [ip] => 75 [email] => joe6@joe.com [session] => 797e62f8f1dfbe20f7c6c37754e0b880 [mailok] => 1 [flat_price] => 0 [first_login] => 0 [third_party_partner_id] => 0 [cascadeid] => 25 [cascade_item_id] => 26 [token] => 0 [original_username] => tmmjoetest140 [renamed] => 0 [marked] => 0 [token_hash] => c3a8347fec86bd852818f34fd5935549 [member_subscription_id] => 603 [memberidx] => EXBILLER:38ed7ed835131c896f62409f74a18f800622b0a1 [billerid] => 30 [biller] => EXBILLER [statid] => 04ca9edf44caf6 [cost] => 0 [cost_charge] => 0 [spent] => 50 [refunded] => 0 [charges] => 1 [next_rebill] => 1286379302 [optionid] => 55 [rebills] => 0 [active] => 1 [upgradeid] => [expires] => 1286379302 [nats_expires] => 1286379302 [biller_expires] => 0 [original_optionid] => 55 [created_date] => 1286204916 [firstname] => joe [lastname] => terror [address1] => 301 anywhere [address2] => [zip] => 1111111 [city] => cherry hill [country] => US [state] => NJ [shipping_firstname] => [shipping_lastname] => [shipping_address1] => [shipping_address2] => [shipping_zip] => [shipping_city] => [shipping_country] => [shipping_state] => [phone] => [xsell_success] => 0 [xsell_message] => [custom1] => [custom2] => [custom3] => [custom4] => [custom5] => [last_modified] => 0 [ident_details] => Array ( [programid] => Array ( [programid] => 1 [program] => TESTPROG [type] => 0 [name] => test program [deleted] => 0 ) [siteid] => Array ( [siteid] => 1 [site] => TESTSITE [deleted] => 0 [name] => Test Site ) [tourid] => Array ( [tourid] => 1 [tour] => MAIN [name] => Default Tour [url] => http://nats4.example.com/regular.php [description] => ) [optionid] => Array ( [name] => 50 cents recurring [initial] => 0 [initial_days] => 1 [rebill] => 0 [rebill_days] => 1 ) [billerid] => Array ( [billerid] => 30 [biller] => EXBILLER [deleted] => 0 ) ) [subscriptions] => Array ( [0] => Array ( [member_subscription_id] => 603 [memberid] => 544 [memberidx] => EXBILLER:38ed7ed835131c896f62409f74a18f800622b0a1 [billerid] => 30 [biller] => EXBILLER [statid] => 04ca9edf44caf6 [stamp] => 1286206503 [joined] => 1286206502 [expired] => 0 [cost] => 20 [cost_charge] => 0 [spent] => 0 [refunded] => 0 [charges] => 1 [next_rebill] => 1286379302 [optionid] => 55 [rebills] => 0 [active] => 1 [upgradeid] => 0 [expires] => 1286379302 [nats_expires] => 1286379302 [biller_expires] => 0 [original_optionid] => 55 [created_date] => 1286204916 [transactions] => Array ( [0] => Array ( [transaction_id] => 760 [identid] => 82 [loginid] => 1 [biller_time] => 1286206502 [server_time] => 1286206502 [biller_transid] => EXBILLER:65710 [billerid] => 30 [biller] => EXBILLER [amount] => 0 [biller_amount] => 50 [biller_currency] => USD [exchange_rate] => 10000 [trans_type_id] => 1 [member_subscription_id] => 603 [charges] => 0 [charge_deduct] => 0 [process_type] => 0 [related_transid] => [historical] => 0 [retro_payout] => 0 [retrieval_type] => 5 [trans_type] => Initial [cost] => 2000 [ident_details] => Array ( [programid] => Array ( [programid] => 1 [program] => TESTPROG [type] => 0 [name] => test program [deleted] => 0 ) [siteid] => Array ( [siteid] => 1 [site] => TESTSITE [deleted] => 0 [name] => Test Site ) [tourid] => Array ( [tourid] => 1 [tour] => MAIN [name] => Default Tour [url] => http://nats4.example.com/regular.php [description] => ) [optionid] => Array ( [name] => 50 cents recurring [initial] => 0 [initial_days] => 1 [rebill] => 0 [rebill_days] => 1 ) [billerid] => Array ( [billerid] => 30 [biller] => EXBILLER [deleted] => 0 ) ) [payments] => Array ( [0] => Array ( [trans_payment_id] => 233 [transaction_id] => 760 [identid] => 82 [loginid] => 1 [date] => 1286164800 [payment_type] => 0 [payment_amount] => 2000 [payout_change_id] => 1 [bonus_amount] => 0 [bonus_change_id] => 0 [loginid_nice] => tmm8zpnk9g9xa [payment_type_nice] => affiliate [ident_details] => Array ( [programid] => Array ( [programid] => 1 [program] => TESTPROG [type] => 0 [name] => test program [deleted] => 0 ) [siteid] => Array ( [siteid] => 1 [site] => TESTSITE [deleted] => 0 [name] => Test Site ) [tourid] => Array ( [tourid] => 1 [tour] => MAIN [name] => Default Tour [url] => http://nats4.example.com/regular.php [description] => ) [optionid] => Array ( [name] => 50 cents recurring [initial] => 0 [initial_days] => 1 [rebill] => 0 [rebill_days] => 1 ) [billerid] => Array ( [billerid] => 30 [biller] => EXBILLER [deleted] => 0 ) ) ) ) ) ) ) ) )