Hi Naman, The "invalid_grant" error usually means you tried to use the same authorization code to get more than one developer token. The authorization code is the string returned after you click *Accept* from the URL provided by the offline credentials example, and you can only use an authorization code *once*.
To resolve this, please do the following: 1. Log out of all Google accounts in your browser 2. Log into your AdWords account at https://adwords.google.com 3. Run the offline credentials example (again) 4. Navigate to the URL provided by the offline example and click *Accept* 5. Copy the *refresh token* printed by the offline example into your AdWords configuration file Regarding the User Agent, that is an optional string that helps identify requests from your application. Best, Josh, AdWords API Team On Monday, October 28, 2013 10:54:33 AM UTC-4, naman jindal wrote: > > Hi Guys, > > I am trying to set up my first Adwords API application. To begin with, I > am only trying to set up the examples which are provided with the client > libraries. > > So, I just downloaded the example and all dependent files. I provided all > the information in the properties file: > Refresh Token, Client Id, Client Secret, Client Customer Id, Developer > Token, User Agent > > (Though I am not sure about the User Agent part.) > > Now when I simly try to run the program to get list of campaigns in the > account, I get an error on the first step (OAuth2): > > Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 > Bad Request > { > "error" : "invalid_grant" > } > > > Please suggest what am I missing out on. It is very urgent! > > Thanks for your time and help. > > > Regards, > Naman Jindal > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.