401 Unauthorized when I try to consume google ads api from local postman

442 views
Skip to first unread message

bhargav d

unread,
Mar 9, 2021, 1:23:30 PM3/9/21
to AdWords API and Google Ads API Forum
I am new to google adwords api and i am trying to create an api locally to get userlist but when i try to consume my new api from postman i am getting below error in console. can anyone help.

"
Headers: null
Body: null
Failure message: null
Status: Status{code=UNAVAILABLE, description=Credentials failed to obtain metadata, cause=com.google.api.client.http.HttpResponseException: 401 Unauthorized
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1097)
        at com.google.auth.oauth2.UserCredentials.refreshAccessToken(UserCredentials.java:197)
        at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
        at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
        at com.google.auth.Credentials.blockingGetToCallback(Credentials.java:112)
        at com.google.auth.Credentials$1.run(Credentials.java:98)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source) "

Google Ads API Forum Advisor Prod

unread,
Mar 10, 2021, 11:21:17 AM3/10/21
to bharg...@gmail.com, adwor...@googlegroups.com
Hello,

Can you please confirm that you were able to successfully set up OAuth2 authentication and obtained a refresh token? If so, and you are still seeing the authorization error, please reply privately with the request headers you used.

Thanks,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


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