如何使用Twitter API收藏Tweet

时间:2017-02-25 11:25:49

标签: php api twitter

我正在使用Abrahm图书馆https://github.com/abraham/twitteroauth

我可以发布并转发,但尝试使用此代码进行收藏

$fav_tweets=$connection->post("favorites/create/id=835432351400357888");

$fav_tweets=$connection->post("favorites/create.json?id=835432351400357888");

$fav_tweets=$connection->post("favorites/create/835432351400357888");

但是没有代码可以工作,他们会返回结果:

stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [code] => 32 [message] => Could not authenticate you. ) ) ) 

请帮助伙计们 提前谢谢

1 个答案:

答案 0 :(得分:1)

https://twitteroauth.com/显示的示例中,尝试:

$statues = $connection->post("favorites/create", ["id" => "835432351400357888"]);