How to read resourcename

260 views
Skip to first unread message

Google Ads API Explorer

unread,
Jan 22, 2021, 1:26:42 PM1/22/21
to AdWords API and Google Ads API Forum
HI,

I can see that we can set the resource names by passing the ids like
ResourceNames::forCustomer($customerId);

But how I can read it?

I have few resources like
customers/11110000/changeStatus/1111-4-XYZ-ABC-ZZZ

customers/ 11110000  /adGroupCriteria/1111 ~ZZZ

Is there any way using api where we can read resourcenames ?
I am expecting the API would return values which belong to which resource.



Best,


 
 

Google Ads API Forum Advisor Prod

unread,
Jan 25, 2021, 11:19:40 AM1/25/21
to apideve...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. To retrieve the values for a specific resource, you could query the resource_name of that resource and then map the corresponding attributes from that resource. For example, from the ad_group_criterion.resource_name we could tell that the returned values would match `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` so you could easily get the values of {customer_id}, {ad_group_id} and {criterion_id}. You would also be able to query these attributes directly from the ad_group_criterion resource.

Thanks and regards,
Xiaoming, Google Ads API Team
 

Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B2cXN:ref

Google Ads API Explorer

unread,
Jan 25, 2021, 12:01:33 PM1/25/21
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Yes, That I know that I can get through `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}`
But there must be so many extraction to get simple values. Like I said in previous example.
This is just one example, If I can see there is so many types of resource names.

It must be some kind of retrieval, like we have resource name  prepare function like ResourceNames::forCustomer($customerId)

Google Ads API Forum Advisor Prod

unread,
Jan 26, 2021, 8:56:42 AM1/26/21
to apideve...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. You could query the resource name of the specific resource to fetch all the values and the resource name as a whole. You could also use the specific function from the ResourceNames class to form and return the resource name.



Thanks and regards,
Xiaoming, Google Ads API Team
 

Reply all
Reply to author
Forward
0 new messages