NATS4 API Get Affiliate Campaigns
From TMM Wiki
Revision as of 15:09, 21 December 2012 by TMMMikeSopko (talk | contribs) (Created page with "{{NATS4 Manual | show_api_admin_section = true }} NATS4 supports an API function to get the affiliate's campaigns. get_affiliate_campaigns accepts the following paramet...")
NATS4 supports an API function to get the affiliate's campaigns.
get_affiliate_campaigns accepts the following parameters:
- userid - The affiliate ID. This parameter is required.
- orderby - The ordering of the returned campaigns. This parameter is optional and is defaulted to the campaign name. You can order by the following fields: campaignid, name, description and created_date. You can choose asc or desc for ascending or descending ordering.
NuSOAP Example
This example continues from the main article NuSOAP Example):
$params = Array( 'userid' => '2', 'orderby' => 'name desc', ); $result = $client->call('get_affiliate_campaigns', $params, 'natsapiadmin_wsdl'); print_r($result);
Affiliate Campaign Data Output
The output will be the campaign ID with the campaign name.
Array ( [0] => Array ( [campaignid] => 0 [name] => Default ) [1] => Array ( [campaignid] => 4 [name] => testings001 ) [2] => Array ( [campaignid] => 1 [name] => TEMP ) [3] => Array ( [campaignid] => 2 [name] => New ) )