GET /2015-03-01/report/program/{programid}
aggregatedReportList
for the given program ID. In order to use this API, you will first need:
- Your zanox Connect ID
- Your zanox Secret Key
- The program ID
The program ID you can get from the profile page of the zanox Marketplace. The connect ID and secret key you can get in the section "Links and Tool" under "Web Services".
Resource URL
https://advertiser.api.zanox.com/advertiser-api/2015-03-01/report/program/{programid}
Parameters
programid required | URL path parameter. The ID of the program to get report for. Value Type: Integer |
groupby | Aggregates data by given property. Day and month can be used only exclusively. Adspace and admedium can be combined. Value Type: String Possible values: day, month, adspace, admedium "day" will show one value per day of the selected time frame "month" will show one value per month of the selected time frame. "adspace" groups by publisher's adspace applied to your program "admedium" groups the values by the advertisement material which was used to generate the values. Default value: The data is grouped by day if groupby is not defined. Note: Grouped by adspace (with which the publisher is applied to your program) gives also the publisher name in response as well. |
fromdate | Earliest date in the report (inclusive). Value Type: String Format: yyyy-MM-dd Example Values: 2015-03-04 Note: The fromdate cannot be older than 90 days, means you can go back 90 days on maximum from now. |
todate | todate - 1 day = last date in the report (exclusive). Transactions of this date will not be displayed in the result (e.g. until YYYY-MM-DD 00:00:00) Value Type: String Format: yyyy-MM-dd Example Values: 2015-03-14 |
Authentication
API authentication implementation includes the connect ID, secured mhash key (signature) and the timestamp inside the HTTP header or as URL query parameters. The actual building of the signature is taken from the RFC2104 specification.
The signature is built by applying a keyed-HMAC (Hash Message Authentication Code) algorithm to the UTF-8 encoded StringToSign. The secret key has to be provided as a parameter to the keyed-HMAC method.
The signature will be valid for 30 miuntes and can be used just one time. Once you used a signature and nonce to optain data, you need to generate a new one.
Here is the simple explanation of how to generate a signature.
1 | Signature = Base64( HMAC-SHA1( UTF-8-Encoding-Of( StringToSign ) ) ); |
The StringToSign consists of a couple of elements that are concatenated:
1 | HTTP-Verb + URI + timestamp + nonce |
Where:
- HTTP Verb - GET, POST, PUT or DELETE
- URI - The path of specific request, excluding the protocol and domain name, together with path parameters.For example, for the URL 'https://advertiser.api.zanox.com/advertiser-api/2015-03-01/report/program/1803' the URI would be '/report/program/1803'.
- Timestamp - In GMT in the format "EEE, dd MMM yyyy HH:mm:ss GMT"
- Nonce - A unique random string, generated at the time of request, valid once, 20 or more characters
To successfully authenticate, connect ID, timestamp, nonce and signature have to be passed either as URL query parameters or as HTTP Headers. The query parameter names are connectid, date, nonce and signature respectively (line breaks added for clarity):
1 2 3 4 5 | https://advertiser.api.zanox.com/ ?connectid= 389676F47B4F22819102E7A&date=Mon, 02 Mar 2015 15:31:01 GMT &nonce= D76DD6AFEFA8312136DC0CE652CD6489&signature= 5enGx16yFtljnaoVmna4bxyWCmU= |
As headers, the authentication values must be set in the following way:
1 2 3 | Authorization: ZXWS connectid:signature Date: timestamp nonce: nonce |
Example Request
REST authentication information in our example is added as query parameters
Get report for program ID: 1803, group by days for the time period from 2015-02-10 to 2015-03-01
1 | |
Please note that the displayed URL above is an example and will not work as it is because it is using an example signatue.
JSON Example Response
{
- programId: 1803,
- programName: "DemoProgram",
- aggregatedReportList:
[
{
- adspace: "demoPublisherCashback@zanox.com (http://demo.cashback.zanox.de/)",
- ppcCommission: 0,
- ppcCount: 2,
- pplCommission: 15.24,
- pplCommissionApproved: 15.24,
- pplCommissionConfirmed: 0,
- pplCommissionOpen: 0,
- pplCommissionRejected: 0,
- pplCount: 2,
- pplCountApproved: 2,
- pplCountConfirmed: 0,
- pplCountOpen: 0,
- pplCountRejected: 0,
- ppsCommission: 883.76,
- ppsCommissionApproved: 18.26,
- ppsCommissionConfirmed: 16.39,
- ppsCommissionOpen: 849.11,
- ppsCommissionRejected: 0,
- ppsCount: 43,
- ppsCountApproved: 2,
- ppsCountConfirmed: 2,
- ppsCountOpen: 39,
- ppsCountRejected: 0,
- ppvCommission: 0,
- ppvCount: 4,
- tpvCount: 0
},
{
- adspace: "demoPublisherBlog@zanox.com (http://demo.blog.zanox.com/)",
- ppcCommission: 0,
- ppcCount: 0,
- pplCommission: 233.64,
- pplCommissionApproved: 23.34,
- pplCommissionConfirmed: 10.12,
- pplCommissionOpen: 200.18,
- pplCommissionRejected: 0,
- pplCount: 23,
- pplCountApproved: 2,
- pplCountConfirmed: 1,
- pplCountOpen: 20,
- pplCountRejected: 0,
- ppsCommission: 0,
- ppsCommissionApproved: 0,
- ppsCommissionConfirmed: 0,
- ppsCommissionOpen: 0,
- ppsCommissionRejected: 0,
- ppsCount: 0,
- ppsCountApproved: 0,
- ppsCountConfirmed: 0,
- ppsCountOpen: 0,
- ppsCountRejected: 0,
- ppvCommission: 0,
- ppvCount: 2,
- tpvCount: 0
}
]
}
Java and PHP Advertiser Client
Java client and php client are available on GitHub. Clone it and follow the README file to access your program statistics easily. Remember to get the secret key and connect ID first.
Resource Information
Rate Limited? | No |
Authentication | Requires signature. See Authentication section |
Response Formats | json |
HTTP Methods | GET |
Resource family | Report |
Response Object | aggregatedReportList |
API Version | 2015-03-01 |