AI-generated Key Takeaways
-
The Google Ads API uses custom methods like
searchandmutateinstead of traditional REST methods such aslist,get,create,update, anddelete. -
Custom methods in the API are represented in REST URLs using a
:to separate the custom verb. -
The use of custom methods allows the Google Ads API to bundle multiple operations into a single API request, such as batching updates or fetching many objects at once.
-
Batch reads in the API are enabled by the custom
searchmethod, which uses the SQL-like Google Ads Query Language.
The design of the Google Ads API differs from a traditional REST architecture
because it primarily uses custom methods, such as search and mutate, instead
of the more traditional list, get, create, update, and delete methods.
These actions are expressed in REST URLs by using the HTTP mapping
convention of a : to separate the custom verb from the rest of the URL.
For example, a campaign mutate API call uses the following URL:
https://googleads.googleapis.com/v22/customers/1234567890/campaigns:mutate
One reason that the API uses custom methods is to enable batching of multiple
operations into a single API request. Strict REST semantics would only allow
updating one campaign at a time. A traditional REST
update to a
campaign, for example, would require sending one HTTP PATCH request per campaign
resource.
To allow many operations to be bundled together within a single request body,
the Google Ads API instead defines a custom mutate method for most resources.
Similarly, to enable batch reads (fetching many objects at once) from the API,
the API uses a custom search method with a SQL-like Google Ads Query
Language.
The Common methods page goes into detail on the most frequently used methods in the Google Ads API.