您当然可以得到这些数据。有一个特定的permission 称为user_friendlists。您必须向您的用户请求该权限,一旦获得该权限,您所要做的就是查询此 Graph 端点 -
https://graph.facebook.com/USER_ID/friendlists
它会返回类似这样的数据 -
{
"data": [
{
"id": "XXX",
"name": "Close Friends",
"list_type": "close_friends"
},
{
"id": "YYY",
"name": "♥",
"list_type": "user_created"
},
{
"id": "ZZZ",
"name": "Offline",
"list_type": "user_created"
},
{
"id": "AAA",
"name": "The Office",
"list_type": "work"
},
{
"id": "BBB",
"name": "Acquaintances",
"list_type": "acquaintances"
},
...
如您所见,这里有两种类型的朋友列表。自动生成的如
还有一些我手动创建的自定义 -
要获取这些列表中列出的实际朋友,请使用/members 端点。
https://graph.facebook.com/USER_ID/FRIENDLIST_ID/members
这只是读取权限,您需要额外的manage_friendlists 才能创建/编辑这些列表。