注意: API の REST インターフェースに関するドキュメントを表示しています。当社の公式クライアント ライブラリのほとんどは gRPC を使用しています。詳しくは、
REST の概要をご覧ください。
その他の方法
Mutate
、Search
、SearchStream
は Google Ads API で最も一般的なメソッドですが、特定の目的のためのメソッドは他にも多数あります。すべてのサービスとその API は、REST リファレンス ドキュメントに記載されています。
プロトコル バッファ RPC から REST へのマッピング
すべてのサービス エンドポイント(REST と gRPC のどちらを使用しているかにかかわらず)は、最終的に proto3 インターフェース定義言語を使用して services パッケージの .proto ファイルで定義されます。
例: ListAccessibleCustomers
たとえば、customer_service.proto
ファイルでは、標準の Mutate
に加えて ListAccessibleCustomers
メソッドを定義しています。google.api.http
アノテーションは、メソッドが HTTP にマッピングされる方法を記述します。カスタム動詞 listAccessibleCustomers
で HTTP GET
を使用します。
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
returns (ListAccessibleCustomersResponse) {
option (google.api.http) = {
get: "/v19/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: "/v19/customers/{customer_id=*}:createCustomerClient"
body: "*"
};
option (google.api.method_signature) = "customer_id,customer_client";
}
これは、customers.createCustomerClient REST メソッドに対応しています。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-03-08 UTC。
[null,null,["最終更新日 2025-03-08 UTC。"],[[["While `Mutate`, `Search`, and `SearchStream` are commonly used, the Google Ads API offers a wide range of methods for specific tasks, all documented in the REST reference documentation."],["All Google Ads API service endpoints, including REST and gRPC, are defined in .proto files using the proto3 Interface Definition Language."],["The `google.api.http` annotation within these .proto files details how each method maps to HTTP for RESTful interactions, including examples like `ListAccessibleCustomers` and `CreateCustomerClient`."]]],["The Google Ads API includes various methods beyond `Mutate`, `Search`, and `SearchStream`, all detailed in REST documentation. Service endpoints are defined in `.proto` files using proto3. `ListAccessibleCustomers` is a GET method, mapped using the `google.api.http` annotation in the `customer_service.proto` file, and uses custom verb `listAccessibleCustomers`. Similarly, `CreateCustomerClient`, a POST method, uses custom verb `createCustomerClient`, also defined in the same file.\n"]]