I would like to announce that the documentation for PAP4 API is now published in our knowledge base:
support.qualityunit.com/knowledgebase/post-affiliate-pro/programmers-documentation/api-programming.html
API possibilities
because of PAP4 client/server architecture, it natively supports API, and everything that you can control through merchant or affiliate control panel, you can access also from external application using the same API calls.
This includes retrieving, editing, adding affiliates, banners, campaigns, transactions, setting configuration, getting statistics data, etc. for both merchant and affiliate.
We have currently helper classes to support affiliates (list/add/edit) and transactions (list/add/edit).
We will be expanding the library as necessary, or per your requests.
API examples
You can find complete documentation and more examples in the link above.
Example 1 - getting list of affiliates that match string "john".
<code></code>
<?php
include 'PapApi.class.php';
// log in (as merchant)
$session = new Gpf_Api_Session("http://demo.qualityunit.com/pax4/scripts/server.php");
if(!$session->login("merchant@example.com", "demo")) {
die("Cannot login. Message: ".$session->getMessage());
}
$request = new Pap_Api_AffiliatesGrid($session);
$request->addFilter("search", Gpf_Data_Filter::LIKE, "john");
$request->sendNow();
$grid = $request->getGrid();
$recordset = $grid->getRecordset();
foreach($recordset as $rec) {
echo 'Affiliate name: '.$rec->get('firstname').''.$rec->get('lastname').'<br>';
}
?>
Example 2 - loading affiliate by his name
<code></code>
<?php
include 'PapApi.class.php';
// log in (as merchant)
$session = new Gpf_Api_Session("http://demo.qualityunit.com/pax4/scripts/server.php");
if(!$session->login("merchant@example.com", "demo")) {
die("Cannot login. Message: ".$session->getMessage());
}
$affiliate = new Pap_Api_Affiliate($session);
$affiliate->setFirstname("John");
$affiliate->setLastname("Smith");
try {
if(!$affiliate->load()) {
echo 'Cannot load affiliate, error: '.$affiliate->getMessage();
}
} catch (Exception $e) {
echo 'Cannot load affiliate, error: '.$e->getMessage();
}
?>
In your examples above, you fail to include whatever file is necessary to define the classes you use in the examples. Pap_Api_AffiliatesGrid($session) and Pap_Api_Affiliate($session) have to be defined somewhere, and cannot be used until they are.
These were meant to be just examples of the retrieving functionality, but I understand that you want to see full code. I added the missing initialization code there.
Any news on the Network version of PAP4 ? Alternatively, can we order the old PAP3 Network version ?
Hello Matt, Network version we don't have yet implemented. PAP3 was not network version PAP4 is not Network version too. Our plan is to develop and release Network version based on PAP4 in year 2009 (I expect not sooner as in second half of this year)
Hi Viktor, Thanks for the response. When I purchased PAP Version 3 I remember you were also selling a Network version (perhaps under a different name). Am I able to purchase this ? I realise that it is no longer in active development ! Regards Matt