Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Posting/retrieving photo-comments using Graph API

When I use the Graph API to fetch a comment containing an image, the returned JSON contains no reference to it, e.g.

{
  "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
}

I am likewise lost as to what POST field can be used to embed a picture when commenting. How can I achieve either of the above?

like image 656
Anton Avatar asked Jun 21 '13 08:06

Anton


3 Answers

If you want a more extensive query that return everythings and I mean everything including user id's, profile image (large version), comment related info as well and attachement info use this.

&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}
like image 106
Cesar Bielich Avatar answered Nov 15 '22 19:11

Cesar Bielich


Add fields=attachment to your query.

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

like image 45
Elben Shira Avatar answered Nov 15 '22 20:11

Elben Shira


It actually works when you use fields=attachment

https://graph.facebook.com/POSTID_COMMENTID?fields=attachment&access_token=ACCESS_TOKEN
like image 3
Ahsaan Yousuf Avatar answered Nov 15 '22 19:11

Ahsaan Yousuf