Facebook-使用图形API和PHP SDK发送好友请求(用户对用户)


Facebook - Send friend request (User to User) using graph API and PHP SDK?

所以我想知道faeebook文档在开发者的官方文档中没有提到它但我在博客上看到过图形调用,但它有效(这很奇怪)

https://graph.facebook.com/me/friends?method=post&uids=< USER ID>&access_token=< Acccess Token>

响应为

{
   "error": {
      "message": "(#200) ",
      "type": "OAuthException",
      "code": 200
   }
}

这样做可能吗?如果是,我如何使用PHP SDK?任何想法都可以接受

您可以使用Friends Dialog。要进行集成,可以使用javascript作为-

FB.ui({
  method: 'friends',
  id: USER_ID
}, function(response){});

或者,URL重定向为-

https://www.facebook.com/dialog/friends/?id=用户id&app_id=app_id&redirect_uri=redirect_uri

有关更多详细信息:Friends Dialog

相关文章: