USER_PERMISSION_DENIED with loginCustomerId set to MCC id

74 views
Skip to first unread message

Andjel Boskovic

unread,
Oct 20, 2021, 7:38:28 AM10/20/21
to AdWords API and Google Ads API Forum
Hi,

I'm trying to run the GoogleAdsServiceClient->search(MCC_ACCOUNT_ID, query) method.

I have set both clientCustomerId, and loginCustomerId to MCC_ACCOUNT_ID (without hyphens).

After requesting I get:

Failure: {"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":"PXzsKpUMYkZ_n1Y_T3_PqA"}


Request details:
Method Name: /google.ads.googleads.v8.services.GoogleAdsService/Search
Headers: {
    "x-goog-api-client": "gl-php\/7.4.24 gccl\/12.0.0 gapic\/12.0.0 gax\/1.7.1 grpc\/1.41.0",
    "x-goog-request-params": "customer_id=REMOVED",
    "developer-token": "REDACTED",
    "login-customer-id": "REMOVED"
}
Request:
{"customerId":"REMOVED","query":"SELECT customer_client.client_customer, customer_client.level, customer_client.id FROM customer_client WHERE customer_client.level <= 1"}


As you can see I've included the loginCustomerId but still getting the error message.

Can you suggest anything for me to do?

Thank you in advance,
Andjel

Google Ads API Forum Advisor

unread,
Oct 20, 2021, 11:45:53 AM10/20/21
to andjel....@fishingbooker.com, adwor...@googlegroups.com

Hello,

 

Thanks for reaching out to us. As you’ve mentioned that you’ve encountered the error ‘USER_PERMISSION_DENIED’, it usually has the following root causes:

  • The link between the manager and client account was removed.

  • Your OAuth credentials are for a user who does not have access to the client customer ID specified or any of its manager accounts.

You may double check if your credentials are correct for the said user. With that, I would recommend that you regenerate the refreshToken and the OAuth2 credential using an email address which currently has access to your Google Ads account. 


To investigate the issue further, could you share with us the customer_id and login-customer-id.
Please send the requested details via the Reply privately to the author option. If this option is not available, you may send the details directly to us googleadsa...@google.com alias instead.

 

Best regards,

Google Logo
Jakeia Sabrina
Google Ads API Team
 

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