Difference between revisions of "Offerit API Get Affiliate Stats"
From Offerit
OfferitJames (talk | contribs) |
OfferitJames (talk | contribs) |
||
Line 8: | Line 8: | ||
* '''startDate''' - (optional) The date to start getting stats | * '''startDate''' - (optional) The date to start getting stats | ||
* '''endDate''' - (optional) The date to end getting stats | * '''endDate''' - (optional) The date to end getting stats | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== NuSOAP Example == | == NuSOAP Example == | ||
− | This example continues from the [[Offerit_API#Example|main article NuSOAP Example]] | + | This example continues from the [[Offerit_API#Example|main article NuSOAP Example]]: |
<pre> | <pre> | ||
Line 47: | Line 20: | ||
'endDate' => '2011-10-03' //(optional) The date to end getting stats | 'endDate' => '2011-10-03' //(optional) The date to end getting stats | ||
); | ); | ||
− | $result = $client->call('get_affiliate_stats', | + | $result = $client->call('get_affiliate_stats', $values, 'offeritapiadmin_wsdl'); |
</pre> | </pre> | ||
Line 61: | Line 34: | ||
[total_sales] => 0 | [total_sales] => 0 | ||
) | ) | ||
+ | </pre> | ||
+ | |||
+ | ==Server Request/Response== | ||
+ | '''Request:''' | ||
+ | <pre> | ||
+ | <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" | ||
+ | xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
+ | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" | ||
+ | xmlns:tns="urn:offeritapiadmin_wsdl"><SOAP-ENV:Body><tns:get_affiliate_stats xmlns:tns="urn:offeritapiadmin_wsdl"> | ||
+ | <loginid xsi:type="xsd:int">2</loginid><offerid xsi:type="xsd:int">1</offerid> | ||
+ | <startDate xsi:type="xsd:string">2011-8-14</startDate> | ||
+ | <endDate xsi:type="xsd:string"></endDate> | ||
+ | </tns:get_affiliate_stats></SOAP-ENV:Body></SOAP-ENV:Envelope> | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | '''Response:''' | ||
+ | <pre> | ||
+ | <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" | ||
+ | xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
+ | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" | ||
+ | xmlns:tns="urn:offeritapiadmin_wsdl"><SOAP-ENV:Body><ns1:get_affiliate_statsResponse xmlns:ns1="urn:offeritapiadmin_wsdl"> | ||
+ | <return xsi:type="tns:AffStats"><loginid xsi:type="xsd:int">2</loginid><clicks xsi:type="xsd:int">121</clicks> | ||
+ | <unique xsi:type="xsd:int">3</unique> | ||
+ | <payout_amount xsi:type="xsd:string">23900</payout_amount> | ||
+ | <total_sales xsi:type="xsd:int">0</total_sales> | ||
+ | </return></ns1:get_affiliate_statsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> | ||
</pre> | </pre> | ||
[[Category:Offerit API Articles]] | [[Category:Offerit API Articles]] |
Revision as of 14:41, 9 December 2011
This function allows you to get statistics such as the clicks, payout, and total sales of a specific affiliate for a specified date range. To use this function, you must make a SOAP call with the following parameters:
- loginid - The ID of the affiliate whose stats you are requesting
- offerid - (optional) The ID of the offer to get set to 0 for all offers
- startDate - (optional) The date to start getting stats
- endDate - (optional) The date to end getting stats
NuSOAP Example
This example continues from the main article NuSOAP Example:
$values = Array( 'loginid' => 2, 'offerid' => 1 //(optional) The ID of the offer to get set to 0 for all offers 'startDate' => '2011-10-01' //(optional) The date to start getting stats 'endDate' => '2011-10-03' //(optional) The date to end getting stats ); $result = $client->call('get_affiliate_stats', $values, 'offeritapiadmin_wsdl');
Sample Output
Array ( [loginid] => 2 [clicks] => 121 [unique] => 3 [payout_amount] => 23900 [total_sales] => 0 )
Server Request/Response
Request:
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:offeritapiadmin_wsdl"><SOAP-ENV:Body><tns:get_affiliate_stats xmlns:tns="urn:offeritapiadmin_wsdl"> <loginid xsi:type="xsd:int">2</loginid><offerid xsi:type="xsd:int">1</offerid> <startDate xsi:type="xsd:string">2011-8-14</startDate> <endDate xsi:type="xsd:string"></endDate> </tns:get_affiliate_stats></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response:
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:offeritapiadmin_wsdl"><SOAP-ENV:Body><ns1:get_affiliate_statsResponse xmlns:ns1="urn:offeritapiadmin_wsdl"> <return xsi:type="tns:AffStats"><loginid xsi:type="xsd:int">2</loginid><clicks xsi:type="xsd:int">121</clicks> <unique xsi:type="xsd:int">3</unique> <payout_amount xsi:type="xsd:string">23900</payout_amount> <total_sales xsi:type="xsd:int">0</total_sales> </return></ns1:get_affiliate_statsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>