Google Ads API and AdWords API Forum

147 views
Skip to first unread message

Illia Gerasimenko

unread,
May 2, 2022, 2:02:21 PM5/2/22
to Google Ads API and AdWords API Forum
Hi team,
I'm trying to run a get_account_hierarchy.py script from https://github.com/googleads/google-ads-python/blob/73e61d50150385042957e908a5a1a6632afedcc1/examples/account_management/get_account_hierarchy.py with --manager_customer_id=6561797468 (that's the id of Google Ads Manager account), but I'm having this error:

Request made: ClientCustomerId: 6561797468, Host: googleads.googleapis.com, Method: /google.ads.googleads.v10.services.GoogleAdsService/Search, RequestId: 4FT0Tv5bArT_oJmk7aWYJw, 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 "4FT0Tv5bArT_oJmk7aWYJw" 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"

Could you please help me and explain what this means and how to deal with it:
"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"?

Google Ads API Forum Advisor

unread,
May 3, 2022, 4:14:51 AM5/3/22
to illia.cge...@gmail.com, adwor...@googlegroups.com

Hi Illia,

Thank you for reaching out to us.

With regard to your concern, kindly note that you may receive error ‘USER_PERMISSION_DENIED’ if you’re incorrectly setting the 'login-customer-id’ in the request or when a user doesn't have permission to access a customer and you’re accessing a client customer using 'login-customer-id’ in the request. With that, kindly ensure that the user email used to create OAuth credentials also has the appropriate access for the Ads account that you are targeting.

If the issue persists, could you please provide us with the complete logs (request and response with request-id) and the user / email address you used to generate the credentials. You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,

Google Logo
Princess Pamela
Google Ads API Team
 


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