User doesn't have permission to access customer.

6,198 views
Skip to first unread message

Michael Grablevskii

unread,
Jun 23, 2021, 1:55:51 PM6/23/21
to AdWords API and Google Ads API Forum
Python 3.8.5
google-ads==12.0.0


I had a manager account 2329994790.
Then I created a new Google Ads account not from the manager account 2934192297.
But then I organized a manager for it (have a look at the screenshot).

I'm trying this quickstart tutorial: https://developers.google.com/google-ads/api/docs/first-call/overview

So, I organized google-ads.yaml.
developer_token: ...JQ
client_id: ...374r.apps.googleusercontent.com
client_secret: ...8m
refresh_token: ...Y50
login_customer_id: 2329994790

Then I check like this: 

michael@michael:~/PycharmProjects/GoogleAds/installation/google-ads-python/examples/account_management$ python list_accessible_customers.py 
Total results: 1
Customer resource name: "customers/2934192297"

Then I try to make a first call like described here: https://developers.google.com/google-ads/api/docs/first-call/get-campaigns#python

And I get this result: 

michael@michael:~/PycharmProjects/GoogleAds$ python main.py -c 2934192297
Request made: ClientCustomerId: 2934192297, Host: googleads.googleapis.com, Method: /google.ads.googleads.v8.services.GoogleAdsService/SearchStream, RequestId: nwCcGAEYtf7rDKrZW-hjog, IsFault: True, FaultMessage: User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
Request with ID "nwCcGAEYtf7rDKrZW-hjog" failed with status "PERMISSION_DENIED" and includes the following errors:
        Error with message "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid".

I attach another screenshot as a prof that I have given access rights to the manager account. It is not in English. But it is written here, that the access is given.

Could you help me understand how to cope with the problem?

Screenshot from 2021-06-23 20-53-45.png
Screenshot from 2021-06-23 20-34-32.png

Google Ads API Forum Advisor

unread,
Jun 25, 2021, 2:18:35 PM6/25/21
to poisk...@gmail.com, adwor...@googlegroups.com

Hi Michael,

Thank you for reaching out. My guess is that you created the OAuth2 credential using account 2934192297, however, you set the login_customer_id as 2329994790. You could either set the login_customer_id as 2934192297 or create the OAuth2 credentials using manager account 2329994790 to make it consistent. 

Thanks and regards,
Xiaoming, Google Ads API Team

Google Logo
Xiaoming
Google Ads API Team
 


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