Here is how you can get the refresh token from Adwords API .
I would assume that you have Client ID and Client Secret generated from Developer’s console of Google. If not please have a look at this link to get Client ID and Client Secret.
1. Create ads.properties file in your classpath. Fill the following fields in your ads.properties file.
api.adwords.clientId =******.apps.googleusercontent.com (Use Client ID from Developer’s Console)
api.adwords.clientSecret=c_****ug (Use Client Secret value from Developer’s Console)
api.adwords.refreshToken=1/***W8 (Leave this field empty as of now)
api.adwords.developerToken=***** (Developer token generated from Production MCC account)
api.adwords.clientCustomerId=300-***-*** (Client ID of MCC account )
api.adwords.userAgent=***** (Name of your Firm)
2. Now Run GetRefreshToken.java file, which is extracted from Jar file from this link.
3. Now once you run GetRefreshToken.java file, you get the new refreshToken value which you can now replace or paste in ads.properties file.
Thanks for dropping by!! Feel free to comment to this post or you can also drop me an email at email@example.com.