如何使用 Graph API 将新评论发布到社交评论框中? [英] How can I post new comment with Graph API into Social Comments Box?

查看:28
本文介绍了如何使用 Graph API 将新评论发布到社交评论框中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Facebook 社交评论框.如何通过图形 API 向其发表评论?

I have facebook social comments box. How can I post comment through graph API to it?

推荐答案

这个问题我可以给你一半的答案,但我自己还是很需要另一半的.您可以通过找到其 post_fbid 在社交评论框中发布对现有评论的回复.为此,您可以使用 FQL,例如:

I can give you half the answer to this question, but still need the other half very much myself. You can post a reply to an existing comment within Social Comments box by finding its post_fbid. To get this you can use FQL such as:

https://api.facebook.com/method/fql.query?query=SELECT post_fbid, id FROM comment WHERE object_id IN (SELECT comments_fbid FROM link_stat WHERE url ='[ PAGE_URL ]')&access_token=[ ACCESS_TOKEN ]

此查询需要通过带有 PAGE_URL 的 escape() 运行,然后用于 HTTP GET 请求:

This query will need to be run through an escape() with the PAGE_URL and then used for an HTTP GET request:

https://api.facebook.com/method/fql.query?query=SELECT%20post_fbid%2C%20id%20%0A%20%20%20%20%20%20%20%20FROM%20comment%20%0A%20%20%20%20%20%20%20%20WHERE%20object_id%20IN%20%0A%20%20%20%20%20%20%20%20%20%20(SELECT%20comments_fbid%20%0A%20%20%20%20%20%20%20%20%20%20%20FROM%20link_stat%20%0A%20%20%20%20%20%20%20%20%20%20%20WHERE%20url%20%3D'http%3A%2F%2Fexample.com')&access_token=[ ACCESS_TOKEN ]

使用 post_fbid,您可以通过 HTTP POST 回复:

With the post_fbid you can make a reply by doing an HTTP POST to:

https://graph.facebook.com/[ POST_FBID ]/comments/?access_token=[ ACCESS_TOKEN ]&message=[ MESSAGE]

现在用于向页面发布新评论这个直到最近才使用HTTP POST:

Now for posting a new comment to the page this used to work until recently with an HTTP POST:

http://graph.facebook.com/comments/?ids=[ PAGE_URL ]&access_token=[ ACCESS_TOKEN ]&message=[ MESSAGE]

但目前这一直在返回:

{
  "error": {
    "message": "An unknown error has occurred.", 
    "type": "OAuthException"
  }
}

我希望这会有所帮助,如果任何人都可以阐明是否可以再发布这样的新评论,我们将不胜感激.

I hope this helps a bit and if anyone can shed some light if posting a new comment like this is even possible anymore it would be greatly appreciated.

这篇关于如何使用 Graph API 将新评论发布到社交评论框中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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