I had the exact same error message and solved the problem. What I was doing
wrong is the following:
When using GetRefreshToken and copying the url in the browser I was copying
the code (starting by 4/) obtained by this page as the refreshToken in
ads.properties, instead of copying this code back into the
(GetRefreshToken) console and using as a refreshToken the one generated by
GetRefreshToken (starting by 1/).
I should have paid more attention to the instructions !
On Friday, August 2, 2013 2:33:21 AM UTC-4, Takeshi Hagikura (AdWords API
Team) wrote:
>
> Hi,
>
> I guesss, it's because the account you granted access to AdWords and the
> account you were trying to make a request against are different (or not
> under the MCC you granted access).
>
> Please make sure you grant access to an MCC account or a client account.
> And the account you are trying to make a request is under the MCC or the
> client account you granted access.
>
> Best,
> - Takeshi, AdWords API Team
>
> On Thursday, August 1, 2013 2:37:19 AM UTC+9, Echo Li wrote:
>>
>> Hi Gurus,
>>
>> I was trying to upgrade to oAuth2 authentication from ClientLogin method,
>> when I run the sample code I got below errors, have no clue what caused it,
>> is it possible that the way I create the "clientID" and "ClientSecret"
>> caused it? any reply is appreciated.....
>>
>> 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:149)
>> at
>> DownloadCriteriaReportWithAwql.main(DownloadCriteriaReportWithAwql.java:42)
>> 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:332)
>> at
>> com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:352)
>> at
>> com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:535)
>> at
>> com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:248)
>> at
>> com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:454)
>> at
>> com.google.api.ads.common.lib.auth.OAuth2Helper.callRefreshToken(OAuth2Helper.java:70)
>> at
>> com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:144)
>>
>>
>> Echo
>>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.