Facebook Graph API + Facebook页面

rmo*_*son 7 facebook facebook-graph-api

使用Facebook的Graph API,给定用户名xyz(假设他们已经对我的网站进行了身份验证),如何获取用户管理的所有Facebook页面的列表?

dar*_*dar 15

accounts该物业user的对象说:

当前用户拥有的Facebook页面.如果已授予manage_pages权限,则此连接还会生成access_tokens,可用于代表页面查询Graph API.

http://developers.facebook.com/docs/reference/api/user


Pra*_*uja 5

获取访问令牌后,您可以获取用户管理的所有Facebook页面列表的所有详细信息.

https://graph.facebook.com/[FACEBOOKUSERID]?metadata=1&access_token=
Run Code Online (Sandbox Code Playgroud)

输出看起来像

{
   "name": "Facebook Developer Garage Austin - SXSW Edition",
   "metadata": {
      "connections": {
         "feed": "http://graph.facebook.com/331218348435/feed",
         "picture": "https://graph.facebook.com/331218348435/picture",
         "invited": "https://graph.facebook.com/331218348435/invited",
         "attending": "https://graph.facebook.com/331218348435/attending",
         "maybe": "https://graph.facebook.com/331218348435/maybe",
         "noreply": "https://graph.facebook.com/331218348435/noreply",
         "declined": "https://graph.facebook.com/331218348435/declined"
      }
   }
}
Run Code Online (Sandbox Code Playgroud)