Gotcha. I got the definition to work now by using the ManagedCustomerService <https://developers.google.com/adwords/api/docs/reference/v201806/ManagedCustomerService>. Thanks!
On Monday, 10 September 2018 09:56:44 UTC+2, Peter Oliquino (AdWords API Team) wrote: > > Hi Stijn, > > The CustomerService is a service used only to retrieve account specific > information. If what you wish is to retrieve information on accounts under > a specific hierarchy, you will need to use the ManagedCustomerService > <https://developers.google.com/adwords/api/docs/reference/v201806/ManagedCustomerService> > instead. > You may note that the CanManageClients > <https://developers.google.com/adwords/api/docs/reference/v201806/ManagedCustomerService.ManagedCustomer#canmanageclients> > field > is also supported in the ManagedCustomer > <https://developers.google.com/adwords/api/docs/reference/v201806/ManagedCustomerService.ManagedCustomer> > object > of the ManagedCustomerService. > > I hope this helps and feel free to write back if you need further > information. > > Thanks and regards, > Peter > AdWords API Team > > On Monday, September 10, 2018 at 1:26:19 PM UTC+8, Stijn van Lieshout > wrote: >> >> I am building an Adwords application with oAuth 2.0 authentication in >> python. >> >> I'm able to retrieve all Adwords accounts associated with a google >> account using the *get_accounts* function below. But now I would like to >> drill down deeper into the account hierarchy if an account >> canManageClients (read: mcc account). >> >> I've already had a look at the Get account hierarchy under the current >> account >> <https://developers.google.com/adwords/api/docs/samples/python/account-management#get-the-account-hierarchy-under-the-current-account> >> >> but there ManagedCustomerService is used whereas I don't manage these >> accounts and am using CustomerService instead. >> >> How to retrieve Adwords accounts under an MCC account using >> CustomerService? >> >> *How I am currently retrieving accounts:* >> >> from googleads import adwords >> >> def get_accounts(client): >> customer_service = client.GetService('CustomerService', version= >> 'v201806') >> selector = { >> 'fields': ['customerId', 'descriptiveName', 'canManageClients'] >> } >> accounts = customer_service.getCustomers(selector) >> >> result = [] >> for account in accounts: >> customerId = account['customerId'] >> name = account['descriptiveName'] >> canManageClients = account['canManageClients'] >> if canManageClients: >> # How to retrieve all accounts under MCC account here? >> result.append({"id": customerId, "name": name, "canManageClients" >> : canManageClients}) >> return result >> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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]. 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/baa1c4e6-8916-4c94-8211-f7720a07443c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
