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 On Saturday, June 15, 2019 at 4:52:17 AM UTC+8, adsapiforumadvisor wrote: > > 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 -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/ba72166c-4aa3-43aa-82b0-848f79eee8f8%40googlegroups.com.
