Google Ads API'de en yaygın yöntemler Mutate
, Search
ve SearchStream
olsa da belirli amaçlar için kullanılan başka birçok yöntem vardır. Tüm hizmetler ve API'leri referans belgelerinde açıklanmıştır.
Protokol arabelleği UPÇ'den REST'e eşlemeler
Tüm hizmet uç noktaları (REST ve gRPC kullanılsın ya da kullanılmasın) nihayetinde proto3 Arayüz Tanımlama Dili kullanılarak hizmet paketi.proto dosyalarında tanımlanır.
Örnek: ListAccessibleCustomers
Örneğin, customer_service.proto
dosyası, standart Mutate
'ye ek olarak bir ListAccessibleCustomers
yöntemi tanımlar. google.api.http
notu, yöntemin HTTP ile nasıl eşlendiğini açıklar. Özel fiille birlikte HTTP GET
kullanır
listAccessibleCustomers
:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) { option (google.api.http) = { get: "/v21/customers:listAccessibleCustomers" }; }
Bu, REST yöntemindeki customers.listAccessibleCustomers ile eşleşir.
Örnek: CreateCustomerClient
customer_service.proto
'den bir başka örnek de CreateCustomerClient
yöntemidir. google.api.http
ek açıklaması, özel fiil createCustomerClient
kullanılarak bir HTTP POST
'yi tanımlar:
rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) { option (google.api.http) = { post: "/v21/customers/{customer_id=*}:createCustomerClient" body: "*" }; option (google.api.method_signature) = "customer_id,customer_client"; }
Bu, customers.createCustomerClient REST yöntemiyle eşlenir.