REST based API: Authentication of the request failed

449 views
Skip to first unread message

Edward HeXuefei

unread,
Nov 21, 2019, 2:51:10 AM11/21/19
to AdWords API and Google Ads API Forum
Hi,

We have a working web-server based app.
In addition, I'm trying to use REST google ads api to test some of the returning data.

When I use REST based API, I get an authentication error.

curl --request GET --header "Authorization : Bearer <token>" --header "developer-token : <token>" https://googleads.googleapis.com/v1/customers:listAccessibleCustomers

{
 
"error": {
   
"code": 401,
   
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
   
"status": "UNAUTHENTICATED",
   
"details": [
     
{
       
"@type": "type.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure",
       
"errors": [
         
{
           
"errorCode": {
             
"authenticationError": "AUTHENTICATION_ERROR"
           
},
           
"message": "Authentication of the request failed."
         
}
       
]
     
}
   
]
 
}
}



The token set I use is totally legit, proven by a running app. What could possibly go wrong?

Regards,
Edward

Google Ads API Forum Advisor Prod

unread,
Nov 21, 2019, 11:13:20 AM11/21/19
to xup...@gmail.com, adwor...@googlegroups.com
Hi Edward,

Thank you for reaching out. Please make sure your properties/config file is updated to include the developer token, clientId, clientSecret, and refreshToken as shown here. If that is correct, please provide the complete XML request and response logs via reply privately to author as well as the email address you are using so that I can further investigate the issue. You can find information on how to enable logging using your client library here.

Regards,
Mitchell
Google Ads API Team

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