Create New Report

πŸ“˜

POST https://api.kayzen.io/v1/reports

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

ParameterFormatRequired/ OptionalDescription
advertiser_idintoptionalUnique ID per advertiser
namestringrequiredName of the report.
report_type_idstringrequiredOnly supported value is rtb
date_macrostringoptionalSelect specific day or range of days. Supported Values -
today
yesterday
last_three_days
last_seven_days
this_month
last_month
start_dateYYYY-MM-DDrequiredStart date of report, e.g.: 2019-01-01
end_dateYYYY-MM-DDrequiredEnd date of reports, e.g.: 2019-01-31
time_zone_idintrequiredGet report data as per a specific time_zone selected. Refer to Timezone
metricsarray of stringrequiredArray of supported metrics. Please refer to Supported Parameters
filtersJSON ObjectoptionalJSON object with key as reporting filter property and value as array of filter values. Please refer to Supported Parameters
group_byarray of string(required)requiredList of dimensions to group by. Please refer to Supported Parameters
attribution_sourcesarray of stringsoptionalValues -

mmp
self
assisted
attribution_typesarray of stringsoptionalValues -

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"
}