有兴趣分享您对 Google Ads API 的反馈吗?
注册即可获邀参与用户调研!
资源名称
Google Ads API 中实体的唯一标识符称为资源名称,表示为格式可预测的字符串。如果您知道资源名称的组成部分,则可以使用此实用程序生成最终资源名称。
ResourceNames 类
如果您知道与实体相关的所有相关 ID,则可以使用 ResourceNames
类构建实体的资源名称。例如,广告系列资源名称的格式为 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):2025-02-26。
[null,null,["最后更新时间 (UTC):2025-02-26。"],[[["The Google Ads API client library for .NET will drop support for .NET 5.0 starting with version 19.0.0, urging users to upgrade to a newer version."],["Resource names are unique identifiers for entities in the Google Ads API, following a predictable format based on the entity's components."],["You can easily construct resource names using the `ResourceNames` class if you know the necessary IDs, such as customer and campaign IDs."]]],[]]