Get Affiliate Program Campaign List
NATS4 supports an API function to get the Programs and Campaigns for a specific affiliate login ID.
get affiliate program campaign list accepts the following input parameters:
• login_id (the login ID number of the specific affiliate)
get affiliate program campaign list will output the following parameters:
• loginid (the login ID number of the specific affiliate, the same value passed in)
• username (the affiliate's username for the login ID number that was passed in)
• programlist (an array of the program list for the specific affiliate)
• campaignlist (an array of the campaign list for the specific affiliate)
NuSOAP Example
This example continues from the main article NuSOAP Example:
To give a complete example of how to call this:
<?php require_once('nusoap/lib/nusoap.php'); $url = 'http://nats.site.com/admin_api.php'; // change to be the domain of your NATS install $username = 'NATSADMIN'; // your admin username $apikey = '3385e1b470b0864e27a9b648da6c0692'; // your api key $client = new nusoap_client($url.'?wsdl', true); $client->setCredentials($username,$apikey); // Check for an error $err = $client->getError(); if ($err) { // Display the error echo 'Constructor error' . $err . "\n"; exit; // At this point, you know the call that follows will fail } //This example will list the Programs and Campaigns for the affiliate with loginID = 2 $values = array( 'loginid' => 2 ); $result = $client->call('get affiliate program campaign list', $values, 'natsapiadmin_wsdl'); echo '<HR><PRE>'; print_r($result); echo '</PRE>'; ?>
Get Affiliate Program Campaign List output
The output will be a multi-dimensional array, as shown below:
Array ( [result] => SUCCESS [return] => Array ( [loginid] => 2 [username] => TMMMikeS [campaignlist] => Array ( [0] => Array ( [campaignid] => 0 [name] => Default ) [1] => Array ( [campaignid] => 8 [name] => jkasty784686sd87f6sd87f6sd8f76sd76f38h45347583476sd87f8346583745973987598345345e475e46rsdf ) ) [programlist] => Array ( [0] => Array ( [programid] => 1 [program_name] => TempProgram [siteid] => 1 [site_name] => Token Test [tour_name] => Default Tour ) [1] => Array ( [programid] => 4 [program_name] => Payment Test [siteid] => 1 [site_name] => Token Test [tour_name] => Default Tour ) ) ) )