If you have any question left, please drop a note with the discussion link of this page.
REST V2009-02-01 Programs
From Wiki.zanox.com
Products
GET: Retrieving a single product item
GET: Retrieving all product items by advertiser program
GET: Contextual Product Search
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: Retrieving all program items
GET: Programsearch
GET: Retrieving programs for a given category
GET: Returns the last 20 advertiser program news
GET: Returns all available program categories
GET: Returns all programs for a specified user adspace
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
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
The programs RESTFul API resource enables the retrieval of advertiser programs and the automatic management of advertiser program applications. Prerequisite for a program application is the existence of an advertising space.
Program applications can be created, deleted and their properties retrieved via this API.
GET: Retrieving a single program item
Parameters
| applicationId | mandatory | only header parameter | applicationId is required for authorization. |
| program | mandatory | path parameter | ID of program item. |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/program/49 // REST JSON http://api.zanox.com/json/programs/program/49 // REST XML using Header Authorization GET /xml/programs/program/49 HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <programsResult> <programItem id="1432" xml:lang="en"> <name>Example Inc.</name> <adrank>5.0</adrank> <description>Become our partner and earn commission</description> <products>54372</products> <vertical>Finance and Insurance</vertical> <regions> <region>de</region> <region>en</region> </regions> <categories> <category id="37">HiFi, TV and Video</category> <category id="21">Art and Culture</category> </categories> <url>http://www.example.com</url> <image>http://service.zanox.com/programs/0000/4304_lgo_example.gif</image> <currency>EUR</currency> <conditions> <views> <minFixed>0.5</minFixed> <maxFixed>5</maxFixed> </views> <clicks> <minFixed>0.5</minFixed> <maxFixed>5</maxFixed> </clicks> <leads> <minFixed>0.5</minFixed> <maxFixed>5</maxFixed> </leads> <sales> <minPercent>0.5</minPercent> <maxPercent>5</maxPercent> <minFixed>0.5</minFixed> <maxFixed>5</maxFixed> </sales> </conditions> </programItem> </programsResult> </response>
→ Explanation of response items for properties of an advertiser program
GET: Retrieving all program items
Parameters
| applicationId | mandatory | only header parameter | applicationId is required for authorization. |
| items | optional | query parameter | number of items in the result set [1..n] (default = 10; maximum = 50) |
| page | optional | query parameter | page position [0..n] (default: 0) |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs // REST JSON http://api.zanox.com/json/programs // REST XML using Header Authorization GET /xml/programs HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <page>0</page> <items>10</items> <total>2376</total> <programsResult> <programItem id="1432" xml:lang="en">...</programItem> <programItem id="1436" xml:lang="en">...</programItem> <programItem id="1441" xml:lang="en">...</programItem> </programsResult> </response>
GET: Programsearch
Parameters
| applicationId | mandatory | only header parameter | applicationId is required for authorization. |
| q | mandatory | query parameter | Search string. |
| items | optional | query parameter | number of items in the result set [1..n] (default = 10; maximum = 50) |
| page | optional | query parameter | page position [0..n] (default: 0) |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs?q=searchforsometext&page=1&items=10 // REST JSON http://api.zanox.com/json/programs?q=searchforsometext&page=1&items=10 // REST XML using Header Authorization GET /xml/programs?q=searchforsometext HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <page>0</page> <items>10</items> <total>2376</total> <programsResult> <programItem id="1432" xml:lang="en">...</programItem> <programItem id="1436" xml:lang="en">...</programItem> <programItem id="1441" xml:lang="en">...</programItem> </programsResult> </response>
GET: Retrieving programs for a given category
Parameters
| applicationId | mandatory | only header parameter | applicationId is required for authorization. |
| category | mandatory | path parameter | ID of the category. Avaliable program categories |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/category/12 // REST JSON http://api.zanox.com/json/programs/category/12 // REST XML using Header Authorization GET /xml/programs/category/12 HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <page>0</page> <items>10</items> <total>2376</total> <programsResult> <programItem id="1432" xml:lang="en">...</programItem> <programItem id="1436" xml:lang="en">...</programItem> <programItem id="1441" xml:lang="en">...</programItem> </programsResult> </response>
GET: Returns the last 20 advertiser program news
Parameters
| applicationId | mandatory | only header parameter | applicationId is required for authorization. |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/news // REST JSON http://api.zanox.com/json/programs/news // REST XML using Header Authorization GET /xml/programs/news HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <programsResult> <programItem id="1432" xml:lang="en"> <title>example.com - special event</title> <name>Example Inc.</name> <adrank>4.0</adrank> <description>The Example Inc. is giving 30percent discount on...</description> <startDate>2002-10-10T17:00:00Z</startDate> <endDate>2002-12-10T17:00:00Z</endDate> <url>http://ui.zanox-affiliate.de/?10011001100300C0124304_112_201</url> </programItem> <programItem id="1441" xml:lang="en">...</programItem> <programItem id="1440" xml:lang="en">...</programItem> <programItem id="1439" xml:lang="en">...</programItem> <programsResult> </response>
GET: Returns all available program categories
Parameters
| applicationId | mandatory | only header parameter | applicationId is required for authorization. |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/categories // REST JSON http://api.zanox.com/json/programs/categories // REST XML using Header Authorization GET /xml/programs/categories HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-02-20/"> <programsResult> <categories xml:lang="en"> <category id="37">HiFi, TV and Video</category> <category id="21">Art and Culture</category> </categories> </programsResult> </response>
GET: Returns all programs for a specified user adspace
This requests returns all advertiser programs that are accepted for this advertising space.
| | This request requires message authentication! |
Parameters
| applicationId | mandatory | only header parameter! | applicationId is required for authorization to eliminate any possibility of data abuse. |
| timestamp | mandatory | only header parameter! | timestamp is required for authorization to eliminate any possibility of data abuse. |
| signature | mandatory | only header parameter! | signature is required for authorization to eliminate any possibility of data abuse. REST Authentification |
| adspace | mandatory | path parameter | ID of the adspace. |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/adspace/121232 // REST JSON http://api.zanox.com/json/programs/adspace/121232 // REST XML using Header Authorization GET /xml/programs/adspace/121232 HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <page>0</page> <items>10</items> <total>2376</total> <programsResult> <programItem id="1432" xml:lang="en">...</programItem> <programItem id="1436" xml:lang="en">...</programItem> <programItem id="1441" xml:lang="en">...</programItem> </programsResult> </response>
POST: Creating a new program application
The POST request operation with an programs URI creates a new advertiser program application for the given advertising space.
Parameters
| applicationId | mandatory | only header parameter! | applicationId is required for authorization to eliminate any possibility of data abuse. |
| timestamp | mandatory | only header parameter! | timestamp is required for authorization to eliminate any possibility of data abuse. |
| signature | mandatory | only header parameter! | signature is required for authorization to eliminate any possibility of data abuse. REST Authentification |
| program | mandatory | path parameter | ID of program. |
| adspace | mandatory | path parameter | ID of the adspace. |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/program/49/adspace/224242 // REST JSON http://api.zanox.com/json/programs/program/49/adspace/224242 // REST XML using Header Authorization POST /xml/programs/program/49/adspace/224242 HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <Code>200</Code> <Message>Successfully added application for the example.com program</Message> </response>
→ Explanation of response items for creating a new program application
DELETE: Deleting an existing program application
A DELETE request using a programs URI removes an advertiser program application.
Parameters
| applicationId | mandatory | only header parameter! | applicationId is required for authorization to eliminate any possibility of data abuse. |
| timestamp | mandatory | only header parameter! | timestamp is required for authorization to eliminate any possibility of data abuse. |
| signature | mandatory | only header parameter! | signature is required for authorization to eliminate any possibility of data abuse. REST Authentification |
| program | mandatory | path parameter | ID of program. |
| adspace | mandatory | path parameter | ID of adspace. |
| callback | optional | query parameter | Supported if format is JSON. Name of the JS function the result is wrapped in. not supported yet |
Example Request
// REST XML http://api.zanox.com/xml/programs/program/49/adspace/224242 // REST JSON http://api.zanox.com/json/programs/program/49/adspace/224242 // REST XML using Header Authorization DELETE /xml/programs/program/1/adspace/2 HTTP/1.1 Host: api.zanox.com Date: Mon, 09 Jun 2008 08:17:35 GMT Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="http://api.zanox.com/namespace/2008-05-21/"> <Code>200</Code> <Message>Successfully removed program from adspace</Message> </response>
→ Explanation of response items for removing an advertiser program application