注意:您正在查看 API 的 REST 介面說明文件。我們的官方用戶端程式庫支援 gRPC。詳情請參閱 REST 簡介

其他方法

雖然 MutateSearchSearchStream 是 Google Ads API 中最常見的方法,但還有其他方法可以用於特定用途。所有服務及其 API 都會記錄在 REST 參考說明文件中。

通訊協定緩衝區 RPC 與 REST 對應

所有服務端點 (使用 REST 和 gRPC) 最終都會使用 proto3 介面定義語言,在 Service 套件的 .proto 檔案中定義。

範例:ListAccessibleCustomers

例如,除了標準 Mutate 之外,customer_service.proto 檔案也會定義 ListAccessibleCustomers 方法。其 google.api.http 註解說明該方法如何對應至 HTTP。它使用 HTTP GET 搭配自訂動詞 listAccessibleCustomers

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

這對應至 customers.listAccessibleCustomers REST 方法。

範例:CreateCustomerClient

customer_service.proto 的另一個範例是 CreateCustomerClient 方法。其 google.api.http 註解會使用自訂動詞 createCustomerClient 說明 HTTP POST

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

這會對應至 customers.createCustomerClient REST 方法。