从给定用户获取所有个人资料图片的最佳方法是什么?我需要什么权限?
我知道我可以使用 https://graph.facebook.com/[uid]/picture
访问主要个人资料图片,但如何获取整个相册?
最佳答案
how do I get the entire album?
您需要 https://graph.facebook.com/[uid]/albums?access_token=[AUTH_TOKEN]
来获取用户所有相册的 JSON 数组。
您将从此处获得三项重要信息 id
- 专辑 ID、name
- 专辑名称和 type
- 专辑类型。
What permissions do I need?
所需权限为user_photos
see here
What is the best way to get ALL profile pictures from a given user?
个人资料图片在“个人资料图片”相册下。要获取个人资料相册,您需要查看相册数组(如前所述),遍历 JSON 结果集,直到您获得名称为 Profile Pictures
且类型为 的相册配置文件
。获取此对象的 id
。这是个人资料相册。
现在您可以像访问任何其他相册一样访问它。也就是说,https://graph.facebook.com/[ALBUM_ID]/photos?access_token=[AUTH_TOKEN]
这将列出用户曾经上传的所有个人资料照片。
希望这对您有所帮助。
关于 Facebook API : Get all profile pictures,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5058144/