通过API向状态发布新评论 [英] Post new comment to a Status via API

查看:135
本文介绍了通过API向状态发布新评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用status_id并尝试发布新的评论:

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

我得到结果

  {
error:{
message:(#200)无法访问object_id:10150593515092107
type:OAuthException,
code:200
}
}

我可以为/喜欢做相同的POST,它可以工作。



如果我向照片添加评论,它也可以。我可以使用一张照片的object_id,但在状态上不存在这样的字段。

解决方案

经过两天的奋斗,我发现答案,至少对于常规帖子。



Facebook上的帖子的每个 object_id 由两部分组成: code> [author id] _ [post id] 你可以清楚地看到它的固定链接: https://www.facebook.com/permalink.php? story_fbid = [post id]& id = [author id]



所以当你使用完整的id它似乎工作! p>

现在真正的问题是为什么不是Facebook的文档?并且我可以写一封生气的信件来浪费我的时间。



它仍然不适用于视频或照片,例如因为我不知道是什么他们的身份证号码并不在任何地方写。所以如果你成功,请让我知道。


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.

解决方案

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.

这篇关于通过API向状态发布新评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆