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

REST V2009-02-01 Reports

From Wiki.zanox.com

Jump to: navigation, search

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 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.

Contents

GET: Retrieving a single sale item

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.
saleid mandatory path parameter ID of the sale 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/reports/sales/sale/10421-234prp-23fo3of-235m3n
 
// REST JSON
http://api.zanox.com/json/reports/sales/sale/10421-234prp-23fo3of-235m3n

// REST XML using Header Authorization
GET /xml/reports/sales/sale/1 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 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>14</total>
    <reportsResult>
        <saleItem id="http://api.zanox.com/xml/2008-05-21/reports/leads/lead/{id}">
            <status>open</status>
            <date>2008-01-02T00:00:00.000Z</date>
            <modifieddate>2008-01-03T00:00:00.000Z</modifieddate>
            <clickdate>2008-01-02T00:00:00.000Z</clickdate>  
            <adspace id=""></adspace>            
            <admedia id=""></adspace>                  
            <program id=""></program>
	      <amount>476.8</amount>
            <commission>50.00</commission>
            <currency>EUR</currency>
            <publisher id="numeric, alphanumeric if available">      <!-- also called Sub-ID -->
                <commission>0.00</commission>
            </publisher>
        </saleItem>  
    </reportResult>
</response>
 

GET: Retrieving a single lead item

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.
saleid mandatory path parameter ID of the sale 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/reports/leads/lead/10421-234prp-23fo3of-235m3n
 
// REST JSON
http://api.zanox.com/json/reports/leads/lead/10421-234prp-23fo3of-235m3n

// REST XML using Header Authorization
GET /xml/reports/leads/lead/1 HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 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>23</total>
    <reportsResult>
        <leadItem id="http://api.zanox.com/xml/2008-05-21/reports/leads/lead/{id}">
            <status>open</status>
            <date>2008-01-02T00:00:00.000Z</date>
            <modifieddate>2008-01-03T00:00:00.000Z</modifieddate>
            <clickdate>2008-01-02T00:00:00.000Z</clickdate>  
            <adspace id=""></adspace>            
            <admedia id=""></adspace>                  
            <program id=""></program>
            <commission>50.00</commission>
            <currency>EUR</currency>
            <publisher id="numeric, alphanumeric if available">      // also called Sub-ID
                <commission>0.00</commission>
            </publisher>
        </leadItem>  
    </reportResult>
</response>
 

GET: Retrieving all sale items

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.
date mandatory query parameter date returns all sales/leads of given day (default = today)
modifieddate optional query parameter modifieddate returns all sales/leads modified at given day (scheduled)
not supported yet
clickdate optional query parameter clickdate returns all sales/leads where the corresponding click was at the given day (scheduled)
not supported yet
items optional query parameter number of items in the result set [1..n] (default = 10; maximum = 50)
not supported yet
page optional query parameter page position [0..n] (default: 0)
not supported yet

Example Request

// REST XML
http://api.zanox.com/xml/reports/sales?date=2008-10-03
 
// REST JSON
http://api.zanox.com/json/reports/sales?date=2008-10-03

// REST XML using Header Authorization
GET /xml/reports/sales HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 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>23</total>
    <reportsResult>
        <saleItem id=""> ...</saleItem>  
        <saleItem id=""> ...</saleItem>  
        <saleItem id=""> ...</saleItem>  
    </reportResult>
</response>
 


GET: Retrieving all lead items

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.
date mandatory query parameter date returns all sales/leads of given day (default = today)
modifieddate optional query parameter modifieddate returns all sales/leads modified at given day (scheduled)
not supported yet
clickdate optional query parameter clickdate returns all sales/leads where the corresponding click was at the given day (scheduled)
not supported yet
items optional query parameter number of items in the result set [1..n] (default = 10; maximum = 50)
not supported yet
page optional query parameter page position [0..n] (default: 0)
not supported yet

Example Request

// REST XML
http://api.zanox.com/xml/reports/leads?date=2008-10-03
 
// REST JSON
http://api.zanox.com/json/reports/leads?date=2008-10-03

// REST XML using Header Authorization
GET /xml/reports/leads HTTP/1.1
Host: api.zanox.com
Date: Mon, 09 Sep 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>4</items>
    <total>4</total>
    <reportsResult>
        <leadItem id="">...</leadItem>  
        <leadItem id="">...</leadItem>  
        <leadItem id="">...</leadItem>  
        <leadItem id="">...</leadItem>  
    </reportResult>
</response>
 

Explanation of Response Items

  1. sale
  2. lead
Personal tools