Report

1. Description

This Report method provides an API frontend that enables the retrieval of a report containing details of your activity on a given period.

Reporting can be done on a restricted scope (geozone, subid, product) or can be grouped by the geozone, subid or product.

2. API call

Before using this call, you must authenticate to get your token.

The following parameters are available to specify the details of your call:

Parameter Mandatory Description
token Yes reporting request start date, date format should be as follows YYYY-MM-DD. Unique identification key. To get a token, use authenticate call: https://api.affinitad.com/authenticate.
You can then use this token during 30 min for your API calls.
start Yes reporting request start date, date format should be as follows YYYY-MM-DD
end Yes reporting request end date, date format should be as follows YYYY-MM-DD
subid[] No Filter results for one or several sub-id.
Syntax: ...&subid[]=123&subid[]=456...
product[] No The product ID for which you wish to see the stats. NB: You can get your products ID’s by grouping first on products (&group=product).

Syntax: ...& product[]=1&product[]=3...
geozone[] No The geozone for which you wish to see the stats. Expected values are the 2-letter ISO 3166-1 Country Codes. Currently allowed values are :
  • FR for France
  • US for United States
  • GB for United Kingdom
  • DE for Germany
  • ES for Spain
  • IT for Italy
  • PL for Poland
  • NL for the Netherlands
  • BR for Brazil
  • SE for Sweden
  • Syntax: ...& geozone[]=FR&geozone[]=GB...
group Yes Group Data by a value to be selected among the following options {‘day’, ‘subid’, ‘product’, ‘geozone’}. Each result will be associated with the corresponding tag.
format Yes Response format to be selected among the following options {‘xml’, ‘json’, ‘jsonp’}. ‘jsonp’ should be used with jsonp_callback parameter.

3. Output format

JSON

{
    “results”: {
        “@attributes”: {
            “total”: “91”
        },
        “result”: [{
            “date”: “2010-03-31”,
            “impressions”: “146”,
            “clicks”: “48”,
            “keywords”: “47”,
            “revenues”: “34.4”,
            “ctr”: “0.33”, 
            “ecpc”: “0.72”,
            “ecpm”: “235.62”
        },
        ...]
    },
    “totals”: {
        “impressions”: “17624”,
        “clicks”: “3776”,
        “keywords”: “3737”,
        “average_cpc”: “0.61”,
        “average_ctr”: “0.21”,
        “average_cpm”: “0.13”
    }
}