PERMISSION_DENIED issue

134 views
Skip to first unread message

Abby Lv

unread,
Sep 9, 2020, 4:36:14 AM9/9/20
to AdWords API and Google Ads API Forum
Hi there,

We followed the instructions and generated parameters to make calls, however, we received error reported like "PERMISSION_DENIED: The caller does not have permission". How can I find out which part is not setting correctly or permission not granted? Help needed.

Best,

Google Ads API Forum Advisor Prod

unread,
Sep 9, 2020, 2:18:37 PM9/9/20
to abby....@gmail.com, adwor...@googlegroups.com

Hi Abby,

Thank you for reaching out. The error USER_PERMISSION_DENIED usually occurs when there is no link between the manager account authenticated in the request and the client account specified in the headers. If you are using the Google Ads API you need to include the login-customer-id in the header as mentioned in this blog post. If the issue persists, could you please share the complete request and response logs along with the loginCustomerId and clientCustomerId and the email you used to generate the OAuth2 credentials via the Reply privately to author option for me to further investigate?

Thanks and regards,
Xiaoming, Google Ads API Team




Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q24ZvGe:ref

Francesco Andrisani

unread,
Oct 21, 2020, 5:23:33 PM10/21/20
to AdWords API and Google Ads API Forum
Hi @Xiaoming,
I've the same issue.
I'm trying to use java library and for debug this issue I tried to use also oauth-doctor.
I've set (I think correcty, modifing the ads.properties file and adding also the login-customer-id), but the on java I' ve the error:

Caused by: io.grpc.StatusRuntimeException: PERMISSION_DENIED: The caller does not have permission

and trying to debug using oauth-doctor this output:

C:\xampp\htdocs\google-ads-doctor-master\google-ads-doctor-master\oauthdoctor\bin\windows\amd64>oauthdoctor.exe -language java -oauthtype installed_app
2020/10/21 23:11:20 Client library language: java
2020/10/21 23:11:20 Google Ads API client library config file: C:\Users\mitsu\ads.properties
2020/10/21 23:11:20 Config keys and values:
2020/10/21 23:11:20     ClientID = ******************* (hidden)
2020/10/21 23:11:20     ClientSecret = ******************* (hidden)
2020/10/21 23:11:20     DevToken = ******************* (hidden)
2020/10/21 23:11:20     RefreshToken = ******************* (hidden)
2020/10/21 23:11:20     LoginCustomerID = 6650******
2020/10/21 23:11:20     PrivateKeyPath = <empty>
2020/10/21 23:11:20     DelegatedAccount = <empty>
2020/10/21 23:11:20 Please enter a Google Ads account ID:
7189******

2020/10/21 23:11:35 ERROR: Your credentials are invalid but we cannot determine the exact error. Please verify your developer token, client ID, client secret and refresh token.
2020/10/21 23:11:35 Attempting to regenerate refresh token...
2020/10/21 23:11:35 Visit the URL for the auth dialog:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=696260777485-3ek3fp1tb9j4gc0nsq2elcukjhfibf4h.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&state=state
2020/10/21 23:11:35 You are running Windows, so to properly copy and paste the URL into the command prompt:
1) Ensure that 'Quick Edit' mode is ON for your Command Prompt
2) Hold down the shift key
3) Highlight the URL
4) Right click on the highlighted area
Copy the code here to continue:
Enter Code >> 4/1AfDhmrgzylRug7it1uqBiDU5R7pUD_QWjY4qBOBq9fJtYQ04r_oqUC0ovTU
2020/10/21 23:12:18 ERROR: OAuth test failed.


...where as login-customer-id, I insert the Manager Acount ID, while the Google Ads Account ID, is an test account managed by the Manager.
Please can you help me where I wrong the steps?
Thanks and Regards

Google Ads API Forum Advisor Prod

unread,
Oct 22, 2020, 11:46:27 AM10/22/20
to mizc...@gmail.com, adwor...@googlegroups.com

Hi Francesco,

Thank you for reaching out. I think you might have used another account other than the account with login-customer-id to generate the OAuth2 credentials. Please give it a try to regenerate the OAuth2 credentials following this guide and use the email associated with this login-customer-id and update them in the config file. Please share the complete request and response logs along with the client customer id and the ads.properties file via the Reply privately to author option if the issue persists.



Thanks and regards,
Xiaoming, Google Ads API Team

Francesco Andrisani

unread,
Oct 22, 2020, 12:27:28 PM10/22/20
to AdWords API and Google Ads API Forum
Hi Xiaoming ,
I've already tried to regenerate the Outh2 credentials. I've checkd and I created all using the same account.
Ok. I share with you the logs and ads.propertis.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages