Add banner 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'; $session = new Pap_Api_Session("https://URL_TO_PAP/scripts/server.php"); //user your merchant username and password below if(!$session->login("Merchant Username","Merchant Password")) { die("Cannot login. Message: ...

Delete banners via API

If you wish to delete banners via php API, you need to know the IDs of the particular banners. <?php include 'PapApi.class.php'; $session = new Pap_Api_Session("https://URL_TO_PAP/scripts/server.php"); if(!$session->login("merchant@example.com","demo")) { die("Cannot login. Message: ". $session->getMessage()); } $bannerIDs = array('38a9d2c8','bb1723b8','e6c99e22'); //delete banners identified by those banner IDs $request = new Gpf_Rpc_FormRequest("Pap_Merchants_Banner_BannerForm", ...

Get (retrieve) banner codes via API (only for affiliates)

If some affiliates wish to obtain their banner codes via API so that they add all their banners to their page(s) dynamically and the fastest way possible, then the following php API example will come in handy. <?php define('URL_TO_PAP','https://URL_To_PostAffiliatePro'); //URL to Post Affiliate Pro (network) without any trailing slash define('AFFILIATE_USERNAME','affiliate@example.com'); //affiliate username define('AFFILIATE_PASSWORD','demo'); //affiliate password define('API_FILE','P...

How to assign coupons via API

Examples how to assign coupon using API you can read in the Coupons feature description: How to assign coupon using API (https://support.qualityunit.com/531726-How-to-assign-coupon-using-API)

How to load (display) coupons via php API?

The following code shows, how you can load valid and assigned coupons via php API. <?php //your PapApi.class.php file can be downloaded in the merchant panel at: //Tools>Integration>API Integration>Download PAP API //this include below assumes the PapApi.class.php is in the same dir as this script include ("PapApi.class.php"); //change localhost/pap to the path of your Post Affiliate Pro installation $session = new Pap_Api_Session("https://localhost/pap/scripts/server.php"); //logi...

How to load coupon details via API

If you want to get information about coupon and affiliate from coupon code, you can use class Pap_Features_Coupon_OfflineSaleForm. <?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("merchant login","password")) { die("Cannot login. Message: ". $session->getMessage()); } $couponCode = 'xxxxxx'; $request = new Gpf...

Create (import) coupons via API

The following 2 examples will show how to create (import) coupons via php API. 1. Created (imported) coupons will have to be assigned manually to affiliates <?php //your PapApi.class.php file can be downloaded in the merchant panel: Tools>Integration>API Integration>Download PAP API include ("PapApi.class.php"); //this include assumes the PapApi.class.php is in the same dir as this script //change localhost/pap to the path of your Post Affiliate Pro installation $session = new...

Add a Replicated site banner via API

This is a sample code of how to create a Replicated site banner via API. <?php $papURL = "https://URL_TO_PostAffiliatePro"; //URL of your Post Affiliate Pro installation without any trailing slash $merchantUsername = "merchant@example.com"; //merchant username $merchantPassword = "123456"; //merchant password //your PapApi.class.php file can be downloaded in the merchant panel: //Tools>Integration>API Integration>Download PAP API include_once ("PapApi.class.php"); //this incl...

Load the whole Banners Categories tree

This is a sample code of how to load all [Banners Categories](https://support.qualityunit.com/441949-Banners-categories): <?php $papURL = "https://URL_TO_PostAffiliatePro"; //URL of your Post Affiliate Pro installation without any trailing slash $merchantUsername = "merchant@example.com"; //merchant username $merchantPassword = "123456"; //merchant password //your PapApi.class.php file can be downloaded in the merchant panel: //Tools>Integration>API Integration>Download PAP API inc...

Add (or remove) a banner to Banner Categories

You can use the following code to add (or remove) a specific banner to [Banner Categories](https://support.qualityunit.com/441949-Banners-categories). You'll need to know the IDs of the categories to which you want to add the banner or remove it from, you can get these IDs by loading all the categories as explained [here](https://support.qualityunit.com/184520-Load-the-whole-Banners-Categories-tree). To add a banner to a category you must set the category's "selected" attribute to Y and to remo...
×