I am trying to use the new(?) bulk status look up API end point:
https://dev.twitter.com/docs/api/1.1/get/statuses/lookup
But I keep getting the following error, even for the sample GET request in the docs:
https://api.twitter.com/1.1/statuses/lookup.json?id=20,432656548536401920
I have tried re-authenticating to get a new token but no change.
Any ideas what I could be doing wrong or could try next?
The remote server returned an error: (401) Unauthorized.
WebException Response: {“errors”:[{“message”:“Could not authenticate you”,“code”:32}]} [Headers - content-encoding: ;strict-transport-security: max-age=631138519;Content-Length: 88;Content-Type: application/json; charset=utf-8;Date: Mon, 28 Apr 2014 09:14:43 UTC;Set-Cookie: guest_id=XXXXXXXXXXXXXXXXXXX; Domain=.twitter.com; Path=/; Expires=Wed, 27-Apr-2016 09:14:43 UTC;Server: tfe;]
So per https://dev.twitter.com/docs/error-codes-responses an error 32 / 401 is usually an authentication problem.
I’ve just used the OAuth tool to generate a curl request from the https://dev.twitter.com/docs/api/1.1/get/statuses/lookup#oauth-tool page and it works OK for me in curl and also in twurl.
Are you using a client library?
Hi Andy,
No I am not using a client library, just custom c# which is working for everything else we are doing with the Twitter REST API.
Found the issue - I needed to URL encode the parameter:
id=20%2c432656548536401920
And also convert it to UPPER:
id=20%2C432656548536401920
And it seems OK now.
Thanks for the hint.