从Facebook graph-api获取好友列表 [英] getting friendlist from facebook graph-api

查看:45
本文介绍了从Facebook graph-api获取好友列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从facebook Graph-api获取用户的朋友列表.因此,当我尝试通过urlopen by

I am trying to get user's friend list from facebook Graph-api. So after getting access token when I try to open by urlopen by

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

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

this doesn't give friend_list of person(facebook_id) not even when I open it directly on the browser, at least not the entire list. This is what it shows on the browser

{
   "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
   }
}

在数据中,它不会显示整个列表,并且当我使用链接到 paging:next:时,它不会再给我任何东西,而只是再次总数.
我不确定自己的网址是否正确.

In data it doesn't show the entire list and when I use link to paging: next: it doesn't give me anything just total count again.
I am not entirely sure whether my url is right or not.

推荐答案

您无法获得ANY用户的朋友,只能获得授权用户的朋友,并且也只有获得该应用程序授权的人-出于隐私原因.因此,这是唯一正确的调用:

You can´t get the friends of ANY user, you can only get the friends of the authorized user and only those who authorized the App too - for privacy reasons. So this is the only correct call:

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

不需要使用该ID,因为无论如何您只能使用授权用户的ID.因此,您可以只使用我".

There is no need to use the ID, because you can only use the ID of the authorized user anyway. So you can just use "me" instead.

关于有限朋友结果的更多信息可以在无数其他线程中找到,例如:

More information about the limited friend result can be found in countless other threads, for example: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

这篇关于从Facebook graph-api获取好友列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆