Get Affiliate Program Campaign List

From TMMwiki
Jump to: navigation, search
NATS 4
SOAP API
API
API Best Practices
WSDL Cache
Add Affiliate
Add Member Note
Admin Get Adtools
Adtool Categories
Adtool Types
Affiliate Get Campaigns
Bulk Import Adtools
Caching
Decode Natscode
Expire Manual Member
Get Affiliate Campaigns
Get Affiliate Hit Data
Get Affiliate Loginids
Get Affiliate Nats Codes
Get Affiliate Payout
Get Affiliate Program Campaign List
Get_Affiliate_Program_Campaign_List
Get Member Details
Get Member Instant Upgrade String
Get Member Package Upgrade String
Get Member Token Rebuy String
Get Member Upsell String
Get Payment Data
Get Payvia Rule
Get Profit Loss Report
Ping
Record Member Login
Search Affiliate Info
Search Member Info
Send Email API Function
Set Affiliate Admin Settings
Set Affiliate Customs
Set Affiliate Defaults
Set Affiliate Information
Set Affiliate Settings
Set Member Details
Set Payment Status
Set Payvia Rule
REST API
API Overview
API Best Practices
REST API PATH UPDATES
Adtools
GET /adtools/admin
GET /adtools/categories
GET /adtools/types
POST /adtools/importdump
Affiliate
GET /affiliate/campaigns
GET /affiliate/hitdata
GET /affiliate/payout
GET /affiliate/searchinfo
POST /affiliate/addaffiliate
POST /affiliate/invoice
PATCH /affiliate/setadminsettings
PATCH /affiliate/setcustoms
PATCH /affiliate/setdefaults
PATCH /affiliate/setinformation
PATCH /affiliate/setpayviainfo
PATCH /affiliate/setsettings
PATCH /affiliate/status
Member
GET /member/upsellstring
GET /member/tokenrebuystring
GET /member/instantupgradestring
GET /member/packageupgradestring
GET /member/signupplusstring
GET /member/cancelstring
GET /member/details
GET /member/searchinfo
GET /suggestedcanceloffers
PATCH /member/setdetails
PATCH /member/setexpiration
POST /member/addnote
POST /member/recordlogin
PUT /member/expiremanual
Option
GET /option/getrule
PATCH /option/editrule
POST /option/addrule
PUT /option/edittext
Payments
GET /payments/getpayments
GET /payviarule
PATCH /payments/setstatus
PATCH /payviarule
Report
GET /profitlossreport
Service
GET /service/decodenatscode
GET /service/ping
POST /service/sendemail

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
                )
            )
        )
)