PERMISSION_DENIED when calling from test manager account

63 views
Skip to first unread message

Vilnis Trash

unread,
Apr 26, 2024, 4:57:30 PM4/26/24
to Google Ads API and AdWords API Forum
Hi there!
I had tried for to connect to Google ADS Api for around 12 hours now slowly navigating through bunch of incomplete guides, tutorials and even youtube videos.

When calling GenerateKeywordHistoricalMetricsRequest I get an error: 
{ "message": "The caller does not have permission", "code": 7, "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com\/google.ads.googleads.v16.errors.GoogleAdsFailure", "errors": [ { "errorCode": { "authorizationError": "USER_PERMISSION_DENIED" }, "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" } ], "requestId": "qxUmRzRshohfvIG0ugU7MA" } ] }

I have raised this issue on Google Ads API library here: https://github.com/googleads/google-ads-php/issues/1016 and got redirected to this forum so I guess my code is correct.

In this thread you will see that I mentioned that my testing account had multiple weird indications:
1. Manager account had a [Closed] status
2. Test client has Cancelled status
3. seemed that the Test manager account was suspended as it threw an error when I tried to create new test client

Now I have created a new testing Ads Manager account and successfully created more than one client and successfully created a campaign for one of them. yet I still have those first two indications - Managers account [Closed] and both test Clients - cancelled.

Are those statuses the reason for the error or is there some other issue?

Google Ads API Forum Advisor

unread,
Apr 28, 2024, 10:03:12 PM4/28/24
to ind...@svagers.lv, adwor...@googlegroups.com
Hi, 

Thank you for reaching out to the Google Ads API support team.

From the provided logs, I understand that you're facing a USER_PERMISSION_DENIED error from the test manager account. This means the user doesn't have permission to access the customer. According to the documentation, if you're accessing the customer please specify the login-customer-id as the manager account ID without hyphens (-). 

I could see you have provided partial logs which is not sufficient for us to investigate further. Could you please provide us with the complete API logs (request and response with request-id and request header) generated at your end to assist you further.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the PHP guide to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tPKZE:ref" (ADR-00232856)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages