Hello Marc,

You could use customer_client 
<https://developers.google.com/google-ads/api/docs/fields/customer_client> 
resource 
to fetch the hierarchy of the accounts in a single API call. For example 
you could use the below query in your sample code to fetch the entire 
hierarchy in a single API call.

Sample query below:
.setQuery("SELECT customer.id, customer.descriptive_name, 
customer_client.resource_name, customer_client.client_customer, 
customer_client.level, customer_client.hidden FROM customer_client")

Hope this helps you, please let me know if you have any further questions.

Regards,
Sai Teja, Google Ads API Team

On Thursday, January 3, 2019 at 6:34:16 AM UTC-5, Marc Selman wrote:
>
> I'm trying to retrieve a complete nested tree of all customers (and if 
> it's a manager account, the customers below that etc.)
> To do this I'm using the new Google Ads API (v0.7) to retrieve the 
> CustomerClientLinks recursively and for every link I'm using GetCustomer to 
> retrieve the customer information such as the DescriptiveName.
> But for a simple tree with two levels and a total of 37 customers this 
> takes around a minute.
>
> The API methods seem rather slow. Is that normal?
>
> Also, I need to retrieve the links and the customerdata for every found 
> customerId to check if they have subaccounts and to get the name.
> Because of this I need to perform a lot of calls which could (with a large 
> tree) easily hit the rate limit.
> It would be better if I could retrieve all the available customers (paged) 
> in one call instead of having to recursively find them.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c19a4e47-02fe-456d-808c-784128b1b051%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Retriev... Marc Selman
    • Re... 'Teja Makani' via AdWords API and Google Ads API Forum
    • Re... 'Teja Makani' via AdWords API and Google Ads API Forum
      • ... Marc Selman
    • Re... 'Teja Makani' via AdWords API and Google Ads API Forum
      • ... Marc Selman
    • Re... 'Teja Makani' via AdWords API and Google Ads API Forum
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to