从Facebook graph-api获取好友列表 [英] getting friendlist from 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屋!