showStatus(id) needs authentication?

36 views
Skip to first unread message

Tak Yeon

unread,
Sep 15, 2009, 1:29:14 AM9/15/09
to Twython Talk
>>> twitter = twython.setup(authtype="Basic", username="myid", password="mypw")
>>> twitter.showStatus(36067790)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "build\bdist.win32\egg\twython\twython.py", line 164, in
showStatus
% `e.code`, e.code)
TangoError: "Failed with a 404 error code. Does this user hide/protect
their updates? You'll need to authenticate and be friends to get their
timeline."

--------------------------------
Hello!

I am trying to get basic information about a specific user (using ID
or screenName).
showStatus(id) would be the function for that... but it gives 404
error.. :(

Do you know how to fix it?

many thanks
Tak

Ryan McGrath

unread,
Sep 15, 2009, 10:55:11 AM9/15/09
to twytho...@googlegroups.com
Hey Tak,

So I double checked this method on my end, and it seems to work just fine. The request URL's that are being generated are valid, and I was able to successfully use showStatus just fine.

My example:

import twython

lol = twython.setup("ryanmcgrath", "password")
myUserInfo = lol.showUser(id="ryanmcgrath")
lol.showStatus(myUserInfo['status']['id'])


Since that all works, it leads me to think the problem is that the status ID you're using isn't actually a valid status ID, or the user is protected, and you're not friends with them. Twitter requires you to basically have a two way relationship with people if you want their protected information.

Lemme know if you find anything different, though. Good luck! ;)

- Ryan

Chris Babcock

unread,
Sep 15, 2009, 11:44:38 AM9/15/09
to twytho...@googlegroups.com

> > I am trying to get basic information about a specific user (using ID
> > or screenName).
> > showStatus(id) would be the function for that... but it gives 404
> > error.. :(

> Since that all works, it leads me to think the problem is that the


> status ID you're using isn't actually a valid status ID, or the user
> is protected, and you're not friends with them. Twitter requires you
> to basically have a two way relationship with people if you want
> their protected information.

The Twitter API should return a 403, not a 404, if authentication is
the issue.

When troubleshooting API calls, it's also helpful to manually call the
underlying URL with curl using the examples provided in the Twitter API
docs: http://apiwiki.twitter.com/Twitter-API-Documentation

If curl works, but Twython doesn't, with the same data then there may
be some error in the formulation of the API call in Python or Twython
that the list will be likely to help with.

Chris Babcock

signature.asc

Ryan McGrath

unread,
Sep 15, 2009, 11:51:03 AM9/15/09
to twytho...@googlegroups.com
That's a good point concerning the 403 error, I missed that.

Still, going off your email, if you try his status ID with a generic curl request, it comes back as a "No status found with that ID". At the end of the day, that's looking to be the real issue here.

- Ryan
Reply all
Reply to author
Forward
0 new messages