Managed accounts discovery with the new Ads API (missing endpoint?!)

217 views
Skip to first unread message

Pierre Bazoge

unread,
May 28, 2019, 2:38:12 AM5/28/19
to AdWords API and Google Ads API Forum
Hello guys,

When I hit the endpoint https://googleads.googleapis.com/v1/customers:listAccessibleCustomers , the response sends back a list of "first-level" customers which can be "managers" accounts:

{
"resourceNames": [
"customers/0000000000",
"customers/11111111111",
....
]
}

Let's "customers/11111111111" is a manager that controls other customers, how do you list the "managed customers" with the API please?

ps: because there is no official package for Golang, could you please specify what is the HTTP JSON endpoint.

Thanks

Google Ads API Forum Advisor Prod

unread,
May 28, 2019, 6:42:39 AM5/28/19
to adwor...@googlegroups.com
Hi Pierre,

You can get the accounts under a MCC by calling the CustomerClientLinkService.GetCustomerClientLink. Let me know if you have further clarifications.

Regards,
Dannison
Google Ads API Team

ref:_00D1U1174p._5001UAqoGy:ref

Pierre Bazoge

unread,
Jun 3, 2019, 7:58:16 AM6/3/19
to AdWords API and Google Ads API Forum
Hi Dannison,

Thanks for your reply, I tried ti guess what's the HTTP endpoint for this call but couldn't find it, could you please explain to me how to "guess" those endpoints from the services ?

Also is it a POST or GET ? what's the payload please ?

The Google Ads API without a client lib is so obscure...

Thank you for your help

Google Ads API Forum Advisor Prod

unread,
Jun 4, 2019, 5:15:53 PM6/4/19
to adwor...@googlegroups.com, pba...@gmail.com
Hello Pierre, 

I'm Dannison's colleague addressing your concern as he is out of office. You may refer to the API Call structure documentation which illustrates in detail about the endpoint that should be used and the request URL. CustomerClientLinkService will have the URL path as customerClientLinks. This can also be seen in the proto file definition too. I have attached the sample request and response logs which might be helpful. 

Thanks,
Bharani, Google Ads API Team



ref:_00D1U1174p._5001UAqoGy:ref
Sample_Logs.rtf

Pierre Bazoge

unread,
Jun 14, 2019, 4:25:08 AM6/14/19
to AdWords API and Google Ads API Forum
Hi Bharani,

Thank you for your help, unfortunately I still couldn't guess the valid HTTP endpoint to get a Customer Client Link... as your example was about ListAccessibleCustomers which wasn't my question.

Got a 400 clueless error response for the following HTTP requests:


- GET https://googleads.googleapis.com/v1/customers/{MANAGER_CUSTOMER_ID}/customerClientLinks:get?resource_name=customers/{CLIENT_CUSTOMER_ID}

Could you please show me a working CURL example to list the underlying accounts of a Manager customer?

Thank you

ps: the HTTP endpoint below every resource and service should be added to the docs...

Google Ads API Forum Advisor Prod

unread,
Jun 14, 2019, 4:52:17 PM6/14/19
to pba...@gmail.com, adwor...@googlegroups.com

Hello Pierre,

I am Bharani's colleague working on this concern. The CURL operation to get the manager customers under the MCC account is below. This query will only give the resource names of the customers, if you want to get the customer details then have to make one API call for each customer to fetch those details.

curl -X POST --header 'Authorization: Bearer ACCESS_TOKEN_HERE' --header 'developer-token: DEVELOPER_TOKEN_HERE' --header 'Content-Type: application/json' --header 'login-customer-id: LOGIN_CUSTOMER_ID_HERE' --data @- https://googleads.googleapis.com/v1/customers/CUSTOMER_ID_HERE/googleAds:search <<EOF
{ query: "SELECT customer_client.resource_name, customer_client.client_customer, customer_client.level, customer_client.hidden FROM customer_client", validate_only: "false" }
EOF

Please give it a try and let me know if you have any further questions.

Regards,
Sai Teja, Google Ads API Team



ref:_00D1U1174p._5001UAqoGy:ref

Pierre Bazoge

unread,
Jun 15, 2019, 7:19:17 AM6/15/19
to AdWords API and Google Ads API Forum
Thank you Sai for the working example,

The first thing a SaaS app does when providing a Google Ads Connect, is to show the tree of available Accounts and if they are "managers" their underlying "Managed Accounts".

The way to produce such inevitable feature with Google Ads API in a SaaS app is to:

1. Get a first-level accounts with the endpoint: https://googleads.googleapis.com/v1/customers:listAccessibleCustomers

2. Loop over every "customers/ID" resource names to find out if it's a "manager" account with: https://googleads.googleapis.com/v1/customers/CUSTOMER_ID/googleAds:search

3. For each "manager" account, query each Customer Client to retrieve the "descriptiveName" of the account with: https://googleads.googleapis.com/v1/customers/MANAGED_CUSTOMER_ID

So for a user account having access to 2 "manager accounts", themselves having access to 2 "managed accounts" I would have to do 5 queries. This just to show a basic tree of accounts with their respective "descriptiveNames" and IDs?!

Are you working on a single endpoint that would output such result in one request please? as we can't do JOINs in the search endpoint...

Would be really awesome!

Thanks

Google Ads API Forum Advisor Prod

unread,
Jun 17, 2019, 10:19:44 AM6/17/19
to adwor...@googlegroups.com
Hello Pierre,

Thanks for sharing the scenario in detail. For now yes you have to follow the steps you mentioned. Our team is aware of this concern and trying to add features to get more details via Customer_client resource. I will update you on this thread once I have more information. Meanwhile you could keep an eye on this blog and the release notes to track the new features and upcoming releases.

You should be able to upload JSONs to the endpoints as well for mutate operations as shown in this API call example. Please let me know if you have any further questions.
Reply all
Reply to author
Forward
0 new messages