NATS4 API Get Member Token Rebuy String
The Get Member Token Rebuy String API function is a feature in NATS4 that allows existing members to repurchase tokens for their account using an API call. This feature works alongside Token Plus.
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
- siteid
- siteids
- username
In order to get a return from this function, you must use a combination of these filters when requesting information. The possible combinations here are:
- memberid and session
- username and siteid
- username and siteids
Examples
Requests
The following are examples of the requests you can make with this API function:
Note: This API function will only look up active members. Looking up an active or expired member will cause a blank return.
Member ID and Session:
<?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_token_rebuy_string xmlns:tns="urn:natsapiadmin_wsdl"> <memberid xsi:type="xsd:int">544</memberid> <session xsi:type="xsd:string">797e62f8f1dfbe20f7c6c37754e0b880</session> </tns:get_member_token_rebuy_string> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Username and Site ID:
<?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_token_rebuy_string xmlns:tns="urn:natsapiadmin_wsdl"> <username xsi:type="xsd:string">testuser</username> <siteid xsi:type="xsd:int">1</siteid> </tns:get_member_token_rebuy_string> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Username and Site IDs:
<?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_token_rebuy_string xmlns:tns="urn:natsapiadmin_wsdl"> <username xsi:type="xsd:string">testuser</username> <siteids xsi:type="xsd:string">1,2,3,4</siteids> </tns:get_member_token_rebuy_string> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Responses
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_token_rebuy_stringResponse xmlns:ns1="urn:natsapiadmin_wsdl"> <return xsi:type="tns:string">cb7a4e50fbab656832aa30b5e2d8dea9</return> </ns1:get_member_token_rebuy_stringResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
If you make an incorrect request, your response will be 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_token_rebuy_stringResponse xmlns:ns1="urn:natsapiadmin_wsdl"> <return xsi:type="tns:string"></return> </ns1:get_member_token_rebuy_stringResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
In the 'bad' response output, the get_member_token_rebuy_string will be returned as blank.
NuSOAP Example
(continuing from main article NuSOAP Example):
memberid and session:
$values = array( 'memberid' => 544, 'session' => '797e62f8f1dfbe20f7c6c37754e0b880' ); $result = $client->call('get_member_token_rebuy_string', $values, 'natsapiadmin_wsdl');
username and siteid:
$values = array( 'username' => testuser, 'siteid' => '1' ); $result = $client->call('get_member_token_rebuy_string', $values, 'natsapiadmin_wsdl');
username and siteids:
$values = array( 'username' => testuser, 'siteids' => '1,2,3,4' ); $result = $client->call('get_member_token_rebuy_string', $values, 'natsapiadmin_wsdl');