Google Ads API Refresh token

216 views
Skip to first unread message

ntdm...@gmail.com

unread,
Oct 5, 2016, 8:14:14 PM10/5/16
to AdWords API Forum
When trying to connect with google ads api, a refresh token has to be provided so using the client id and secret i get the url where the code to get the refresh token when i give the code in command line and click on enter after few seconds its throws connection timed out error.

Is it due to proxy of some other issue.

Please suggest.

Stack trace :

Type the code you received here: 
4/XXXXfEEcXXXXGI_Hntt3dT24nQLiuXXXXX
java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:972)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:283)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.execute(GoogleAuthorizationCodeTokenRequest.java:158)
at adwords.axis.auth.GetRefreshToken.getOAuth2Credential(GetRefreshToken.java:102)
at adwords.axis.auth.GetRefreshToken.main(GetRefreshToken.java:144)
Exception in thread "main" java.lang.NullPointerException

Peter Oliquino

unread,
Oct 5, 2016, 11:52:07 PM10/5/16
to AdWords API Forum
Hi,

Could you confirm if you created your credentials using the steps in this guide? If yes, could you try it again and see if the issue persists? I would first like to confirm whether this is a case of an intermittent issue.

Cheers,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages