From Wiki.zanox.com
The adspace RESTFul API resource enables the automatic management of advertising spaces. Advertising spaces contain certain properties like the URL and audience of a website to advertise on. Based on this properties various actions are performed.
Adspaces can be created, updated and deleted as well as their properties retrieved via this API.
GET: Retrieving a single adspace item
Parameters
| connectid
| mandatory
| header or query parameter
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| signature is required for authorization to eliminate any possibility of data abuse.
|
| adspace
| mandatory
| path parameter
| the adspace parameter specifies the adspace you want to get.
|
| callback
| optional
| query parameter
| Supported if format is JSON. Name of the JS function the result is wrapped in.
|
Example Request
// REST XML
http://api.zanox.com/xml/2011-03-01/adspaces/adspace/{adspaceId}
// REST JSON
http://api.zanox.com/json/2011-03-01/adspaces/adspace/{adspaceId}
// REST XML using Header Authorization
GET /xml/2011-03-01/adspaces/adspace/12345 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2010 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/2011-03-01/">
<adspaceItem lang="de" id="12345">
<name>Example Inc.</name>
<url>http://www.example.com</url>
<description>...</description>
<type>WEBSITE</type>
<scope>BUSINESS</scope>
<visitors>680</visitors>
<impressions>10000</impressions>
<adrank>0.6</adrank>
<regions>
<region>DE</region>
</regions>
<categories>
<category id="54">0 - 10 K</category>
</categories>
</adspaceItem>
</response>
GET: Retrieving all adspace items related to the user
Parameters
| connectid
| mandatory
| header or query parameter
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| signature is required for authorization to eliminate any possibility of data abuse.
|
| 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.
|
Example Request
// REST XML
http://api.zanox.com/xml/2011-03-01/adspaces
// REST JSON
http://api.zanox.com/json/2011-03-01/adspaces
// REST XML using Header Authorization
GET /xml/2011-03-01/adspaces HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2010 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/2011-03-01/">
<page>0</page>
<items>3</items>
<total>2376</total>
<adspaceItems>
<adspaceItem lang="de" id="12345">...</adspaceItem>
<adspaceItem lang="de" id="12346">...</adspaceItem>
<adspaceItem lang="de" id="12347">...</adspaceItem>
</adspaceItems>
</response>
POST: Creating a new advertising space
Parameters
| connectid
| mandatory
| header or query parameter
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| signature is required for authorization to eliminate any possibility of data abuse.
|
| adspaceItem
| mandatory
| body parameter
| the adspace item that has to be new created.
|
| callback
| optional
| query parameter
| Supported if format is JSON. Name of the JS function the result is wrapped in.
|
Example Request
// REST XML
http://api.zanox.com/xml/2011-03-01/adspaces/adspace
// REST JSON
http://api.zanox.com/json/2011-03-01/adspaces/adspace
// REST XML using Header Authorization
POST /xml/2011-03-01/adspaces/adspace HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2010 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
// message body
<xml>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<request>
<adspaceItem xml:lang="en">
<name>example.com</name>
<url>http://www.example.com</url>
<contact>contact@example.com</contact>
<description>This website contains ...</description>
<visitors>100.000</visitors>
<impressions>5.000.000</impressions>
<type>website</type>
<scope>business</scope>
<regions>
<region>de</region>
<region>en</region>
</regions>
<categories>
<category>11</category>
<category>12</category>
</categories>
</adspaceItem>
</request>
</xml>
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns="http://api.zanox.com/namespace/2011-03-01/">
<adspaceItem xml:lang="en">
<name>example.com</name>
<url>http://www.example.com</url>
<contact>contact@example.com</contact>
<description>This website contains ...</description>
<visitors>100.000</visitors>
<impressions>5.000.000</impressions>
<type>website</type>
<scope>business</scope>
<regions>
<region>de</region>
<region>en</region>
</regions>
<categories>
<category>11</category>
<category>12</category>
</categories>
</adspaceItem>
</response>
PUT: Updating properties of an advertising space
Parameters
| connectid
| mandatory
| header or query parameter
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| signature is required for authorization to eliminate any possibility of data abuse.
|
| adspaceItem
| mandatory
| body parameter
| the modified adspace item.
|
| callback
| optional
| query parameter
| Supported if format is JSON. Name of the JS function the result is wrapped in.
|
Example Request
// REST XML
http://api.zanox.com/xml/2011-03-01/adspaces/adspace
// REST JSON
http://api.zanox.com/json/2011-03-01/adspaces/adspace
// REST XML using Header Authorization
PUT /xml/2011-03-01/adspaces/adspace HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2010 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
// message body
<xml>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<request>
<adspaceItem>
<contact>newtestcontact@example.com</contact><!--Just an update of the contact address-->
<adspaceItem>
</request>
</xml>
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns="http://api.zanox.com/namespace/2011-03-01/">
<adspaceItem xml:lang="en">
<name>example.com</name>
<url>http://www.example.com</url>
<contact>newtestcontact@example.com</contact><!--Just an update of the contact address-->
<description>This website contains ...</description>
<visitors>100.000</visitors>
<impressions>5.000.000</impressions>
<type>website</type>
<scope>business</scope>
<regions>
<region>de</region>
<region>en</region>
</regions>
<categories>
<category>11</category>
<category>12</category>
</categories>
</adspaceItem>
</response>
DELETE: Removing an advertising space
Parameters
| connectid
| mandatory
| header or query parameter
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| signature is required for authorization to eliminate any possibility of data abuse.
|
| adspace
| mandatory
| path parameter
| the adspace parameter specifies the adspace you want to remove.
|
| callback
| optional
| query parameter
| Supported if format is JSON. Name of the JS function the result is wrapped in.
|
Example Request
// REST XML
http://api.zanox.com/xml/2011-03-01/adspaces/adspace/{adspaceId}
// REST JSON
http://api.zanox.com/json/2011-03-01/adspaces/adspace/{adspaceId}
// REST XML using Header Authorization
DELETE /xml/2011-03-01/adspaces/adspace/1 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2010 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/2011-03-01/">
<count>0</count>
</response>
Explanation of the Response objects
- adspaceItem
- adspaceCategories