注意:您正在查看 API 的 REST 接口的文档。我们的大多数官方客户端库都使用 gRPC。如需了解详情,请参阅
REST 简介。
服务方法
Google Ads API 的设计与传统 REST 架构不同
因为它主要使用自定义方法,例如 search
和 mutate,
比较传统的 list
、get
、create
、update
和 delete
方法之一。
这些操作使用 HTTP 映射在 REST 网址中表示
一种 :
惯例,将自定义动词与网址的其余部分隔开。
例如,广告系列 mutate API 调用使用以下网址:
https://googleads.googleapis.com/v17/customers/1234567890/campaigns:mutate
该 API 使用自定义方法的一个原因是
单个 API 请求。严格的 REST 语义只允许
一次更新一个广告系列。传统 REST
update
更改为
需要为每个广告系列发送一个 HTTP PATCH 请求
资源。
要允许将多个操作捆绑到一个请求正文中,
而是为大多数资源定义了一个自定义 mutate
方法。
同样,如需从 API 启用批量读取(一次提取多个对象),
该 API 将自定义 search
方法与类似于 SQL 的 Google Ads 查询结合使用
语言。
常用方法页面详细介绍了
Google Ads API 中最常用的方法。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["The Google Ads API utilizes custom methods like `search` and `mutate` instead of standard REST methods for efficiency and batch operations."],["This approach allows for updating multiple campaigns or fetching numerous objects within a single request, unlike traditional REST."],["Custom methods are expressed in REST URLs using a colon to separate the verb from the rest of the URL, for example, `https://googleads.googleapis.com/v18/customers/1234567890/campaigns:mutate`."],["Batching operations, like updating many campaigns simultaneously, are enabled through the custom `mutate` method, improving efficiency over individual requests."],["The `search` method uses a SQL-like query language for batch reads, enabling retrieval of multiple objects in one API call."]]],[]]