How do i set customer id must be set in the 'login-customer-id' header

116 views
Skip to first unread message

itservices itservices

unread,
May 30, 2022, 9:22:11 AM5/30/22
to Google Ads API and AdWords API Forum
I am using php client library to get the ads data and i have configured all my data/credentials in the google_ads_php_ini file as per documentation.

But still I am getting the below error.

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.v10.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'


My requestid is "requestId": "LMxc23o33m_x1FSc3A_vIg" .


I have already set the customer id in the ini config file.should i do anything on the account level?

Google Ads API Forum Advisor

unread,
May 30, 2022, 10:59:12 AM5/30/22
to itser...@unigage.com, adwor...@googlegroups.com

Hi,

Thanks for reaching out to the Google Ads API Forum.

Upon checking the stack trace you’ve provided with us, I can see that you've encountered the AuthorizationError.USER_PERMISSION_DENIED error. Kindly note that you may receive the error ‘USER_PERMISSION_DENIED’ when a user doesn't have permission to access a customer and you’re accessing a client customer using 'login-customer-id’ in the request. 

That being said, you will need to ensure that the user / email address you used to generate the credentials indeed has access to the account in your request. If the user / email address has access or is associated with the MCC / manager account, you will need to specify the MCC / manager account's ID without hyphens (-) as the value of the login-customer-id field. 

If you still persist with the error, you may provide us with the complete request and response logs, with the request-id along with the email address used to generate the OAuth2 credentials via the Reply privately to author option, so that I can continue to investigate further.

Regards,

Google Logo
Yasar
Google Ads API Team
 


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