Facebook API - 好友列表响应
Facebook API - Friends list response
朋友 API 的回复结构如何?该文档解释说它是一个用户对象数组和一个 total_count 字段。但是数组对象中包含哪些属性呢?例如是:
['id1','id2']
或
[ {'name': 'A user name','id':'id1'}, {'name': 'Another user
name','id':'id2'} ]
我知道这将是已经注册该应用程序的朋友,但问题只是关于响应数组的结构,如果你可以 select 哪些字段要 return。
朋友属于用户类型,因此您可以 select 来自用户的任何字段都可以 select 用于朋友。
在documentation中指出
An array of User objects representing the person's friends with this additional field:
单击用户对象 link 将显示 https://developers.facebook.com/docs/graph-api/reference/user/
JSON 看起来像这样:
{
"data": [
{
"name": "...",
"id": "..."
},
{
"name": "...",
"id": "..."
},
{
"name": "...",
"id": "..."
}
],
"paging": {
"next": "..."
},
"summary": {
"total_count": 609
}
}
你可以在API探索者中测试(如果有朋友授权你的App,或者API探索者App:https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffriends
朋友 API 的回复结构如何?该文档解释说它是一个用户对象数组和一个 total_count 字段。但是数组对象中包含哪些属性呢?例如是:
['id1','id2']
或
[ {'name': 'A user name','id':'id1'}, {'name': 'Another user name','id':'id2'} ]
我知道这将是已经注册该应用程序的朋友,但问题只是关于响应数组的结构,如果你可以 select 哪些字段要 return。
朋友属于用户类型,因此您可以 select 来自用户的任何字段都可以 select 用于朋友。
在documentation中指出
An array of User objects representing the person's friends with this additional field:
单击用户对象 link 将显示 https://developers.facebook.com/docs/graph-api/reference/user/
JSON 看起来像这样:
{
"data": [
{
"name": "...",
"id": "..."
},
{
"name": "...",
"id": "..."
},
{
"name": "...",
"id": "..."
}
],
"paging": {
"next": "..."
},
"summary": {
"total_count": 609
}
}
你可以在API探索者中测试(如果有朋友授权你的App,或者API探索者App:https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffriends