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

RESTful API V20090701

From Wiki.zanox.com

Jump to: navigation, search
Web Services | RESTful API V20090701

Products
  GET: Retrieving single product item
  GET: Retrieving product items by a specified program
  GET: Contextual product search
  GET: Retrieving product categories
Admedia
  GET: Retrieving a single admedium item
  GET: Retrieving a list of admedia items
  GET: Retrieving admedia categories
Programs
  GET: Retrieving a single program item
  GET: Programsearch
  GET: Returns all programs for a specified user adspace
  GET: Returns all zanox program categories
  POST: Creating a new program application
  DELETE: Deleting an existing program application
Reports
  GET: Retrieving a single sale item
  GET: Retrieving a single lead item
  GET: Retrieving all sale items
  GET: Retrieving all lead items
  GET: Retrieving aggregated Report
Payments
  GET: Retrieving all payment items
  GET: Retrieving a single payment item
  GET: Retrieving all balance items
  GET: Retrieving a single balance item
  GET: Retrieving all account items
  GET: Retrieving a single account item
Adspaces
  GET: Retrieving a single adspace item
  GET: Retrieving all adspace items related to the user
  POST: Creating a new advertising space
  PUT: Updating properties of an advertising space
  DELETE: Removing an advertising space
Profiles
  GET: Retrieve the user profile
  PUT: Update the user profile

Contents

API Endpoints

Two different RESTful interfaces are available: XML and JSON. Both are available via http or https. The API can be used without a version parameter in the URL. If used without the version parameter the latest API version is always taken. In order to stick to a certain version the release date of the API has to be provided as a parameter.

http(s)://api.zanox.com/json/2009-07-01
http(s)://api.zanox.com/xml/2009-07-01

To see the differences between versions, please check Version History

zanox Connect API Authentification

API Version 2009-07-01 introduces the zanox Connect Authentification Model.

API Authentication

Two different types of authentication are necessary to use the RESTful API. The implementation details can be found in the RESTful API authentication process section with zanoxConnect.

Callback Handler

zanox Web Services Version 2009-02-01_RC01 introduced support of the Dynamic Script Tag Pattern. Here you can learn what it is, how to do cross domain requests to the zanox Web Services.

Usage of 'callback=function' with static script tag

Example: A product search against the product feeds of the programme with the ID 12345.

<script src="http://api.zanox.com/json/2009-02-01/products?applicationid=abc..&programs=12345&q=searchString&callback=myCallbackHandler"> </script>
<script>
  function myCallbackHandler(jsonData){
  //do something with jsonData, which is the result of the API query
  }
</script>

Usage of 'callback=function' with dynamic script tag

<script>
  function callAPI(url){
    var script = document.createElement('script');
    script.src = url; // sets the scripts source to the Rest/JSON API query
    script.type = "text/javascript";
 
    document.getElementsByTagName('head')[0].appendChild(script); 
    // the browser performs a request to the zanox API. 
    // as soon as the script tags source is loaded, the callback function is called
    }
 
    function myCallbackHandler(jsonData){
    //do something with jsonData, which is the result of the API query
    }
  }
  var url = 'http://api.zanox.com/json/2009-02-01/products?applicationid=abc&programs=12345&q=searchString&callback=myCallbackHandler';
  callAPI(url);
</script>

API RESTful Resources

The RESTful API contains RESOURCES that can be accessed for various actions. Actions refers to the HTTP commands GET/POST/PUT and DELETE. The GET command means retrieving a resource, POST means creating a resource, PUT means updating a resouce and DELETE means removing a resource.

Resources are advertising spaces, product offerings, advertising media, advertiser programs, transaction reports and user profiles. Be aware that not all of these resources can be modified.

Products Resource

Using the REST V2009-07-01 Products you can access 70 mio product offer items using contextual product search, product download, incremental product download

Admedia Resource

With the REST V2009-07-01 Admedia you can access 300.000 advertising media (banners, text links, etc.)

Programs Resource

With the REST V2009-07-01 Programs you can search for affiliate programmes, retrieve affiliate programmes, and apply to affiliate programmes

Reports Resource

With the REST V2009-07-01 Reports you can retrieve Leads and Sales

Payments Resource

With the REST V2009-07-01 Payments you can do operations on payments

Adspaces Resource

With the REST V2009-07-01 Adspaces you can do operations on advertising spaces.

Profiles Resource

With the REST V2009-07-01 Profiles you can do operations on profiles

Personal tools