I am trying to use the Disqus API to add a post to an existing forum / forum. In the documentation, I can read that I can send a comment without authentication as a guest. The documentation says the following: http://disqus.com/api/docs/posts/create/
Anonymous comments are allowed in two conditions:
- You are using obsolete auth and your secret key
- You use your public key, you came from a trusted referrer, you are not authenticated, and the forum where you are trying to create a message is listed in the trusted application forums.
To create an anonymous comment, simply pass author_email and author_name and, optionally, the author_url parameter.
Therefore, I use this code to create a comment in PHP. (I use a very simple cURL class, but there is no problem there, because I get the same in the console at disqus.com/api)
$curl = new Curl(1); $curl->addPostVar('thread','THREAD_ID'); $curl->addPostVar('message','Text message'); $curl->addPostVar('author_email','My email'); $curl->addPostVar('author_name','My name'); $curl->addPostVar('api_secret','My application secret API key'); echo $curl->exec('https://disqus.com/api/3.0/posts/create.json');
But I get an error via JSON
{"code": 4, "response": "You must be authenticated to perform this action"}
I know that someone else asked this ( Disqus API to create an error message ), but the answer suggested using OAuth and getting authentication. But I do not want to authenticate, I want to send a comment for guests with a name and email. Where am I mistaken?
Thanks so much for any answers.
source share