获取页面的个人资料图片

gwe*_*all 11 facebook image facebook-graph-api

API似乎有变化.几天后再也无法访问网页的个人资料图片了.你通常可以通过查询来做到这一点:

https://graph.facebook.com/[PAGE_ID]/picture
Run Code Online (Sandbox Code Playgroud)

现在有什么想法怎么做?

小智 15

首先:为我工作.至少来自文档¹和其他一些文档的示例链接.

有可能图片的可见性受到限制,在这种情况下,您必须在网址中使用适当的访问令牌请求图片.使用以下格式:

http://graph.facebook.com/[PAGE_ID]/picture?access_token=YOUR_TOKEN_HERE
Run Code Online (Sandbox Code Playgroud)

请参阅[授权]下的文档.

¹示例链接:http://graph.facebook.com/DoloresPark/picture

  • 这适用于我,但它必须被修改为`https`而不是声称的`http` (2认同)
  • 要调整大小,请将 ?type=large|normal|small|square 附加到请求中 (2认同)

Gri*_*uer 7

如果您想通过Facebook应用程序请求查找图片,也可以通过应用程序ID获取信息.

http://graph.facebook.com/[PAGE_ID]/picture?app_id=YOUR_APP_ID_HERE
Run Code Online (Sandbox Code Playgroud)