Lesson 7. How to make changes via the API

All the data-changing methods, such as add, update, delete, accept an array of objects as an input. Each object contained in the request is processed separately. For example, if your app has sent a request to create 100 ads and an error has occurred to 10 of them, the other 90 ads are created successfully. The API server returns IDs for the 90 ads created, and errors for the other 10 ads.

Alert

The object ID is returned only if the operation has been completed successfully (warnings may also be issued).

If errors preclude request execution (for example, their format is invalid or a required parameter is missing), the request is rejected completely.

Your application must account for this while interacting with the API, to properly handle the errors returned by the server.f

How to edit object parameters

When using the update method to change an object, you do not have to pass all the object parameters. You only have to specify the object ID and the parameters to be changed. The other parameters won't change. The Yandex Direct server will check anyway the entire object and return an error if the new parameter values have invalidated the object.