Post Affiliate Pro API Overview

Understanding the Post Affiliate Pro API: Structure, Layers, and Key Requirements Post Affiliate Pro operates on two main levels: - Client – An AJAX application running in the browser - Server – A PHP-based back end The client communicates with the server using requests and responses encoded in [JSON format](https://support.qualityunit.com/110653-Data-model-JSON-description). As a result, the application natively supports an API. Everything that can be controlled in the merchant or affiliate...

Application and API requests limits

Application limit As cloud-hosted accounts run on our servers we need to make sure they do not get overloaded. Because of this we limit the requests made on the application and API to make sure our servers operate smoothly. - the requests limit is set to 500 requests per 30 seconds - the limit includes requests on the application and API together (including callbacks, webhooks or any other requests to the application) - in API, one request can ask for maximum 500 results (rows). Grid limit ...

API Requirements

Requests can be sent using any programming language—you only need to follow the [JSON format](https://support.qualityunit.com/110653-Data-model-JSON-description) for requests and responses. We provide a PHP object library (a single file: PapApi.class.php or PapApiNamespace.class.php) that simplifies making requests to the Post Affiliate Pro API and processing the responses. PapApi.class.php is included with every Post Affiliate Pro distribution and can be found in the api folder in your install...

JSON Data Model description

The data transferred between the client (your script making requests) and the server (represented by scripts > server.php) is encoded in JSON format. This is the lowest level of communication. You can use this level of communication if you cannot use our PHP-based API (PapApi.class.php), which allows you to create requests and process responses more easily. Pap_Api_Session (Gpf_Api_Session) Login JSON request contains the following parameters: - C: Class name, Pap_Api_AuthService - M: Met...

JSON Data Model example of use

Using the JSON Data Model for API Actions in Post Affiliate Pro In Post Affiliate Pro, you can create and use a JSON data model for any action that is possible via the Merchant Panel or Affiliate Panel. You can obtain the actual JSON used for different actions by [debugging](https://support.qualityunit.com/775501-Debugging-with-Firefox) the requests, for example, with Firebug. The JSON data you get by [debugging](https://support.qualityunit.com/775501-Debugging-with-Firefox) should be URL-enco...

Click tracking request data description

Post Affiliate Pro tracking is based on requests between the client (banner destination web page or "thank you page") and the server. If it is the first request and the browser visitor cookie is not loaded, the server generates a new cookie value and sends it to the client as a response. JavaScript on the client will store the received cookie value in the browser and in the HTML5 local storage. If the browser visitor cookie is loaded and inserted into the request parameter visitorId, then the ...

Sale (action) tracking request data description

Sale/action tracking request This request is sent from sale tracker to Post Affiliate Pro server: https://my_pap_url/scripts/track.php?visitorId=b910a79d013c8856a01393511GPTWP0s&accountId=&url=H_localhost%2Ftests%2Fapi%2Fme%2Fsale.php&referrer=&tracking=1&getParams=&ip=127.0.0.1&sale=%5B%7B%22ac%22%3A%22%22%2C%22t%22%3A%22100%22%2C%22f%22%3A%22%22%2C%22o%22%3A%22oid%22%2C%22p%22%3A%22pid%22%2C%22d1%22%3A%22data1value%22%2C%22d2%22%3A%22data2value%22%2C%22d3%22%3A%22data3value%22%2C%22d4%22%3A%...

Inspecting and rewriting application requests into API

You can use the developer tools in your favorite browser to intercept requests between the application and the server in both the merchant and affiliate panels. You can then either recreate these requests using your preferred programming language or by utilizing our PHP-based [low-level API](https://support.qualityunit.com/922663-Low-level-API). This approach allows you to see which requests are triggered by specific actions and what their parameters are. You can then select the appropriate [lo...