Cannot access API

37 views
Skip to first unread message

LKRPL

unread,
Jun 27, 2017, 5:46:02 PM6/27/17
to AdWords API Forum
Good evening,
we follow the guide to "make the first api call" but as result we obtained:

Exception in thread "main" com.google.api.ads.common.lib.exception.OAuthException: Credential could not be refreshed.
at com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:178)
at it.reply.fcadda.ForecastGenerator.EstimateKeywordTraffic.main(EstimateKeywordTraffic.java:56)
Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
{
  "error" : "invalid_grant"
}
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.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:362)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at com.google.api.ads.common.lib.auth.OAuth2Helper.callRefreshToken(OAuth2Helper.java:69)
at com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:172) 

The code used is the "Estimate keyword traffic" sample located here : "https://developers.google.com/adwords/api/docs/samples/java/optimization#estimate-keyword-traffic

As ads.properties we have used:
a) clientId, clientSecret (associated to this account)
b) clientCustomerId (an account created and associated to a test account)
c) developer token (associated to this account) 

Can you help us? Thanks.
Reply all
Reply to author
Forward
0 new messages