My tickets
 
Submit ticket
 
Login
 
Work with reports
Home
>
Post Affiliate Pro
>
Programmers documentation
>
API
>
Examples
>
Work with reports
How to load statistics data
If you want to get statistical data that is used in the Traffic stats widget or in reports (Quick, Trends), you can use class Pap_Merchants_Reports_TrafficStatsData. In case you wish to load the data for a particular affiliate, then you can log in as an affiliate via api (https://support.qualityunit.com/367540-Logging-in-the-merchant-and-affiliate) or use 'userid' filter: $filters[] = array("userid", Gpf_Data_Filter::EQUALS, '11111111'); Loading traffic stats data: <?ph...
How to load channel stats for affiliate
If you want to load channel stats report for affiliate, you can send a grid request to class Pap_Affiliates_Reports_ChannelStatsGrid. Notice that you need to use affiliate login details for API login because the channel stats report is from the affiliate panel. <?php include 'PapApi.class.php'; //the PapApi.class.php can be found under Tools->Integration->API integration $session = new Pap_Api_Session("https://URL_to_PAP/scripts/server.php"); if(!$session->login("affiliate@use...
Get the list of Raw Clicks
The following example shows how to obtain the list of Raw Clicks via API. <?php // PapApi.class.php can be downloaded from the merchant panel at Tools > Integration > API Integration include '../pap/api/PapApi.class.php'; $papURL="https://URL_TO_PAP"; //URL leading to PAP/PAN without trailing slash $merchantUsername = "merchant@user.com"; $merchantPassword = "merchantpassword"; //------------------------------------------------------------------ // login (as merchant) $session = ne...
Get the Top Affiliates report via API
The following sample script shows how to get the Top Affiliates report data via API. <?php // the PapApi.class.php file can be downloaded from the merchant panel at: // Tools > Integration > API Integration > Download PAP API // This include assumes the PapApi.class.php file is in the same directory as this particular script. include 'PapApi.class.php'; $papURL = "https://URL_TO_PostAffiliatePro"; //URL to Post Affiliate Pro without any trailing slash $merchantUsername = "mercha...
Quick stats report
Here is a code to get the Quick stats report template with data: <?php include 'PapApi.class.php'; $session = new Pap_Api_Session("https://URL_to_PAP/scripts/server.php"); if(!$session->login("merchant@example.com", "password")) { die("Cannot login. Message: ".$session->getMessage()); } // more details on session creation here https://support.qualityunit.com/931835-Pap_Api_Session $request = new Gpf_Rpc_DataRequest('Pap_Merchants_Reports_QuickReportData', 'load', $session); //$reque...