Stop and start ads
Uses the cURL utility
This example shows how to stop serving ads using the Ads.suspend method and restart using the Ads.resume method. For instance, you can pause and resume your ads based on product inventory levels. This helps you avoid wasting money on promoting out-of-stock items.
To use the examples, specify the OAuth token and ad IDs in the input data. If you're submitting a request on behalf of an agency, be sure to include the client's login.
Stop
curl \
-H 'Authorization: Bearer ТОКЕН' \
-H 'Client-Login: ЛОГИН_КЛИЕНТА' \
-d '{ "method": "suspend",
"params": {
"SelectionCriteria": {
"Ids": [ИДЕНТИФИКАТОР_1,ИДЕНТИФИКАТОР_2,...,ИДЕНТИФИКАТОР_N]
}
}
}' https://api.direct.yandex.com/json/v5/ads
Start
curl \
-H 'Authorization: Bearer ТОКЕН' \
-H 'Client-Login: ЛОГИН_КЛИЕНТА' \
-d '{ "method": "resume",
"params": {
"SelectionCriteria": {
"Ids": [ИДЕНТИФИКАТОР_1,ИДЕНТИФИКАТОР_2,...,ИДЕНТИФИКАТОР_N]
}
}
}' https://api.direct.yandex.com/json/v5/ads
Note
For cURL in Windows, replace all single quotes with double quotes, and escape double quotes in JSON code. For example: -d "{\"method\"...
Was the article helpful?
Previous
Next