13

当我使用 Graph API 获取包含图像的评论时,返回的 JSON 不包含对它的引用,例如

{
  "id": "10151452996201039_9302037", 
  "from": {
    "name": "Anton Raxacoricofallapatorius Dyudin", 
    "id": "1534947411"
  }, 
  "message": "", 
  "can_remove": true, 
  "created_time": "2013-06-20T06:47:41+0000", 
  "like_count": 0, 
  "user_likes": false
}

我同样不知道评论时可以使用哪些 POST 字段来嵌入图片。我怎样才能实现上述任何一个?

4

3 回答 3

10

添加fields=attachment到您的查询。

https://developers.facebook.com/docs/graph-api/reference/comment

于 2013-07-22T17:43:34.080 回答
3

当你使用它实际上工作fields=attachment

https://graph.facebook.com/POSTID_COMMENTID?fields=attachment&access_token=ACCESS_TOKEN
于 2014-01-13T21:26:45.523 回答
1

如果您想要一个更广泛的查询来返回所有内容,我的意思是包括用户 ID、个人资料图片(大版本)、评论相关信息和附件信息在内的所有内容,请使用它。

&fields=id,status_type,created_time,from{name,id,picture.width(400).height(400)},message,picture.width(400).height(400),link,icon,comments{comments{attachment,from{picture.width(400).height(400),name},id,message,created_time},from{picture.width(400).height(400),name},id,message,attachment,created_time}
于 2017-06-27T04:06:18.217 回答