I am using Abrahm library https://github.com/abraham/twitteroauth
I can able to post and retweet but try this code for favorite
$fav_tweets=$connection->post("favorites/create/id=835432351400357888");
or
$fav_tweets=$connection->post("favorites/create.json?id=835432351400357888");
or
$fav_tweets=$connection->post("favorites/create/835432351400357888");
But no code works, they return the result:
stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [code] => 32 [message] => Could not authenticate you. ) ) )
Please help guys
Thanks in advance
From the example shown at https://twitteroauth.com/, try:
$statues = $connection->post("favorites/create", ["id" => "835432351400357888"]);