API 1.1, authentication problems when triying to get another user's timeline


Hi all,

I’m migrating some code in several websites to the new API 1.1, but I’m getting the error “Could not authenticate you”.

It works perfect for me when getting my own tweets using “https://api.twitter.com/1.1/statuses/user_timeline.json” but the problem comes when I try to get the tweets from another account using https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=xxx

What am I doing wrong? Should I create unique API and oAuth keys for each account I want to get the tweets from?

Thanks in advance.


PS: this is the code I’m using https://gist.github.com/anonymous/5199119


You may find it easier in some cases to use the new [node:13439] instead of OAuth 1.0A.

v1 of the API would often let your calls through in an unauthenticated context if your auth wasn’t quite right – which means that even though you thought it was working it’s possible it wasn’t.

API v1.1 is stricter about auth. I took a very brief look at your code and nothing jumps out at me as being directly wrong, though this is kind of strange – aren’t you setting an Authorization header?

$header = array(buildAuthorizationHeader($oauth), 'Expect:');