GOOGLE ADS - PERMISSION DENIED

657 views
Skip to first unread message

Pawankumar Manpuri

unread,
Jan 25, 2023, 4:47:27 AM1/25/23
to Google Ads API and AdWords API Forum
Can anyone help me out for below error, the code was running fine until yesterday, I have specified the login_customer_id while configuring, not getting why it is giving me this error...

I tried refreshing the refresh token, still the issue persists.

Request made: ClientCustomerId: 65xxxxx839, Host: googleads.googleapis.com, Method: /google.ads.googleads.v12.services.GoogleAdsService/SearchStream, RequestId: j73hYlP0PfzNclBK8TcWQw, IsFault: True, FaultMessage: 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

Pawankumar Manpuri

unread,
Jan 25, 2023, 4:49:36 AM1/25/23
to Google Ads API and AdWords API Forum
And everytime I run, the ClientCustomerId is different.

Google Ads API Forum Advisor

unread,
Jan 25, 2023, 9:01:27 AM1/25/23
to pawanma...@gmail.com, adwor...@googlegroups.com

Hi Pawankumar,
 

Thanks for reaching out to the Google Ads API team. I hope you are doing well today.


With regards to your concern, It seems that you are encountering the "USER_PERMISSION_DENIED" which means 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 the error still persists, 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.

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.


Regards,

Google Logo
Darwin
Google Ads API Team
 



ref:_00D1U1174p._5004Q2iNWvb:ref

Pawankumar Manpuri

unread,
Jan 27, 2023, 1:13:13 AM1/27/23
to Google Ads API and AdWords API Forum
Hi Darwin, 
First of all, thanks for the quick response, the code worked fine when I executed it after few hours, no changes in the code looks like the issue is with Google Ads API something weird happens in between,  I have been noticing this for a while, all the credentials are right...I literally changed nothing, the code works fine after some time....

Regards,
Pawan Manpuri

Pawankumar Manpuri

unread,
Jan 27, 2023, 2:08:01 AM1/27/23
to Google Ads API and AdWords API Forum
SELECT
customer_client.id,
customer_client.descriptive_name
FROM customer_client
WHERE
customer_client.manager = FALSE and
customer_client.status = 'ENABLED'

I am hitting this query to get all the customer_client ids linked to my manager account... this sometimes gives ids that are not linked and that causing me the permission denied error while fetching campaign report...

Can you please assist me regarding this...

Regards,
Pawan Manpuri

Pawankumar Manpuri

unread,
Jan 27, 2023, 2:09:14 AM1/27/23
to Google Ads API and AdWords API Forum
FYI, 
I am passing my manager account while fetching all the accounts linked to my account...

Google Ads API Forum Advisor

unread,
Jan 27, 2023, 2:45:36 AM1/27/23
to pawanma...@gmail.com, adwor...@googlegroups.com
Hi Pawankumar,

Thank you for getting back to us. I hope that you are doing well today.

Moving forward to your concern, could you please tell us if you followed the guidance provided by my colleague, Darwin? If yes and you are still encountering that error message, could you please provide us the complete request and response logs, with the request-id with the email address used to generate the OAuth2 credentials.


You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Kind regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 


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