Skipping the Client ID manual entery

12 views
Skip to first unread message

Luigi Taccetta

unread,
Nov 2, 2017, 9:40:24 AM11/2/17
to AdWords API Forum
Is there a way to fetch the list of Client ID(s) related to the refresh_token authorized, without using the ClientCustomerId?

The idea is to automatically fetch the list of Google AdWords Client ID(s), right after the application has been authorized, and chose from there which Client ID the user want to use.

The latest example examples/AdWords/v201710/AccountManagement/GetAccountHierarchy.php needs the ClientCustomerId when setting the AdWordsSessionBuilder, so I cannot perform the call without the the ClientCustomerId.

Bharani Cherukuri (AdWords API Team)

unread,
Nov 2, 2017, 3:57:56 PM11/2/17
to AdWords API Forum
Hello, 

If you are looking to get all accounts that are directly associated to your OAuth credentials, you can use the CustomerService.getCustomers() without specifying the clientCustomerId in the request. If no clientCustomerId is specified in the request, the API call will return multiple entries if more than one account is directly accessible with the authenticated account. You can take a look at this guide on how to implement this. 

Regards,
Bharani, AdWords API Team
Reply all
Reply to author
Forward
0 new messages