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

REST V2009-07-01 Adspaces

From Wiki.zanox.com

Jump to: navigation, search

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

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.

Contents

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/2009-07-01/adspaces/adspace/{adspaceId}
 
// REST JSON
http://api.zanox.com/json/2009-07-01/adspaces/adspace/{adspaceId}

// REST XML using Header Authorization
GET /xml/2009-07-01/adspaces/adspace/12345 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/2009-07-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/2009-07-01/adspaces
 
// REST JSON
http://api.zanox.com/json/2009-07-01/adspaces

// REST XML using Header Authorization
GET /xml/2009-07-01/adspaces 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/2009-07-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

currently not supported

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/2009-07-01/adspaces/adspace
 
// REST JSON
http://api.zanox.com/json/2009-07-01/adspaces/adspace

// REST XML using Header Authorization
POST /xml/2009-07-01/adspaces/adspace HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2008 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/2009-07-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

currently not supported

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/2009-07-01/adspaces/adspace
 
// REST JSON
http://api.zanox.com/json/2009-07-01/adspaces/adspace

// REST XML using Header Authorization
PUT /xml/2009-07-01/adspaces/adspace HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Jun 2008 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/2009-07-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

currently not supported

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/2009-07-01/adspaces/adspace/{adspaceId}
 
// REST JSON
http://api.zanox.com/json/2009-07-01/adspaces/adspace/{adspaceId}

// REST XML using Header Authorization
DELETE /xml/2009-07-01/adspaces/adspace/1 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/2009-07-01/">
	<count>0</count>
</response>
 

Explanation of the Response objects

  1. adspaceItem
Personal tools