NATS4 API Get Affiliate Loginids
From TMM Wiki
Revision as of 12:27, 28 March 2017 by TmmStephen (talk | contribs)
NATS4 supports an API function to get a list of affiliate IDs based on a list of affiliate usernames. Please note: As of NATS4 4.1.14.1 this function not only requires the affiliate have permission to use this function but also that the affiliate have access to view the Affiliate Area in their Account access page.
get_affiliate_loginids accepts the following parameters:
- usernames - An array containing all the usernames.
NuSOAP Example
This example continues from the main article NuSOAP Example):
$params = Array( 'usernames' => Array( 'TMMMikeS', 'NewAffiliate', 'DoesNotExist', ), ); $result = $client->call('get_affiliate_loginids', $params, 'natsapiadmin_wsdl'); print_r($result);
Affiliate Loginids Data Output
The output will be an array of affiliate usernames and affiliate IDs. loginid will be -1 if the affiliate cannot be found within NATS.
Array ( [0] => Array ( [username] => TMMMikeS [loginid] => 2 ) [1] => Array ( [username] => NewAffiliate [loginid] => 1429730 ) [2] => Array ( [username] => DoesNotExist [loginid] => -1 ) )