Permission denied for first API call

42 views
Skip to first unread message

Aditya Todkar

unread,
Dec 28, 2022, 6:48:47 AM12/28/22
to Google Ads API and AdWords API Forum
I am trying to make first API call using this command: 
python get_campaigns.py --customer_id=352-XXXXXX

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 have already created test manager account and after that I have created 2 accounts each having one test campaign. 

I have added test manager account customer id in google.yaml file but when I use customer id of red and blue account in python get_campaigns script it shows above error message. Can someone please let me know what I am missing?
Screenshot_1.png

Aditya Todkar

unread,
Dec 28, 2022, 8:20:03 AM12/28/22
to Google Ads API and AdWords API Forum
I was able to resolve the issue. After giving access to account used to generate credentials I was able to get all campaigns for particular customer id.

Reference: https://groups.google.com/g/adwords-api/c/sq7EeUt4Sp8/m/NlP-yZSKBAAJ

Google Ads API Forum Advisor

unread,
Dec 28, 2022, 8:51:01 AM12/28/22
to adit...@gmail.com, adwor...@googlegroups.com

Hi Aditya,

Thanks for reaching out to the Google Ads API Forum.

It appears that you have encountered USER_PERMISSION_DENIED error. Could you check in this thread if solution provided does help you? If not, you may provide us following details via reply privately to author option:
 

 

You may enable logs for Python client library here so that complete logs will be captured.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2hOdEu:ref

Google Ads API Forum Advisor

unread,
Dec 28, 2022, 8:53:25 AM12/28/22
to adit...@gmail.com, adwor...@googlegroups.com

Hi Aditya,

Thanks for confirming that issue has been resolved.

Regards,

Reply all
Reply to author
Forward
0 new messages