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");
sleep(10);
twitteroauth_row($method, $connection->post($method), $connection->http_code);
var_dump($connection->http_code);
and
$method = ("favorites/create/$some_tweet_id");
sleep(10);
twitteroauth_row($method, $connection->post($method), $connection->http_code);
var_dump($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.