1-888-659-6550 (toll free)

back

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();
}
?>

 

  •  
  • 5 Comment(s)
  •  
Gravatar: AlanT
11.12.2008
10:47
AlanT

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.

Gravatar: mark
11.12.2008
11:28
mark

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.

Gravatar: Matt
23.01.2009
07:38
Matt

Any news on the Network version of PAP4 ? Alternatively, can we order the old PAP3 Network version ?

Gravatar: Viktor
24.01.2009
13:48
Viktor

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)

Gravatar: Matt
27.01.2009
05:22
Matt

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

Your comment

back

Copy and paste this link into your RSS news reader

RSS 0.91Posts
RSS 2.0Posts

Social Bookmarking

Bookmark: Facebook Bookmark: Digg Bookmark: Del.icio.us Bookmark: Technorati Bookmark: Yahoo Bookmark: Google Bookmark: Mr. Wong Bookmark: Linkarena Bookmark: Seoigg Bookmark: Folkd Bookmark: Reddit Bookmark: Furl Bookmark: Blogmarks Bookmark: Diigo Bookmark: Newsvine

This is hot

Status of the version 4 development
44481 times viewed
15.08.2008 05:45
Preview of Post Affiliate Xpress 4
32245 times viewed
15.08.2008 06:43
Post Affiliate Xpress is online - in a Release candidate...
30423 times viewed
31.08.2008 17:08
Split commissions
25411 times viewed
23.04.2009 12:51
Stay in touch with us
© 2004-2012 QualityUnit.com, All rights reserved