资源名称
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Google Ads API 中实体的唯一标识符称为资源
名称,并以可预测格式的字符串表示。如果您知道
资源名称的组成部分时,您可以使用此实用程序
生成最终的资源名称。
PathLookupUtil
如果需要,您可以使用路径查询实用程序来构建实体的资源名称
知道与该实体相关的所有 ID。例如,广告系列
资源名称的格式为
customers/{customer_id}/campaigns/{campaign_id}
,因此,如果您认识该客户
ID 和广告系列 ID,您可以使用路径查找实用程序构建完整的
资源名称如下所示:
client.path.campaign(customer_id, campaign_id)
您也可以使用其他实体名称,这些实体名称根据不同的标识符采用不同的 ID
资源名称的最终形式
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003eResource names uniquely identify Google Ads entities and follow a predictable format.\u003c/p\u003e\n"],["\u003cp\u003eThe PathLookupUtil helps construct resource names using known entity IDs, such as customer and campaign IDs.\u003c/p\u003e\n"],["\u003cp\u003eResource name formats vary based on the specific entity and require corresponding entity IDs.\u003c/p\u003e\n"]]],[],null,["# Resource Names\n\nThe unique identifier for an entity in the Google Ads API is called a resource\nname, and is represented as a string with a predictable format. If you know\nthe constituent components of a resource name, you can use this utility to\ngenerate the final resource name.\n\nPathLookupUtil\n--------------\n\nThe path lookup util is a way to construct the resource name of an entity if you\nknow all of the relevant IDs related to that entity. For example, a campaign\nresource name is in the format\n`customers/{customer_id}/campaigns/{campaign_id}`, so if you know the customer\nID and the campaign ID, you can use the path lookup util to construct the full\nresource name as follows: \n\n client.path.campaign(customer_id, campaign_id)\n\nYou can use other entity names as well, which take different IDs depending on\nthe final form of the resource name."]]