您可以使用图形api指定头像的大小,如下所示:
/me?fields=picture.type(square).width(638).height(638)
但是有人知道如何在一个API请求中拉多个尺寸吗?
谢谢!
我不相信这是可能的API。如果你知道图片id,你可以这样做:
GET /{PROFILE-PIC-ID}
{
"id": "XXX",
"created_time": "2014-09-03T20:43:08+0000",
"from": {
"id": "XXX",
"name": "XXX"
},
"height": 720,
"icon": "XXX",
"images": [
{
"height": 914,
"source": "XXX",
"width": 914
},
{
"height": 720,
"source": "XXX",
"width": 720
},
{
"height": 600,
"source": "XXX",
"width": 600
},
{
"height": 480,
"source": "XXX",
"width": 480
},
{
"height": 320,
"source": "XXX",
"width": 320
},
{
"height": 540,
"source": "XXX",
"width": 540
},
{
"height": 130,
"source": "XXX",
"width": 130
},
{
"height": 225,
"source": "XXX",
"width": 225
}
],
"link": "XXX",
"picture": "XXX",
"source": "XXX",
"updated_time": "2014-11-25T10:05:11+0000",
"width": 720,
"comments": {
"data": [
...
],
"paging": {
...
}
},
"likes": {
"data": [
...
],
"paging": {
...
}
}
}
BUT这也意味着:
- 您需要
user_photos
权限 - 您需要拨打多个呼叫(例如
/me/albums
…等)获取头像id。