Error 89


#1

When I run my app, I get this error message, and I’m not entirely sure why.

[ { code: 89, message: ‘Invalid or expired token.’ } ]

It was working a little over a week ago, and I even generated tokens for a new application, and I’m still receiving the error.

I’ve tried looking into this, and I’ve tried everything from a new application, reinstalling node packages. I’m currently trying to use the twitter node package here: https://www.npmjs.com/package/twitter

According to documentation, my usage was right, and I can confirm the same code was working about a week ago.

var Twitter = require('twitter');
var auth = require('../config/twitter.js');

var client = new Twitter({
  consumer_key: auth['consumer_key'],
  consumer_secret: auth['consumer_secret'],
  access_token: auth['access_token'],
  access_token_secret: auth['access_token_secret']
});

client.get('statuses/user_timeline', {screen_name: 'lrroberts0122', count: 10}, function(error, tweets) {
  if(error) {
    console.log(error);
  } else {
    console.log(tweets);
  };
});

I can also confirm with absolute certainty that the keys are being pulled accurately from my config file.

I’m just trying to get the statuses of the user timeline - the last ‘x’ amount of tweets from a specified user. I wasn’t using any kind of authentication or Oauth aside from my own for the API - so I’m not sure if I need to implement something now.

Any help would be greatly appreciated! =)

Thank you very much for your help!