GoogleAdWords api vs Google Ads API - GetCustomers

207 views
Skip to first unread message

Vinitha

unread,
Aug 6, 2019, 2:01:34 AM8/6/19
to AdWords API and Google Ads API Forum
Hi ,
I have seen a couple of posts talking about this but I did not clearly understand if this is "under work" or am I missing something.

All i need is to get the list of all accessible customers for my OAuth2ClientId and OAuth2ClientSecret. I am able to successfully retrieve an array of customers with Google AdWords API with the following call

var me = await ServiceExecute<CustomerService, Customer[]>(AdWordsService.v201809.CustomerService, tokenAccess, action: service =>
            {
                return service.getCustomers();
            });


Migrating to Google Ads API as per the documentation i call the following API
 var c = client.GetService(Services.V2.CustomerService);
 string[] customerResourceNames = c.ListAccessibleCustomers();

With the above call all i get back is one customerResourceName which is ("customers/myMCCAccountID")
I am expecting all clients that my MCC account has access to.

Please let me know if there is more to this in order to retrieve accountIDs for all accessible customers.

Thanks,
Vinitha.

Google Ads API Forum Advisor Prod

unread,
Aug 6, 2019, 2:15:34 PM8/6/19
to vin...@closedloop.com, adwor...@googlegroups.com
Hi Vinitha, 

The ListAccessibleCustomers will return only the accounts that are directly accessible by the user authenticating the API call. If the email address used for authorization might have to a single account.

If you are looking to get the hierarchy of the accounts, you will need to use the customer_client resource using the search query. Please give it a try and let me know if you have any further questions.

Thanks,
Bharani, Google Ads API Team
 

ref:_00D1U1174p._5001UEHzsv:ref
Reply all
Reply to author
Forward
0 new messages