google-ads-php: After upgrading V21.1 getting USER_PERMISSION_DENIED issues.

Which version of the client library are you using? 21.1.0

Which version of PHP are you using? PHP-FPM 8.2

Which operating system (Linux, Windows, …)? CentOS

Issue is happening with me too, as things are working normal to get spent per account 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": "UAoxxxxxxxxxxxxxjKdc4rw"
        }
    ]
}'.

Wondering , how it can get fix, or what changes I need to make, I have gone through the documents https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid

any Idea what to do next?

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

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 1
  • Comments: 23 (10 by maintainers)

Most upvoted comments

I had the same error, and nothing proposed seemed to work. All packages where up to date: googleads/google-ads-php:22.0 google/gax:1.27

the solution was removing: ->withLinkedCustomerId while building the client

which was either unnecessary/redundant or used wrongly on my end, and the api started complaining starting with version 15.

THIS WORKS, thank you, just commented out this line and it started working again. Thank you.

image

I had the same error, and nothing proposed seemed to work. All packages where up to date: googleads/google-ads-php:22.0 google/gax:1.27

the solution was removing: ->withLinkedCustomerId while building the client

which was either unnecessary/redundant or used wrongly on my end, and the api started complaining starting with version 15.

Closing due to inactivity.

@fiboknacky Yes Here it is:

https://groups.google.com/g/adwords-api/c/dQTWw4PDxRk/m/jzc5DrgGBgAJ

https://groups.google.com/g/adwords-api/c/sA2CBGayJdU/m/M04GD1a5AQAJ

https://groups.google.com/g/adwords-api/c/tOjoRIUPWLQ/m/q_rOnVM_AAAJ

But all of the responses I got there is automated, Still not able to figure out why it is not working.

So far I am using 19.2 version as it is supporting v14 API call which is ok till May2024 but For future usecase I wanted to upgrade it till v15.

So, it sounds like after upgrading to v15, your request starts to fail. The changes that would be related to the permission thing is in the Account Management section. Is there any item that may be applied to your case?

The bug of google/gax is fixed in v1.26.2, but I see you already upgraded to v1.26.3, so that shouldn’t be a problem anymore.

Could you please post on the Google Ads API forum first? There will be a function Reply privately to author where you can send me a request and response log. Please include a link to this GitHub issue and mention that the PHP client library owner ask you to send your information. Thanks.

Wonder if there is a resolution to this as I have exactly the same problem, all worked fine for years until I bumped the ads lib version above “^19.0.0”

Environment: docker image FROM php:8.0-apache

The most recent working combination is composer version “^19.0.0” targeting API Version V14

I’ve checked all the higher versions of the composer library and they all fail with this error:

“The caller does not have permission”

I’m using a service account, impersonating an email, Implementation below: (as mentioned this all works fine until updating to “googleads/google-ads-php”: “^20.0” or above. (I’ve had to revert to 19 for now).

image

image

image