V15 upgrade throw USER_PERMISSION_DENIED error

280 views
Skip to first unread message

Manish Jain

unread,
Jan 24, 2024, 10:54:22 AMJan 24
to Google Ads API and AdWords API Forum
The main issue is happening with me, as things are working normal to get spent per account with V13 and V14 but after upgrading API to V15 via,  composer require googleads/google-ads-php:21.1 then I started getting this issue.

get ApiException was thrown with message '{ "message": "The caller does not have permission", "code": 7, "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com\/google.ads.googleads.v15.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": "UAo0n2LRjzMd8HJjKdc4rw" } ] }'.

Wondering , how it can get fix, or what changes I need to make,

But it is unclear how to pass it in which file or API.

any Idea what to do next?

I am using https://github.com/googleads/google-ads-php and upgraded it on 21.1
from 19.2

Thanks
Manish J

Google Ads API Forum Advisor

unread,
Jan 24, 2024, 11:05:17 AMJan 24
to mj...@avasflowers.com, adwor...@googlegroups.com
Hi, 

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

By reviewing your concern, I understand that you're facing a USER_PERMISSION_DENIED error. 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 (-). Client libraries have built in support for this.

If still the issue persists, 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. Kindly note that error logs are not sufficient to investigate your issue.

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 guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02rYS7v:ref"

Thanks,
 
Google Logo Google Ads API Team


Manish Jain

unread,
Jan 24, 2024, 4:53:19 PMJan 24
to Google Ads API and AdWords API Forum
Have tried it, but still same error.
Also tried to connect with client library support. and updated the latest version of library.

But still getting same issue, Is that possible to upgrade account level? or something else in code? to fix this issue.

Google Ads API Forum Advisor

unread,
Jan 25, 2024, 1:23:03 AMJan 25
to mj...@avasflowers.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

In order to assist you better, could you please provide us with the complete API logs (request and response with request-id and request header) generated at your end along with the screenshot of the error message. 

If you are using a PHP library and haven't enabled the logging yet, I would request you to enable logging for the PHP 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.

Manish Jain

unread,
Feb 7, 2024, 3:48:33 PMFeb 7
to Google Ads API and AdWords API Forum
Any Updates on it?

I am still not able to retrieve data via v15 API.

Google Ads API Forum Advisor

unread,
Feb 7, 2024, 8:25:09 PMFeb 7
to mj...@avasflowers.com, adwor...@googlegroups.com

Hi,

Thank you for getting back to us.

The provided logs are partial, which means there is no complete request body presented. From the provided logs, we are not sure which service you're utilizing to make API calls and are not sure what your request header parameters are. Please note that logs are crucial to addressing your issue in this context, as we can find complete request and response bodies in the logs.

So as requested earlier, please provide us with complete API logs (request and response with request-id and request header) generated at your end. So that we can address your issue more accurately.

Kindly note that you have to enable logging if you are using a client library. You can refer to the guides in PHP to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

Ricky Cortopassi

unread,
Feb 15, 2024, 10:07:19 AMFeb 15
to Google Ads API and AdWords API Forum
I was experiencing a similar issue... 

Here is what i found regarding similar error message : 
{ "message": "The caller does not have permission", "code": 7, "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com\/google.ads.googleads.v15.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": "UAo0n2LRjzMd8HJjKdc4rw" } ] }


-- This did not actually appear to be an issue with the login-customer-id NOT being in the header...
the issues that resolved this for me was to remove setting the "linkedCustomerId" from the client which possibly only worked before for the wrong reasons.. 

Previously had the client setting the Manager account id as the login customer id, and the context account was used to set the linkedCustomerId ( which was probably not needed anyways since the requests would contain the customerId anyways.. 


Hope this helps.. at least this is what worked for me..

Ricky C

Google Ads API Forum Advisor

unread,
Feb 15, 2024, 3:53:16 PMFeb 15
to ricky.co...@dealereprocess.com, adwor...@googlegroups.com

Hi,

Thank you for getting back to us.

After checking your provided logs, we found that you provided only response logs, but along with response logs,we are expecting request logs also so that we can assist you more accurately. Please provide us a request with the request-id and request header.  

Manish Jain

unread,
Mar 11, 2024, 12:12:29 PMMar 11
to Google Ads API and AdWords API Forum
Is there any update in new version of Google Ads API version 16?

Google Ads API Forum Advisor

unread,
Mar 12, 2024, 1:17:55 AMMar 12
to mj...@avasflowers.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

As informed earlier, kindly provide us with the latest complete API logs (request and response with request-id and request header) generated at your end to assist you further. Note that error logs are not sufficient to investigate your issue.

If you are using a PHP library and haven't enabled the logging yet, I would request you to enable logging for the PHP 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.

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


Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages