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


#1

WTF!
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!!!


#2

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}]}


#3

Anyone?


#4

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));

twitterNAM->get(twitterRequest);

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

Why?
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.


#5

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.


#6

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