Training
For clients
Загружается...
A resource that allows you to retrieve, update, and delete ads.
Used object: Banner
Retrieving a single ad
Request example
GET /api/v2/banners/23617841.json
Response example
{ "id": 23826937 "ad_group": 9367343 }
Editing an ad
Request example
POST /api/v2/banners/23826937.json { "status": "blocked" }
Response example
HTTP 204
The contents of the urls, textblocks, and content sections are fully replaced on update. For example, for a banner with content:
{ "content": { "logo_image": { "id": 83465432 }, "promo_image": { "id": 90465432 }, "tpl_background_image": { "id": 86342123 } } }
the update request:
{ "content": { "logo_image": { "id": 83465432 }, "promo_image": { "id": 88278634 }, "tpl_background_image_300": { "id": 72934723 } } }
will result in exactly this new content section after the update.
Possible response codes
Possible error codes
In general, an error message has the following format:
{ "error": { "fields": { "<field_name_1\>": { "message": "<error_message_1\>", "code": "<error_code_1\>" }, "<field_name_2\>": { "message": "<error_message_2\>", "code": "<error_code_2\>" } }, "message": "Validation failed", "code": "validation_failed" } }
where field_name_N is the name of the field where the error occurred, error_message_N is the error description, and error_code_N is the error code.
Example:
{ "error": { "fields": { "call_to_action": { "message": "Unallowed value", "code": "unallowed_value" } }, "message": "Validation failed", "code": "validation_failed" } }
Deleting an ad
Request example
DELETE /api/v2/banners/23617841.json
Response example
HTTP 204
Possible response codes