Different responses in CustomerService.getCustomers() & CustomerServiceClient.ListAccessibleCustomers() | Google Ads API Migration

114 views
Skip to first unread message

Tomas Guerra

unread,
Feb 10, 2022, 1:54:26 PM2/10/22
to Google Ads API and AdWords API Forum
Hi,
I'm working on the migration of a service that employs Google Adwords API. I'm migrating to Google Ads API.

I'm having different responses when I make the call to get the accessible customer accounts for the configuration set. We manage many client accounts using refresh tokens that are generated with their consent through our web app. With these refresh tokens we list and mutate user_lists. 

For some cases (there are cases like this that are working OK) in which the refresh token has access to only one google ads account, I'm having the following issue:
When I list all the accessible customer accounts using Adwords CustomerService.getCustomers(), I get the single Google Ads account. In this case, I can make the operations I need (list/mutate user_lists). 
However, when I do the same using the Google Ads Java Client Library (CustomerServiceClient.ListAccessibleCustomers()), I get none, and I cannot make any operation as I get a USER_PERMISSION_DENIED error. And I'm using the same refresh token for both cases!

Do you know what could be the issue? could be the case that a refresh_token is valid only for Adwords API and invalid for Google Ads API? 

So far, I've identified 3 of our client's accounts with this issue. It is weird because there are cases like this that work alright, and a few of these are failing

Please advice

Google Ads API Forum Advisor

unread,
Feb 10, 2022, 10:30:46 PM2/10/22
to tomasgu...@gmail.com, adwor...@googlegroups.com

Hello Tomas,

Thank you for reaching out to us.

As per this migration guide, the requirements for authentication remain the same. The Google Ads API uses OAuth2 for authentication, which requires an access token at the time of the request. You can re-use your existing refresh token, client id, and client secret that were used for the AdWords API without any adjustments.

On your request header, have you provided the login-customer-id? In the Google Ads API, the login-customer-id is a new required header when using a manager account to access an operating customer account.

As also mentioned on this common error guide, one o the causes of the USER_PERMISSION_DENIED is that you're authenticating as a user with access to a manager account but not specifying login-customer-id in the request.

If issue still persists after specifying the login-customer-id in your request, please share to us the complete API logs (request and response with request-id) so our team can further check. You may send the requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Google Logo
Mark Kevin
Google Ads API Team
 


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