Endpoints
Four separate endpoints support requests to create campaign and line item reports and retrieve the report data and status.| Verb | Endpoint | Description |
|---|---|---|
| POST | /reports/campaigns | Create a Campaign report request |
| POST | /reports/line-items | Create a Line Item report request |
| GET | /reports/{reportId}/status | Get status of a specific report |
| GET | /reports/{reportId}/output | Download output of a specific report |
Report Request Attributes
| Attribute | Data Type | Description |
|---|---|---|
id / ids* | string / list<string> | Campaign or Line Item ID(s) of the desired reportExamples: id: "12345" ids: ["12345", "67890"]Accepted values: single or list of string/int64 (max 50 ids per call) Writeable? N / Nullable? N |
reportType | enum | Report types are pre-packaged reports that allow the specification of the report breakdown. See Report Types for more details about each of them.- *Note**: when metrics and dimensions are used, the reportType is ignored.Accepted values: refer to Report Types page for a complete list of available values Writeable? N / Nullable? N |
dimensions | list<enum> | Dimension attributes desired for metrics breakdown for the custom report of the campaign(s) / line item(s).- *Note**: |
- when
metricsanddimensionsare used, thereportTypeis automatically ignoredAccepted values: refer to Metrics and Dimensions page for a complete list of available values Writeable? N / Nullable? N | |metrics| list<enum> | Quantitative metrics desired in the custom report of the campaign(s) / line item(s).- *Note**: - when
metricsanddimensionsare used, thereportTypeis automatically ignored - when including
winRatemetric, it is required to either definecampaignTypeassponsoredProductsor includecampaignTypeNamein the list of dimensionsAccepted values: refer to Metrics and Dimensions page for a complete list of available values Writeable? N / Nullable? N | |startDate* | date | Start date to report (inclusive)Accepted values:YYYY-MM-DDWriteable? N / Nullable? N | |endDate* | date | End date to report (inclusive)Accepted values:YYYY-MM-DDWriteable? N / Nullable? N | |campaignType| enum | Campaign typeAccepted values:sponsoredProducts,onSiteDisplaysWriteable? N / Nullable? N | |timeZone| string | Time zone to consider in the reportAccepted values: IANA (TZ database) time zones (example:America/New_York,Europe/Paris,Asia/Tokyo,UTC) Writeable? N / Nullable? Y | |clickAttributionWindow| enum | The post-click attribution window, defined as the maximum number of days considered between a click and a conversion for attribution; conversions are attributed to the date of conversion, not the date of click; defaults to campaign settings if omitted; must be specified ifviewAttributionWindowis one of the accepted values.The post-click attribution window, defined as the maximum number of days considered between a click and a conversion for attribution; conversions are attributed to the date of conversion, not the date of click. Defaults to campaign settings if omitted; must be specified ifviewAttributionWindowis one of the accepted values.Accepted values:none,7D,14D,30DWriteable? N / Nullable? Y | |viewAttributionWindow| enum | The post-view attribution window, defined as the maximum number of days considered between an impression and a conversion for attribution; conversions are attributed to the date of conversion, not the date of impression; defaults to campaign settings if omitted; must be less than or equal toclickAttributionWindow; must be specified ifclickAttributionWindowis one of the accepted values.The post-view attribution window, defined as the maximum number of days considered between an impression and a conversion for attribution; conversions are attributed to the date of conversion, not the date of impression. Defaults to campaign settings if omitted; must be less than or equal toclickAttributionWindow; must be specified ifclickAttributionWindowis one of the accepted values.Accepted values:none,1D,7D,14D,30DWriteable? N / Nullable? Y | |salesChannel| enum | Filter on specific sales channel: online or offlineAccepted values:online,offlineWriteable? N / Nullable? Y | |format| enum | Format of the report data returnedAccepted values:json,json-compact,json-newline,csvDefault:jsonWriteable? N / Nullable? N |
Reporting Asynchronous Workflow: Step 1 of 3
- First, create a request for the campaign or line item report with the desired attributes
- This generates a
reportIdrepresenting the report
Create a Report Request
Reporting endpoints provide two separate endpoints that allow downloading reports at the campaign or line item level. Each of the following requests can be repeated for each individual report type. Sample Request - Campaign ReportReporting Asynchronous Workflow: Step 2 of 3
- Next, use the
reportIdto poll the report status endpoint until one is successfully computed
Get Status of a Specific Report
This endpoint retrieves the status of a specific report. Status can bepending, success, failure, or expired
Sample Request
Reporting Asynchronous Workflow: Step 3 of 3
- Finally, download the report using the report output endpoint
- Report outputs are cached for at least 1 hour before expiration
- Exact expiration is indicated by the
expiresAtfield in the /status response
Download Output of a Specific Report
This endpoint returns the specific report in the requested format. Sample RequestWhat’s Next