我正在尝试通过 Disqus API 从另一个站点向我的博客提交评论.
我正在使用 create提交评论。我正在使用 API 控制台进行试用。我添加了 author_id、author_email、评论,但我不确定要将什么添加到 thread
或 forum
。我尝试了我的帖子 ID (256) http://www.myblog.com/?p= 256
但返回..
{
"code": 2,
"response": "Invalid argument, 'thread': User does not have write privileges on thread '256'"
}
任何使用过该 API 的人都可以告诉我如何创建评论吗?
最佳答案
请记住,'thread' 正在寻找的默认值是 Disqus 内部线程 ID(而不是您的情况下的 Wordpress ID)。但是,您可以使用通过 Wordpress 插件设置的自定义 disqus_identifier
(在您的博客文章的源代码中查找该值),或者如果您传递 则与线程关联的 URL forum=YOUR_SHORTNAME
另外。
下面是您如何选择一个线程:
// Example using Disqus internal ID
POST https://disqus.com/api/3.0/posts/create.json
(your arguments)...
thread=12345678
// Example using disqus_identifier
POST https://disqus.com/api/3.0/posts/create.json
(your arguments)...
thread=ident:256 http://www.myblog.com/?p=256 // This is the schema used in the WP plugin
forum=YOUR_SHORTNAME
// Example using URL (this is the least reliable)
POST https://disqus.com/api/3.0/posts/create.json
(your arguments)...
thread=link:http://www.myblog.com/some_slug
forum=YOUR_SHORTNAME
关于php - Disqus API 添加评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4549282/