有兴趣分享您对 Google Ads API 的反馈吗?
注册即可获邀参与用户调研!
资源名称
Google Ads API 中实体的唯一标识符称为资源
名称,并以可预测格式的字符串表示。如果您知道
资源名称的组成部分时,您可以使用此实用程序
生成最终的资源名称。
ResourceNames 类
ResourceNames
类是一种构造实体资源名称的方法
如果您知道与该实体相关的所有相关 ID。例如,
广告系列资源名称采用以下格式:
customers/{customer_id}/campaigns/{campaign_id}
如果您知道客户 ID 和广告系列 ID,就可以使用
ResourceNames
类构造完整资源名称,如下所示:
String campaignResourceName = ResourceNames.campaign(customerId, campaignId);
您也可以使用其他实体名称,这些实体名称根据不同的标识符采用不同的 ID
资源名称的最终形式
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-14。
[null,null,["最后更新时间 (UTC):2024-10-14。"],[[["The Google Ads API uses unique identifiers called resource names to represent entities."],["Resource names follow a predictable format and can be generated using their components."],["The `ResourceNames` class allows you to construct a resource name using relevant IDs, such as customer ID and campaign ID."],["Using entity names like `campaign` with appropriate IDs in the `ResourceNames` class generates the full resource name string."]]],[]]