3

我正在尝试通过Disqus API从另一个站点向我的博客提交评论。

我正在使用create提交评论。我正在使用 API 控制台进行尝试。我添加了 author_id、author_email、评论,但我不确定要添加到什么threadforum. 我尝试了我的帖子 ID (256) http://www.myblog.com/?p=256但它返回了..

{
  "code": 2, 
  "response": "Invalid argument, 'thread': User does not have write privileges on thread '256'"
}

任何使用 API 的人都可以告诉我如何创建评论吗?

4

2 回答 2

1

请记住,“线程”正在寻找的默认值是 Disqus 内部线程 ID(而不是您的情况下的 Wordpress ID)。但是,您可以使用disqus_identifier通过 Wordpress 插件设置的自定义(在博客文章的源代码中查找该值),或者如果您forum=YOUR_SHORTNAME另外传递,则可以使用与线程关联的 URL。

所以这里是你如何选择一个线程:

// 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
于 2013-02-20T08:42:18.540 回答
0

您需要给我认为注册了调用 API 写入权限的应用程序的“用户”。

见这里:http ://disqus.com/api/docs/permissions/

于 2011-12-17T01:44:34.243 回答