Favorites/create in twitteroauth seems to return error 404 randomly


I’ve seen this in a couple of discussions, and still can’t fix it.
It looks like Abraham William’s twitteroauth library (the most recent version, tailored for the 1.1 API) works perfectly but returns an error 404 randomly for the endpoint favorites/create.
I tried the following:

$method = ("favorites/create.json?id=$some_tweet_id");
twitteroauth_row($method, $connection->post($method), $connection->http_code);


$method = ("favorites/create/$some_tweet_id");
twitteroauth_row($method, $connection->post($method), $connection->http_code);

and I even tried posting the tweet id separately in an array. The endpoint favorites/create.json?id= returned 200 only once, and I don’t know why.
I thought the tweet id may be wrong, so I cut and pasted a real tweet id from twitter. There seems to be no way to make this work.
Has anyone seen this happen too?
Should there be any suggestions on how to fix this I’d be grateful.


nevermind. You also have to check that the tweet variable you’re passing to the API isn’t empty (…). It works perfectly with “favorites/create” and the tweet id sent in a post data array as below:

$parameters = (array(‘id’ =>$some_tweet_id));
//don’t do like me, make sure $some_tweet_id is not null…