Note that there are some explanatory texts on larger screens.

plurals
  1. PODisqus API create post error
    text
    copied!<p>I have a problem using the Disqus API to try to comment on a publication made ​​in tumblr. This is the code:</p> <pre><code>&lt;?php ini_set('display_errors', 'on'); $thread="XXXXXXXXX"; // e.g., 455718495 — you'll need to also create a $forum and pass that if you know only the thread's URL or identifier rather than the ID $api="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // Generate one at http://disqus.com/api/applications/ -- Secret key is required for anonymous comment posting $message="Hello world."; // this is the content of the comment, i.e., what you'd normally type in the postbox $author_email="mail.user@mail.com"; // optional, including this will still make the comment a guest comment, but it will now be claimable $author_name="user"; // optional, can be any display name you like $fields_string=""; // DO NOT EDIT // set POST variables $url = 'http://disqus.com/api/3.0/posts/create.json'; // full documentation at http://disqus.com/api/docs/posts/create/ $fields = array( 'api_secret'=&gt;urlencode($api), // change to api_key when using a public key 'thread'=&gt;urlencode($thread), 'message'=&gt;urlencode($message), 'author_email'=&gt;urlencode($author_email), 'author_name'=&gt;urlencode($author_name), ); foreach($fields as $key=&gt;$value) { $fields_string .= $key.'='.$value.'&amp;'; } rtrim($fields_string,'&amp;'); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); // execute POST $result = curl_exec($ch); // close connection curl_close($ch); ?&gt; </code></pre> <p>I pass the required values ​​as are the api_key, the message you wish to comment, the thread ID, the mail and username, when you run the code php gives me the following error:</p> <pre><code>{"code": 4, "response": "You must be authenticated to perform this action"} </code></pre> <p>how can i solve this error?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload