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/00155678-b26d-4cac-8bee-571e7393e312%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Stijn van Lieshout
    • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... Stijn van Lieshout

Reply via email to