如何使用facebook Graph API点击facebook POST

How to hit like for a facebook POST using Facebook Graph API?

本文关键字:facebook 点击 POST API Graph 何使用      更新时间:2023-09-26

我目前正在使用Facebook Graph API来点赞Facebook上的帖子。如中所述https://developers.facebook.com/docs/graph-api/reference/v2.1/object/likes这是我的代码:

FB.api(
"/{object-id}/likes",
"POST",
function (response) {
  if (response && !response.error) {
    /* handle the result */
  }
}

);

我有publish_actions权限,也有用户令牌,但错误是

FB.__globalCallbacks.f151265214({"error":{"message":"(#200) Permissions error","type":"OAuthException","code":200}});

有人能帮忙吗?现在有点绝望。非常感谢。

似乎您在登录应用程序时没有收集到publish_actions权限。

参见

  • https://developers.facebook.com/docs/graph-api/reference/v2.1/object/likes/#publish

您需要此权限才能为特定用户发布类似的对象。