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 ads based on product inventory levels. This helps you avoid wasting money on 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 TOKEN' \
-H 'Client-Login: CLIENT_LOGIN' \
-d '{ "method": "suspend",
"params": {
"SelectionCriteria": {
"Ids": [ID_1,ID_2,...,ID_N]
}
}
}' https://api.direct.yandex.com/json/v5/ads
Start
curl \
-H 'Authorization: Bearer TOKEN' \
-H 'Client-Login: CLIENT_LOGIN' \
-d '{ "method": "resume",
"params": {
"SelectionCriteria": {
"Ids": [ID_1,ID_2,...,ID_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