"message": "Invalid or expired token", "code": 89 So which is it INVALID OR EXPIRED?


Building an Adobe AIR twitter search appliance using Application only auth. I can correctly obtain my Bearer token, but ALL search requests result in

“errors”: [{
“message”: “Invalid or expired token”,
“code”: 89

So, what is it, INVALID or EXPIRED?

I notice that in my Response Headers for my Bearer token there is an ‘expires’ header with a value of Tue, 31 Mar 1981 05:00:00 GMT
Does this apply to the bearer token itself?

These ambiguous error messages are giving me (and I’m sure lots of other developers) TONS OF GRIEF!

Ho do we debug requests with bearer tokens when we receive this message???

Please help…anyone!!!


This is my entire RAW response

HTTP/1.1 401 Unauthorized
content-encoding: gzip
content-length: 86
content-type: application/json; charset=utf-8
date: Wed, 19 Feb 2014 16:08:13 UTC
server: tfe
strict-transport-security: max-age=631138519

{“errors”:[{“message”:“Invalid or expired token”,“code”:89}]}




Since yesterday I have the same problem.
My application uses Application-only-Auth too and worked for a week or so.

But since yesterday I get the json response for the bearer token:
"{“access_token”:“Here is the token”,“token_type”:“bearer”}"
Of course “Here is the token” is not the real token, I just replaced it. I get something which seems to be a bearer token.
But when I try to get a user timeline with the following code (I use Qt, a C++ framework), according to https://dev.twitter.com/docs/auth/application-only-auth Step 3:

QNetworkRequest twitterRequest;
twitterRequest.setRawHeader(“User-Agent”, “QTwitt”); // just set a user agent
if (auth_type == “bearer”) // auth_type is set to “bearer” so this is true
twitterRequest.setRawHeader(“Authorization”, "Bearer " + bearer_token);
twitterRequest.setUrl(QUrl(“https://api.twitter.com/1.1/statuses/user_timeline.json?count=” + QString::number(count) + “&screen_name=” + screen_name));


I get the response
"{“errors”:[{“message”:“Invalid or expired token”,“code”:89}]}"

As mentioned, it work for a week or so without problems. This happens since yesterday and I already created a new token and secret but I still get this error message.

Edit: The response for my bearer token does also contain the expire date “Tue, 31 Mar 1981 05:00:00 GMT” - just to be mentioned.


It happens for me too with user timeline requests (did not check other requests) since yesterday. And the header for my bearer token request contains the same expiration date/time…

I know this does not help you, but maybe an more advanced developer - or better someone of the twitter team - answers this thread if they see that there are more people with the same problem.


I’m having the same issue. Worked fine for a while and now broken with the same response.