« Back to Documentation OverviewgetAffiliateInfo – v1.2
getAffiliateInfo(string apikey)
DEPRECATED: Retrieve your User Unique Id and your Affiliate link to display/use for
Monkey Rewards. While
we don't use the User Id for any API functions, it can be useful if building up URL strings for things such as the profile editor and sub/unsub links.
| Parameters | | apikey a valid API Key for your user account. Get by visiting your API dashboard |
| Returns | | array |
containing your Affilliate Id and full link. |
| Returned Fields | string | user_id | Your User Unique Id. | string | url | Your Monkey Rewards link for our Affiliate program |
Examples (2)
download example code
[1] mcapi_getAffiliateInfo.php
<?php
/**
This Example shows how to Update an A/B Split Campaign via the MCAPI class.
**/
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
$api = new MCAPI($apikey);
$retval = $api->getAffiliateInfo();
if ($api->errorCode){
echo "Unable to Retrieve Affiliate Info!\n"; echo "\n\tCode=".$api->errorCode; echo "\n\tMsg=".$api->errorMessage."\n"; } else {
echo "Your Affiliate Info:\n"; echo "User Id = ".$retval['user_id']."\n"; echo "Rewards link = ".$retval['url']."\n"; }
?>
[2] xml-rpc_getAffiliateInfo.php
<?php
/**
This Example shows how retrieve your account's Affiliate info using XML-RPC.
Note that we are using the PEAR XML-RPC client and recommend others do as well.
**/
require_once 'XML/RPC2/Client.php';
require_once 'inc/config.inc.php';
try {
$result = $client->getAffiliateInfo($apikey);
echo "User Id = ".$result['user_id']."\n"; echo "Rewards link = ".$result['url']."\n"; } catch (XML_RPC2_FaultException $e){
echo $e->getFaultCode()." : ".$e->getFaultString()."\n"; }
?>