Hi, The *Code was already redeemed* error means that you are trying to use an authorization code <https://developers.google.com/adwords/api/docs/guides/authentication#configure_and_use_a_client_library> that has already been used. A given authorization code can only be used *once*. Please make sure you are using the authorization code passed in the request to the *oauth2_callback* when you submit the OAuth request to get the *refresh token*.
Thanks, Josh, AdWords API Team On Tuesday, January 6, 2015 2:23:54 PM UTC-5, Alessandro Dias wrote: > > AdsCommon::Errors::AuthError Authorization error occured: Authorization > failed. Server message: {"error" : "invalid_grant", "error_description" : > "Code was already redeemed."} > > this is the part of autorization > > def google_oauth2_callback > api = AdwordsApi::Api.new(Rails.application.config_for(:adwords_api)) > session[:token] = api.authorize \ > oauth2_callback: user_omniauth_callback_url(:google_oauth2), > oauth2_verification_code: params[:code] > > I'm using: Rails + devise + omniauth-google-oauth2 > > And also I added the adwords scope > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1511b955-153e-42c0-ac02-bf8771aae585%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.