How to load affiliate manager information

Here is an example of how can affiliate load affiliate manager information. <?php include 'PapApi.class.php'; //the PapApi.class.php can be found at the PAP installation folder, in the 'api' directory $session = new Pap_Api_Session("https://your_pap_url/scripts/server.php"); if(!$session->login("affiliate login","password", Pap_Api_Session::AFFILIATE)) { die("Cannot login. Message: ". $session->getMessage()); } $request = new Gpf_Rpc_FormRequest("Pap_Affiliates_MerchantInfo", "l...

How to display dates in the correct timezone

All dates which you receive and send through API are in the server's timezone (Post Affiliate Pro uses by default the 'America/Los_Angeles' timezone), but dates displayed in the merchant/affiliate panel are displayed in the client timezone (PC regional settings). Here you can see some examples how to set the dates by API to be displayed in the desired timezone. First, you need to know your local timezone since it is needed for getting the time offset between your timezone and server's timez...

Redirect visitor to affiliate's replicated page

If you want to redirect visitor to affiliate's replicated based on the information from cookie you can use following API code: <?php include_once('PapApi.class.php'); $session = new Pap_Api_Session("URL_TO_PAP/scripts/server.php"); // register click $clickTracker = new Pap_Api_ClickTracker($session); try { $clickTracker->track(); $clickTracker->save3rdPartyCookiesOnly(); } catch (Exception $e) { } $refid = 'testaff'; // default affiliate if ($clickTracker->getAffiliate() != null) {...

Add channel via API

Sample code to add channel via API. NOTE: It requires affiliate login credentials. <?php $desiredChannelName = "MyTestChannel"; //up to 255 characters $desiredChannelCode = "MTC"; //up to 255 characters $papURL = "https://localhost/pap"; //URL to PAP without trailing slash $affiliateUsername = "affiliate@username.com"; $affiliatePassword = "password"; //the PapApi.class.php can be found at the PAP installation folder, in the 'api' directory //or downloaded from the merchant panel inclu...

Add DirectLink URL via API

Here is an example of how to add a DirectLink URL via API using merchant login credentials. NOTE: You will need to know the exact userid of the affiliate to whom the DirectLink URL should be assigned. You can get the userid of an affiliate via the following API: https://support.qualityunit.com/608550-Pap_Api_AffiliatesGrid while you can filter the affiliate via his/her username (e-mail address). <?php // the PapApi.class.php file can be downloaded from the merchant panel at: // T...

Allow affiliates to add sale manually from the affiliate panel

Sometimes, you may need to give your affiliates an option to add sales manually. You can achieve it by creating a custom page (https://support.qualityunit.com/023779-How-to-create-Custom-PageURL-Page) in their affiliate panel and in that page include a simple php script (file) of yours via iframe. The steps to follow are: - create a new PHP file (in this example we call it affaddsale.php) and insert this code into the file: <html> <head> <title> Add your sale here &...

Load sent mail templates via API

As you may have noticed, if you send some custom e-mail from Post Affiliate Pro merchant panel via Emails> Send message, then the particular template gets saved and you can load it anytime by clicking the "Load email from template ..." link But what if you wish to load such a saved custom e-mail template via API? Here is a sample script that loads all the saved custom templates: <?php //the PapApi.class.php can be downloaded from the merchant panel: // Tools > Integration &g...
×