New Application error in OAuth


Hi all,

I just created a twitter app and have the oauth_token generated and used it in my @gem configuration but it says “Invalid / expired token”.
What does it mean? Should I wait for a few hours or a day to get my token to work?



While there might be a little delay between using the generated tokens from the dev site, it shouldn’t be more than 15 minutes at its worst.

What library are you using? What requests are you trying to make that are failing with this error? Is this the literal error you’re getting from the API or an error that is being caught and presented by your library (and possibly over-broad to the scenario)?

  • I used the Ruby Twitter API that can be found here
  • The request I am trying to make is retweets
  • The actual error I am getting is this:

D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/twitter-1.6.2/lib/faraday/response/raise_http_4xx.rb:12:in on_complete': GET 401: Invalid / expired Token (Twitter::Unauthorized) from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/response.rb:9:inblock in call’
from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/response.rb:62:in on_complete' from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/response.rb:8:incall’
from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/request/url_encoded.rb:14:in call' from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/request/multipart.rb:13:incall’
from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/twitter-1.6.2/lib/faraday/request/twitter_oauth.rb:17:in call' from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/twitter-1.6.2/lib/faraday/request/multipart_with_file.rb:16:incall’
from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/connection.rb:203:in run_request' from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/faraday-0.7.4/lib/faraday/connection.rb:85:inget’
from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/twitter-1.6.2/lib/twitter/request.rb:28:in request' from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/twitter-1.6.2/lib/twitter/request.rb:6:inget’
from D:/tools/Ruby192/lib/ruby/gems/1.9.1/gems/twitter-1.6.2/lib/twitter/client/timeline.rb:138:in retweeted_by_me' from simple_client.rb:47:inget_retweet_links’
from simple_client.rb:59:in `’

I am not sure what wrong there because I just follow the tutorial in the homepage of this API.


Are the values you’re using for your access token the same as on your “my access token” box on your app details page? You may have at some point inadvertantly invalidated an access token. If this is the case, I recommend using the “recreate my access token” feature there, wait 5 minutes, reload that page and take the newly negotiated values and plug them into your app.


Yes you’re right! It’s now working. Many thanks!