From Wiki.zanox.com
The reports RESTFul API resource enables the retrieval of clicks, leads and sales. Please note that all report functions currently work with CEST (GMT+2) or CET (GMT+1).
Various types of reports can be retrieved via this API resource.
GET: Retrieving a single sale item
Behaviour
- hourly updates
- up to 90 minutes behind realtime
Parameters
| Name
| Necessity
| Parameter type
| Data type
| Description
|
| connectid
| mandatory
| header or query parameter
| String
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| String
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| String
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| String
| signature is required for authorization to eliminate any possibility of data abuse.
|
| saleid
| mandatory
| path parameter
| String
| ID of the sale item.
|
| callback
| optional
| query parameter
| String
| 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/reports/sales/sale/91E422A5-0047-4444-AAAA-5F52069F37B7?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST JSON
http://api.zanox.com/json/2009-07-01/reports/sales/sale/91E422A5-0047-4444-AAAA-5F52069F37B7?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST XML using Header Authorization
GET /xml/2009-07-01/reports/sales/sale/91E422A5-0047-4444-AAAA-5F52069F37B7 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 2008 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Nonce: 12345678912345678911
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns="http://api.zanox.com/namespace/2009-07-01/">
<saleItem id="91E422A5-0047-4444-AAAA-5F52069F37B7">
<reviewState>open</reviewState>
<trackingDate>2009-07-01T16:00:22.477+02:00</trackingDate>
<modifiedDate>2009-07-01T16:00:24.400+02:00</modifieddate>
<clickDate>2009-07-01T15:41:08.023+02:00</clickdate>
<adspace id="7773331">Test Ad</adspace>
<admedium id="3235693">120x240 sky</admedia>
<program id="49">mypaper.de</program>
<clickId>12398989352</clickId>
<lptId>93734409782364</lptId>
<amount>23.37</amount>
<commission>5.5</commission>
<currency>EUR</currency>
<subpublisher id="0">
<commission>0.0</commission>
</subpublisher>
<category id="28888">Test Cat</category>
<gpps>
<gpp id="zpar0">NZ76123n3nF115874863</gpp>
<gpp id="zpar9">CE665464E0186EA44282</gpp>
</gpps>
</saleItem>
</response>
GET: Retrieving a single lead item
Behaviour
- hourly updates
- up to 90 minutes behind realtime
Parameters
| Name
| Necessity
| Parameter type
| Data type
| Description
|
| connectid
| mandatory
| header or query parameter
| String
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| String
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| String
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| String
| signature is required for authorization to eliminate any possibility of data abuse.
|
| leadid
| mandatory
| path parameter
| String
| ID of the lead item.
|
| callback
| optional
| query parameter
| String
| 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/reports/leads/lead/91E422A5-0047-4444-AAAA-5F52069F37B7?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST JSON
http://api.zanox.com/json/2009-07-01/reports/leads/lead/91E422A5-0047-4444-AAAA-5F52069F37B7?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST XML using Header Authorization
GET /xml/2009-07-01/reports/leads/lead/91E422A5-0047-4444-AAAA-5F52069F37B7 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 2008 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Nonce: 12345678912345678911
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns="http://api.zanox.com/namespace/2009-07-01/">
<leadItem id="91E422A5-0047-4444-AAAA-5F52069F37B7">
<reviewState>open</reviewState>
<trackingDate>2009-07-01T16:00:22.477+02:00</trackingDate>
<modifiedDate>2009-07-01T16:00:24.400+02:00</modifieddate>
<clickDate>2009-07-01T15:41:08.023+02:00</clickdate>
<adspace id="7773331">Test Ad</adspace>
<admedium id="3235693">120x240 sky</admedia>
<program id="49">mypaper.de</program>
<clickId>12398989352</clickId>
<lptId>93734409782364</lptId>
<commission>5.5</commission>
<currency>EUR</currency>
<subpublisher id="0">
<commission>0.0</commission>
</subpublisher>
<category id="28888">Test Cat</category>
<gpps>
<gpp id="zpar0">NZ76123n3nF115874863</gpp>
<gpp id="zpar9">CE665464E0186EA44282</gpp>
</gpps>
</leadItem>
</response>
GET: Retrieving all sale items
Behaviour
- hourly updates
- up to 90 minutes behind realtime
Parameters
| Name
| Necessity
| Parameter type
| Data type
| Description
|
| connectid
| mandatory
| header or query parameter
| String
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| String
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| String
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| String
| signature is required for authorization to eliminate any possibility of data abuse.
|
| date
| mandatory
| path parameter
| String
| date returns all sales/leads of given day (default = today), e.g. "2010-09-01"
|
| datetype
| optional
| query parameter
| DateTypeEnum (toString)
| datetype specifies the date parameter above. trackingDate, modifiedDate, clickDate. Default value is trackingDate.
|
| adspace
| optional
| query parameter
| Integer
| adspace constrains the result to sales/leads which are related to the specified adspace.
|
| program
| optional
| query parameter
| Integer
| program constrains the result to the specified program.
|
| state
| optional
| query parameter
| ReviewStateEnum (toString)
| state constrains the result to the specified review state: "confirmed", "open", "approved", "rejected". Default value is ALL.
|
| items
| optional
| query parameter
| Integer
| number of items in the result set [1..n] (default = 10; maximum = 50)
|
| page
| optional
| query parameter
| Integer
| page position [0..n] (default: 0)
|
Example Request
// REST XML
http://api.zanox.com/xml/2009-07-01/reports/sales/date/2008-10-03?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST JSON
http://api.zanox.com/json/2009-07-01/reports/sales/date/2008-10-03?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST XML using Header Authorization
GET /xml/2009-07-01/reports/sales/date/2008-10-03 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 2008 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Nonce: 12345678912345678911
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>23</total>
<saleItems>
<saleItem id=""> ...</saleItem>
<saleItem id=""> ...</saleItem>
<saleItem id=""> ...</saleItem>
</saleItems>
</response>
GET: Retrieving all lead items
Behaviour
- hourly updates
- up to 90 minutes behind realtime
Parameters
| Name
| Necessity
| Parameter type
| Data type
| Description
|
| connectid
| mandatory
| header or query parameter
| String
| connectid is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| String
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| String
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| String
| signature is required for authorization to eliminate any possibility of data abuse.
|
| date
| mandatory
| path parameter
| String
| date returns all sales/leads of given day (default = today)
|
| datetype
| optional
| query parameter
| DateTypeEnum (toString)
| datetype specifies the date parameter above. TRACKING_DATE, MODIFIED_DATE, CLICK_DATE. Default value is TRACKING_DATE.
|
| adspace
| optional
| query parameter
| Integer
| adspace constrains the result to sales/leads which are related to the specified adspace.
|
| program
| optional
| query parameter
| Integer
| program constrains the result to the specified program.
|
| state
| optional
| query parameter
| ReviewStateEnum (toString)
| state constrains the result to the specified reviewstate. CONFIRMED, OPEN, APPROVED, REJECTED. Default value is ALL.
|
| items
| optional
| query parameter
| Integer
| number of items in the result set [1..n] (default = 10; maximum = 50)
|
| page
| optional
| query parameter
| Integer
| page position [0..n] (default: 0)
|
Example Request
// REST XML
http://api.zanox.com/xml/2009-07-01/reports/leads/date/2008-10-03?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST JSON
http://api.zanox.com/json/2009-07-01/reports/leads/date/2008-10-03?connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST XML using Header Authorization
GET /xml/2009-07-01/reports/leads/date/2008-10-03 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 2008 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Nonce: 12345678912345678911
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>4</items>
<total>4</total>
<leadItems>
<leadItem id="">...</leadItem>
<leadItem id="">...</leadItem>
<leadItem id="">...</leadItem>
<leadItem id="">...</leadItem>
</leadItems>
</response>
GET: Retrieving aggregated Report
Behaviour
Parameters
| Name
| Necessity
| Parameter type
| Data type
| Description
|
| connectid
| mandatory
| header or query parameter
| String
| connectID is required for authorization to eliminate any possibility of data abuse.
|
| timestamp
| mandatory
| header or query parameter
| String
| timestamp is required for authorization to eliminate any possibility of data abuse.
|
| nonce
| mandatory
| header or query parameter
| String
| nonce is required for authorization to eliminate any possibility of data abuse.
|
| signature
| mandatory
| header or query parameter
| String
| signature is required for authorization to eliminate any possibility of data abuse.
|
| fromdate
| mandatory
| query filter parameter
| String
| startDate of the timeperiod to get a report
|
| todate
| mandatory
| query filter parameter
| String
| endDate of the timeperiod to get a report
|
| datetype
| optional
| query filter parameter
| DateTypeEnum (toString)
| datetype specifies the date parameter above. Currently only the TRACKING_DATE is supported.
|
| currency
| optional
| query filter parameter
| String
| filter your reports for specified currencies
|
| program
| optional
| query filter parameter
| Integer
| filter your reports for specified programs
|
| admedium
| optional
| query filter parameter
| Integer
| filter your reports for specified admedia
|
| admediumformat
| optional
| query filter parameter
| Integer
| filter your reports for specified admediumformats, see AdmediumFormat
|
| adspace
| optional
| query filter parameter
| Integer
| filter your reports for specified adspaces
|
| state
| optional
| query filter parameter
| ReviewStateEnum (toString)
| filter your reports for specified reviewStates (CONFIRMED, OPEN, APPROVED, REJECTED)
|
| groupby
| optional
| query grouping parameter
| List<GroupByEnum (toString)>
| a list of grouping parameters defines for which parameters the reports should be grouped.
(COUNTRY, REGION, CITY, CURRENCY, ADMEDIUM, PROGRAM, ADSPACE, LINKFORMAT, REVIEWSTATE, TRACKINGCATEGORY, MONTH, DAY, HOUR, YEAR, DAYOFWEEK)
|
Example Request
// REST XML
http://api.zanox.com/xml/2009-07-01/reports/basic?currency=EUR&groupby=dayofweek&fromdate=2009-06-10&todate=2009-06-20&connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST JSON
http://api.zanox.com/json/2009-07-01/reports/basic?currency=EUR&groupby=dayofweek&fromdate=2009-06-10&todate=2009-06-20&connectid=CE665464E0186EA44282&date=Mon, 09 Sep 2008 08:17:35 GMT&signature=FN+JGAMxDShoyh3sfayql6jWCRc=&nonce=12345678912345678911
// REST XML using Header Authorization
GET /xml/2009-07-01/reports/basic HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 2008 08:17:35 GMT
Authorization: ZXWS CE665464E0186EA44282:FN+JGAMxDShoyh3sfayql6jWCRc=
Nonce: 12345678912345678911
Example Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns="http://api.zanox.com/namespace/2009-07-01/">
<items>7</items>
<total>7</total>
<reportsResult>
<reportItem>
<clickDateDayOfWeek>Sunday</clickDateDayOfWeek>
<viewCount>258378</viewCount>
<clickCount>43675</clickCount>
<leadCount>8</leadCount>
<saleCount>219</saleCount>
<saleAmount>1382.0</saleAmount>
<saleCommission>521.05005</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
<reportItem>
<clickDateDayOfWeek>Monday</clickDateDayOfWeek>
<viewCount>288223</viewCount>
<clickCount>44791</clickCount>
<leadCount>3</leadCount>
<saleCount>243</saleCount>
<saleAmount>1322.3</saleAmount>
<saleCommission>567.8</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
<reportItem>
<clickDateDayOfWeek>Tuesday</clickDateDayOfWeek>
<viewCount>234580</viewCount>
<clickCount>58812</clickCount>
<leadCount>14</leadCount>
<saleCount>447</saleCount>
<saleAmount>2389.0</saleAmount>
<saleCommission>938.4001</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
<reportItem>
<clickDateDayOfWeek>Wednesday</clickDateDayOfWeek>
<viewCount>536378</viewCount>
<clickCount>65506</clickCount>
<leadCount>14</leadCount>
<saleCount>476</saleCount>
<saleAmount>2019.25</saleAmount>
<saleCommission>953.4</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
<reportItem>
<clickDateDayOfWeek>Thursday</clickDateDayOfWeek>
<viewCount>544554</viewCount>
<clickCount>76329</clickCount>
<leadCount>11</leadCount>
<saleCount>436</saleCount>
<saleAmount>2255.0999</saleAmount>
<saleCommission>912.30005</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
<reportItem>
<clickDateDayOfWeek>Friday</clickDateDayOfWeek>
<viewCount>213911</viewCount>
<clickCount>18354</clickCount>
<leadCount>7</leadCount>
<saleCount>128</saleCount>
<saleAmount>518.8</saleAmount>
<saleCommission>229.85002</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
<reportItem>
<clickDateDayOfWeek>Saturday</clickDateDayOfWeek>
<viewCount>227156</viewCount>
<clickCount>11306</clickCount>
<leadCount>7</leadCount>
<saleCount>147</saleCount>
<saleAmount>535.9</saleAmount>
<saleCommission>253.30002</saleCommission>
<leadCommission>0.0</leadCommission>
<clickCommission>0.0</clickCommission>
</reportItem>
</reportItems>
</response>
Explanation of the Response objects
- saleItem
- leadItem
- reportItem