Search code examples
facebookfacebook-comments

Post new comment to a Status via API


I'm having a status_id and try to post a new comment to:

POST https://graph.facebook.com/STATUS_ID/comments {message: "text" }

I get the result

{
 "error": {
   "message": "(#200) Cannot access object_id: 10150593515092107", 
   "type": "OAuthException", 
   "code": 200
  }
}

I can do the same POST for /likes and it works.

If I add a comment to a Photo it also works. I can then use the object_id of a photo but no such field exists on a status.


Solution

  • After two days of struggle i found the answer, at least for regular posts.

    Every object_id of a post on facebook consists from two parts: [author id]_[post id] you can see it clearly in the permalink: https://www.facebook.com/permalink.php?story_fbid=[post id]&id=[author id]

    so when you use the full id it seems to work!

    Now the real question is why isn't it propertly documented by facebook?!? and to who can I write an angry letter for wasting my time.

    it still doesn't work for videos or photos for example because I don't know what is the proper ID's for them and it isn't written anywhere. So if you succeed please let me know.