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. Note: The first parameter of setLimit() is an offset that is no longer used since version 5.11.8.1 — always pass 0. Paging is handled automatically: sending the same request object again returns the next page of records. The maximum number of records returned in one request is 500. Details are described in the [Gpf_Rpc_GridRequest](https://support.qualityunit.com/233666-Gpf_Rpc_GridRequest) article. <?php // PapApi.cl...

Get the Top Affiliates report via API

The following sample script shows how to get the Top Affiliates report data via API. Note: The first parameter of setLimit() is an offset that is no longer used since version 5.11.8.1 — always pass 0. Paging is handled automatically: sending the same request object again returns the next page of records. The maximum number of records returned in one request is 500. Use the largest page size your script can handle, as it means fewer API calls. Details are described in the [Gpf_Rpc_GridRequest](h...

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