Create New Report
To access your campaign performance data via reporting API, you can create a report with necessary parameters as defined below. Please note, once a report is created, you can re-use the same report to fetch latest data. For instance, if you create a report for duration as "Last 7 days", this will be a rolling window and will always fetch last 7 days data depending on when you query the report
Parameters for Creating New Report
Parameter | Format | Required/ Optional | Description |
---|---|---|---|
advertiser_id | int | optional | Unique ID per advertiser |
name | string | required | Name of the report. |
report_type_id | string | required | Only supported value is rtb |
date_macro | string | optional | Select specific day or range of days. Supported Values - today yesterday last_three_days last_seven_days this_month last_month |
start_date | YYYY-MM-DD | required | Start date of report, e.g.: 2019-01-01 |
end_date | YYYY-MM-DD | required | End date of reports, e.g.: 2019-01-31 |
time_zone_id | int | required | Get report data as per a specific time_zone selected. Refer to Timezone |
metrics | array of string | required | Array of supported metrics. Please refer to Supported Parameters |
filters | JSON Object | optional | JSON object with key as reporting filter property and value as array of filter values. Please refer to Supported Parameters |
group_by | array of string(required) | required | List of dimensions to group by. Please refer to Supported Parameters |
attribution_sources | array of strings | optional | Values - mmp self assisted |
attribution_types | array of strings | optional | Values - click view total |
curl -X POST \
'https://api.kayzen.io/v1/reports' \
-d '{
"report" : {
"name":"test_report",
"report_type_id":"rtb",
"time_zone_id":11,
"metrics":["wins","impressions","clicks"],
"filters":{"campaign_id":[108996]},
"group_by":["day","campaign_id"],
"date_macro":"last_seven_days",
"start_date":"2019-04-19",
"end_date":"2019-04-25",
"attribution_sources":["mmp", "self"],
"attribution_types":["click","view"]
}
}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN'
{
"id":2641,
"advertiser_id":10928,
"name":"Report 1",
"start_date":"2019-04-19",
"end_date":"2019-04-25",
"date_macro":"last_seven_days",
"time_zone_id":11,
"metrics":[
"wins",
"impressions",
"clicks"
],
"filters":{
"campaign_id":[
108996
]
},
"group_by":[
"day",
"campaign_id"
],
"attribution_types":[
"click",
"view"
],
"attribution_sources":[
"mmp",
"self"
],
"created_at":"2019-04-24T21:45:33.000Z",
"last_updated_at":null,
"time_zone_name":"(GMT+00:00) UTC"
}
Updated almost 4 years ago