Inne metody

Chociaż Mutate, Search i SearchStream to najczęściej używane metody w interfejsie Google Ads API, istnieje wiele innych metod do określonych celów. Wszystkie usługi i ich interfejsy API są opisane w dokumentacji referencyjnej.

Mapowania RPC bufora protokołu na REST

Wszystkie punkty końcowe usługi (niezależnie od tego, czy używają REST, czy gRPC) są ostatecznie zdefiniowane w plikach.proto pakietu usług przy użyciu języka definicji interfejsu proto3.

Przykład: ListAccessibleCustomers

Na przykład plik customer_service.proto definiuje metodę ListAccessibleCustomers oprócz standardowej metody Mutate . Jej google.api.http adnotacja opisuje jak metoda jest mapowana na HTTP. Używa ona HTTP GET z niestandardowym czasownikiem listAccessibleCustomers:

rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
    returns (ListAccessibleCustomersResponse) {
  option (google.api.http) = {
    get: "/v25/customers:listAccessibleCustomers"
  };
}

Jest to mapowane na metodę REST customers.listAccessibleCustomers.

Przykład: CreateCustomerClient

Innym przykładem z customer_service.proto jest metoda CreateCustomerClient. Jej adnotacja google.api.http opisuje HTTP POST z niestandardowym czasownikiem createCustomerClient:

rpc CreateCustomerClient(CreateCustomerClientRequest)
    returns (CreateCustomerClientResponse) {
  option (google.api.http) = {
    post: "/v25/customers/{customer_id=*}:createCustomerClient"
    body: "*"
  };
  option (google.api.method_signature) = "customer_id,customer_client";
}

Jest to mapowane na metodę REST customers.createCustomerClient.