注意:您正在查看 API 的 REST 接口的文档。我们的大多数官方客户端库都使用 gRPC。如需了解详情,请参阅
REST 简介。
其他方法
Mutate
、Search
和 SearchStream
是最常见的方法,
Google Ads API 中还有许多其他可用于特定用途的 API。所有服务和
其 API 均记录在
REST 参考文档。
协议缓冲区 RPC 到 REST 的映射
所有服务端点(无论是使用 REST 和 gRPC)最终都由
在
服务软件包的.proto 文件
使用
proto3 接口定义语言。
示例:ListAccessibleCustomers
例如,customer_service.proto
文件
除了标准 Mutate
之外,还定义了 ListAccessibleCustomers
方法
,了解所有最新动态。其 google.api.http
注解描述了
该方法映射到 HTTP 的方式它使用带有自定义动词的 HTTP GET
listAccessibleCustomers
:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
returns (ListAccessibleCustomersResponse) {
option (google.api.http) = {
get: "/v17/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: "/v17/customers/{customer_id=*}:createCustomerClient"
body: "*"
};
option (google.api.method_signature) = "customer_id,customer_client";
}
这将映射到 customers.createCustomerClient
REST 方法。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-10。
[null,null,["最后更新时间 (UTC):2024-09-10。"],[[["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"]]