Get the allowed date range
If you need to limit the date selection for a specific object (a campaign, banner, or site), request the allowed date range:
GET /api/v2/reports/available-dates?level=campaign&id=12345
Query parameters
|
Parameter |
Type |
Required status |
Description |
|
|
|
Yes |
Supported report levels:
|
|
|
|
Yes |
Object ID exactly as it appears in the user interface for this level (string). Numeric IDs can be sent as a digit string. |
|
|
|
Optional for admins and assistants. Required for advertisers and website owners. |
Website owner account (see Authorization). |
Successful response
|
Field |
Type |
Description |
|
|
|
|
|
|
|
|
|
|
|
Echo of the passed |
|
|
|
|
|
|
|
Lower limit. The format is defined by the data source — typically a compact date string. |
|
|
|
Upper limit. |
Sample request
curl -H 'Authorization: OAuth <token>' \
'https://adfox.yandex.ru/api/v2/reports/available-dates?level=campaign&objectId=12345&ownerId=67890'
Response example
{
"result": {
"level": "campaign",
"id": "12345",
"dateRange": {
"from": "2023-01-01",
"to": "2024-06-30"
}
}
}
Error
For error codes, see the Error codes page.