Hi, You can use the same refresh token that you received from the PHP application as long as you also use the same clientId and clientSecret. Are those the same as well?
Thanks, Josh, AdWords API Team On Monday, January 27, 2014 3:33:05 AM UTC-5, Eldar Useinov wrote: > > > > вторник, 21 января 2014 г., 18:53:16 UTC+2 пользователь Eldar Useinov > написал: >> >> Hi. >> >> I use Java Client library and face next problem >> >> I try to run this code >> >> >> *new OfflineCredentials.Builder() >> .forApi(OfflineCredentials.Api.ADWORDS).fromFile() >> .build();* >> >> with ads.properties file, which containes next settings >> >> >> >> >> >> >> >> >> >> >> >> >> *api.adwords.refreshToken=1/w3eZ_***************************************api.adwords.clientId=97*********************************apps.googleusercontent.com >> >> <http://apps.googleusercontent.com>api.adwords.clientSecret= >> j6Ci**********************api.adwords.userAgent=AdWords API JAVA Code >> Exampleapi.adwords.developerToken=d***********************api.adwords.isPartialFailure=falseapi.adwords.returnMoneyInMicros=trueapi.adwords.refreshOAuth2Token=true* >> >> and have next error: >> >> 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 adwords.GoogleAPIWrapper.<init>(GoogleAPIWrapper.java:81) >> at adwords.Loader.<init>(Loader.java:24) >> at >> tasks.CampaignSyncTaskExecutor.loadCampaign(CampaignSyncTaskExecutor.java:132) >> at >> tasks.CampaignSyncTaskExecutor.process(CampaignSyncTaskExecutor.java:42) >> at tasks.ATaskExecutor$1.run(ATaskExecutor.java:22) >> at java.lang.Thread.run(Thread.java:744) >> Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 >> Bad Request >> { >> "error" : "invalid_grant" >> } >> >> >> What i did wrong? Thank you. >> >> Yes, I use the same account, but refresh token i used I recieve in php >> application. Is it possible to use that refresh token and clientCustomerId >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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.
