How to List Accessible Customers

147 views
Skip to first unread message

John Smith

unread,
Jan 26, 2021, 5:47:44 PM1/26/21
to AdWords API and Google Ads API Forum
I have a user signing google login and this produces AccessToken and a RefreshToken.

Currently the user enters his AdWords account id and together with AccessToken and  RefreshToken, api calls are being made.

I need to changes this so that the user does not enter his AdWords account id, instead I expect to call  ListAccessibleCustomers() using only the AccessToken and a RefreshToken and obtain the user's AdWords account id from the API response. 

My problem is that I cant understand how to construct  GoogleAdsClient()  object so that I can instantiate it with the given  AccessToken and a RefreshToken?


CustomerServiceClient customerService =  new GoogleAdsClient().GetService(Services.V5.CustomerService);

var customerResourceNames = customerService.ListAccessibleCustomers();

Google Ads API Forum Advisor Prod

unread,
Jan 27, 2021, 12:39:06 PM1/27/21
to nutcaseb...@gmail.com, adwor...@googlegroups.com

Hi John,

Thank you for reaching out. Please use this code snippet to fetch the client customer id of the user.

Thanks and regards,
Xiaoming, Google Ads API Team
 

Google Logo
Xiaoming
Google Ads API Team
 


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