If you have any question left, please drop a note with the discussion link of this page.

PHP Client Library

From Wiki.zanox.com

Jump to: navigation, search

Contents

Download

Download our latest PHP API client library (ZIP format).

You can check out the github page for the Library at https://github.com/zanox/api_client_php.

Getting Started

After you have downloaded the PHP Client Library and unzipped it on your PHP server, get a Connect ID and Secret Key, then put it all together as in the following example:

 
<?php
require_once 'client/ApiClient.php';
 
$client = ApiClient::factory(PROTOCOL_SOAP);
$client->setConnectId('_YOUR_CONNECT_ID_');
$client->setSecretKey('_YOUR_SECRET_KEY_');
 
$sales = $client->getSales('2011-01-24', 'trackingDate', NULL, NULL, NULL, 0, 50);
var_dump($sales);
?>
 

Documentation

The most complete reference of all calls can be found in the interface class for each version. The following example is from "/client/version/2011-03-01/model/IMethods.php":

 
    /**
     * Search for products.
     *
     * @param      string      $query          search string
     * @param      string      $searchType     search type (optional)
     *                                         (contextual or phrase)
     * @param      string      $region         limit search to region (optional)
     * @param      int         $categoryId     limit search to categorys (optional)
     * @param      array       $programId      limit search to program list of
     *                                         programs (optional)
     * @param      boolean     $hasImages      products with images (optional)
     * @param      float       $minPrice       minimum price (optional)
     * @param      float       $maxPrice       maximum price (optional)
     * @param      int         $adspaceId      adspace id (optional)
     * @param      int         $page           page of result set (optional)
     * @param      int         $items          items per page (optional)
     *
     * @access     public
     * @category   nosignature
     *
     * @return     object or string            list of products or false
     */
    public function searchProducts ( $query, $searchType = 'phrase',
        $region = NULL, $categoryId = NULL, $programId = array(),
        $hasImages = true, $minPrice = 0, $maxPrice = NULL, $adspaceId = NULL,
        $page = 0, $items = 10 );
 

The "readme.txt" in the PHP Client Library also contains many helpful examples to get you started.

Developing for 3rd parties

If you would like to use the Client to develop applications to be used by other zanox publishers and distributed via the zanox Application Store, click here.


Personal tools