使用Graph API发布/检索照片评论

时间:2013-06-21 08:37:19

标签: facebook facebook-graph-api facebook-comments

当我使用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字段来嵌入图片时也会丢失。 我怎样才能实现上述任何一种?

3 个答案:

答案 0 :(得分:10)

fields=attachment添加到您的查询中。

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

答案 1 :(得分:3)

当您使用fields=attachment

时,它确实有效
https://graph.facebook.com/POSTID_COMMENTID?fields=attachment&access_token=ACCESS_TOKEN

答案 2 :(得分: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}
相关问题