从 facebook graph 获取好友列表-api

getting friendlist from facebook graph-api

我正在尝试从 facebook Graph-api 获取用户的好友列表。因此,当我尝试通过 url 打开时获取访问令牌后,通过

打开
https://graph.facebook.com/facebook_id/friends?access_token=authentic_accesstoken

即使我直接在浏览器上打开它,也不会给出 friend_list of person(facebook_id),至少不会给出整个列表。这是它在浏览器上显示的内容

{
   "data": [
      {
         "name": "Face_id_name",
         "id": "facebook_numeric_id"
      }
   ],
   "paging": {
      "next": "https://graph.facebook.com/v2.2/facebook_id/friends?access_token=authentic_accesstoken&limit=25&offset=25&__after_id=enc_Some_encrypted_code"
   },
   "summary": {
      "total_count": 263
   }
}

在数据中,它没有显示整个列表,当我使用 link 到 paging: next: 时,它没有给我任何东西,只是再次显示总计数。
我不确定我的 url 是否正确。

您无法获得任何用户的朋友,您只能获得授权用户的朋友,并且 只能获得授权该应用程序的人 - 出于隐私原因。所以这是唯一正确的调用:

https://graph.facebook.com/me/friends?access_token=authentic_accesstoken

不需要用ID,反正只能用授权用户的ID。所以你可以只使用 "me" 来代替。

更多关于有限好友结果的信息可以在无数其他线程中找到,例如:Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app