API Response
Introduction
Our APIs respond with data
, errors
, and metadata
blocks where appropriate. For example:
-
metadata
appears only for paginated responses, -
A response expected to return multiple entities may contain both
data
anderrors
blocks, -
Entity IDs
are unique across all Retail Media entities.
Response example
{
"data": [
{
"type": "{entityType}",
"id": "{entityId}",
"attributes": {
"{fieldName}": {numericValue},
"{fieldName}": "{stringValue}",
// ...
}
},
// ...
],
"errors": [
{
"traceId": "{traceId}",
"type": "{errorType}",
"code": "{errorCode}",
"instance": "{uri}",
"title": "{errorTitle}",
"detail": "{errorDetail}",
"source": {
"{fieldName}": "{fieldPath}",
// ...
}
},
// ...
],
"metadata": {
"totalItemsAcrossAllPages": {numberOfEntities},
"currentPageSize": {pageSize},
"currentPageIndex": {pageIndex},
"totalPages": {numberOfPages},
"nextPage": "https://api.criteo.com/{endpoint}?pageIndex={pageIndex}&pageSize={pageSize}",
"previousPage": "https://api.criteo.com/{endpoint}?pageIndex={pageIndex}&pageSize={pageSize}"
}
}
Data Attributes
Attribute | Type | Description |
---|---|---|
id | string | Unique ID for the entity. Entity IDs are unique across all Retail Media entities |
type | string | Type of entity |
attributes | object | Entity attributes - may be omitted entirely if an entity does not have additional attributes |
Error Attributes
Attribute | Type | Description |
---|---|---|
traceId | string | Unique ID for the error response |
type | string | Type of error; machine-readable (e.g. validation ) |
code | string | Short machine-readable string for the error (e.g. required-field ) |
instance | string | URI referencing the endpoint that caused the error |
title | string | Short human-readable string that summarizes the issue |
detail | string | Human-readable explanation of the issue |
source | object | Object referencing the field that caused the error |
Pagination
-
Pagination is supported via query parameters for a subset of endpoints that list multiple entities.
-
Results are returned in ascending order by
id
-
List all Accounts associated with your API credentials
-
List all Brands associated with the Account
-
List all Retailers associated with the Account
-
List all Campaigns within the Account
-
List all Line Items within the Campaign
-
List all Promoted Products on the Line Item
-
List all Balances on the Account
-
List all Campaigns on the Balance
Query Parameters | Type | Description |
---|---|---|
pageIndex | integer | Returns the specified page of results given a pageSize ; pages are 0-indexed |
pageSize | integer | Specifies the maximum number of entities returned in a single page; defaults to 25 entities per page |
limitToId | integer | Limits results to the entity IDs specified; parameter key is repeated, e.g. limitToId=1&limitToId=2 |
HTTP Response Codes
Response | Description |
---|---|
🔵 200 OK | Request successful |
🔵 201 Created | The new entity was successfully created |
🔵 204 No Content | Request succeeded and no returned content should be expected |
🟡 207 Multi-Status | This may occur when operating on multiple entities, such as the call resulting in some successes but also some failures |
🔴 400 Bad Request | For improper syntax, check your call structure |
🔴 401 Unauthorized | If unauthenticated, refresh your access token |
🔴 403 Forbidden | Insufficient rights to perform this action |
🔴 404 Not Found | Resource not found, check your entity IDs in the call |
🔴 408 Timeout | Request timed out |
🔴 409 Conflict | Request conflicts with something, such as a campaign name that already exists |
🔴 429 Too Many Requests | Too many requests |
🔴 5xx | Something's wrong on Criteo's end... |
Updated 23 days ago