我想获取Facebook相册的Cover_Photo。我得到了所有期望的Cover_photo。有人可以建议我吗?
代码:
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Token);
var host = "https://graph.facebook.com/";
var json = await client.GetStringAsync($"{host}me/albums");
//Tried with following but didn't worked
//var json = await client.GetStringAsync($"{host}me/albums?fields=cover_photo,id,created_time,name");
var data = JObject.Parse(json).First.First.ToString();
var albums = JsonConvert.DeserializeObject<FacebookAlbum[]>(data);
JSON响应
{“数据”:[{“ created_time”:“ 2018-08-08T07:04:25 + 0000”,“名称”:“移动 上传“,” id“:” 13015168813147“},{” created_time“:” 2018-08-08T07:00:25 + 0000“,”名称“:” Test2“,” id“:” 13014888880115“},{” created_time“:” 2018-08-08T06:59:16 + 0000“,” name“:” Test1“,” id“:” 130148257913489“}],” paging“:{” cursors“:{” before“:” MTMwMTUxNjc3OTEzMTW1“,”之后“:” MTMwMTQ4MjU3OTEzNDR $“}}}
支持链接之一:https://developers.facebook.com/docs/graph-api/reference/v3.1/album