AI-generated Key Takeaways
-
Besides common methods like Mutate, Search, and SearchStream, the Google Ads API offers many other methods for specific purposes, all documented in the reference documentation.
-
Service endpoints in the Google Ads API are defined in .proto files using the proto3 Interface Definition Language, which outlines how methods map to HTTP.
-
Examples like
ListAccessibleCustomersdemonstrate how methods are mapped to HTTP GET requests with custom verbs in the .proto files. -
The
CreateCustomerClientexample shows how a method is mapped to an HTTP POST request with a custom verb and body in the .proto file.
While Mutate, Search, and SearchStream are the most common methods
in the Google Ads API, there are many others for specific purposes. All services and
their APIs are documented in the
reference documentation.
Protocol buffer RPC to REST mappings
All the service endpoints (whether using REST and gRPC) are ultimately defined in the .proto files of the services package using the proto3 Interface Definition Language.
Example: ListAccessibleCustomers
For example, the customer_service.proto file
defines a ListAccessibleCustomers method, in addition to the standard Mutate
. Its google.api.http annotation describes
how the method maps to HTTP. It uses an HTTP GET with the custom verb
listAccessibleCustomers:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) { option (google.api.http) = { get: "/v22/customers:listAccessibleCustomers" }; }
This maps to the customers.listAccessibleCustomers REST method.
Example: CreateCustomerClient
Another example from customer_service.proto is
the CreateCustomerClient method. Its google.api.http annotation describes an
HTTP POST using the custom verb createCustomerClient:
rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) { option (google.api.http) = { post: "/v22/customers/{customer_id=*}:createCustomerClient" body: "*" }; option (google.api.method_signature) = "customer_id,customer_client"; }
This maps to the customers.createCustomerClient REST method.