Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 401 Unauthorized

2,683 views
Skip to first unread message

Alfredo Rivera

unread,
Sep 28, 2016, 5:09:12 PM9/28/16
to AdWords API Forum

I have a problem with the example of the API call, the following is what I get in eclipse:

Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 401 Unauthorized

at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)

at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)

at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.execute(GoogleAuthorizationCodeTokenRequest.java:158)

at adwords.axis.auth.GetRefreshToken.getOAuth2Credential(GetRefreshToken.java:86)

at adwords.axis.auth.GetRefreshToken.main(GetRefreshToken.java:122)


I already refresh token (develop token Adwords) and nothing , refresh the client id and nothing

help me!!!!!

Anthony Madrigal

unread,
Sep 28, 2016, 7:51:13 PM9/28/16
to AdWords API Forum
Hi Alfredo,

When you generate the refresh token, you need to make sure that you paste the URL given while signed on to the account that you generated your OAuth credentials from. 

If that does not work, please try to create new OAuth credentials.

Regards,
Anthony
AdWords API Team
Reply all
Reply to author
Forward
0 new messages