Request body:
{
"GroupBy":["<grouping field 1>, <grouping field 2>", ...], // required
"StartDate":"<start of period (yyyy-MM-dd)>", // required
"EndDate":"<end of period (yyyy-MM-dd)>", // required
"OrderBy":[
{"field": "<sort field>", "order":"<sort direction (asc/desc)>"},
...
],
"Filter": [ // filters
{
"Field":"<field to filter on>",
"Values":["<value1>", "<value2>", ...], // values of the same field are combined with a logical OR
"Op":"<operator (=, <>, >, <, >=, <=, like)>"
}, // filters on different fields are combined with a logical AND
...
],
"DataFields":["<field1>", "<field2>", ...], // required. List of requested fields.
"Timezone":180, // Optional. The time zone the data should be returned in (in minutes relative to UTC; 180 = UTC+3). Available on specific platforms only.
"PlatformName":"<platform_name>" // Optional. Fill in if the user has access to more than one platform.
}
Response (Success):
{
"Total":{
"DataCount": [
{
"Field":"<field name>",
"Value":"<field value>"
},
...
],
"RecCount":<total number of distinct values of the field specified in GroupBy>
},
"Data": [
{
"DataFields": [
{"Field":"<field name>", "Value":"<field value>" },
...
],
"GroupingFields": [
{"Field":"<grouping field 1>","Value":"<value>"},
{"Field":"<grouping field 2>","Value":"<value>"},
…
]
},
...
]
}
Response (if required fields are missing or non-existent data fields are used):
{
"Type": "exception",
"Message": "<message explaining the error>"
}
Response (if the token is invalid):
{
"Type": "access",
"Message": "Token invalid"
}
Sample request:
{
"GroupBy": ["placement_id"],
"StartDate": "2014-01-01",
"EndDate": "2014-01-07",
"DataFields": ["bids", "imps", "clicks", "adv_payout", "pub_payout"],
"Filter": [{
"Field": "publisher_id", "Values": [41], "Match": "equals"
}]
}
Sample response:
{
"Total": {
"DataCount": [
{"Field": "bids", "Value": "12345678"},
{"Field": "imps", "Value": "1365872" },
{"Field": "clicks", "Value": "21621"},
{"Field": "adv_payout", "Value": "30733.028700000148"},
{"Field": "pub_payout", "Value": "0.0"}
],
"RecCount": 1
},
"Data": [
{
"DataFields":
[
{"Field": "bids", "Value": "12345678"},
{"Field": "imps", "Value": "1365872" },
{"Field": "clicks", "Value": "21621"},
{"Field": "adv_payout", "Value": "30733.028700000148"},
{"Field": "pub_payout", "Value": "0.0"}
],
"GroupingFields":
[
{"Field":"placement_id","Value":"1519"}
]
}
]
}