Perhatian: Anda sedang melihat dokumentasi untuk antarmuka REST API. Sebagian besar library klien resmi kami menggunakan gRPC. Lihat
Pengantar REST untuk mengetahui detailnya.
Metode Lain
Meskipun Mutate
, Search
, dan SearchStream
adalah metode paling umum
di Google Ads API, ada banyak metode lainnya untuk tujuan tertentu. Semua layanan dan API-nya didokumentasikan dalam dokumentasi referensi REST.
Pemetaan RPC buffering protokol ke REST
Semua endpoint layanan (baik menggunakan REST maupun gRPC) pada akhirnya ditentukan
dalam
file.proto paket layanan
menggunakan
proto3 Interface Definition Language.
Contoh: ListAccessibleCustomers
Misalnya, file customer_service.proto
menentukan metode ListAccessibleCustomers
, selain Mutate
standar. Anotasi google.api.http
-nya menjelaskan
cara metode dipetakan ke HTTP. Fungsi ini menggunakan GET
HTTP dengan kata kerja kustom
listAccessibleCustomers
:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
returns (ListAccessibleCustomersResponse) {
option (google.api.http) = {
get: "/v19/customers:listAccessibleCustomers"
};
}
Hal ini dipetakan ke metode REST
customers.listAccessibleCustomers.
Contoh: CreateCustomerClient
Contoh lain dari customer_service.proto
adalah
metode CreateCustomerClient
. Anotasi google.api.http
-nya menjelaskan
POST
HTTP menggunakan kata kerja kustom createCustomerClient
:
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";
}
Hal ini dipetakan ke metode REST customers.createCustomerClient.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-03-08 UTC.
[null,null,["Terakhir diperbarui pada 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"]]