Question

I want to create a button that subscribes a user to a disqus thread.

I need some help with the DISQUS API I already played alot with it, also tried it via the DISQUS Console http://disqus.com/api/console/#!/ - nothing works.

$.ajax({
  type: "POST",
  url: "https://disqus.com/api/3.0/threads/subscribe.json",
  data: {
    "email": "mail@abc.com", 
    "thread": "ident:blog_post_123", 
    "forum": "myforum"
  },
  success: function(data){alert(data);},
  dataType: "jsonp"
});

The result is always

{
  "code": 2,
  "response": "Invalid argument, 'forum'"
}

What am I doing wrong? I cant find andything that helps me ...

Thanks!

Was it helpful?

Solution

The documentation is wrong since you actually can't use ident: or link: because 'forum' isn't an accepted argument.

Instead you'll need to do another lookup to get the thread ID first to use with the subscribe call. Use this endpoint with your identifier and forum shortname, and then grab the "id" value from the response: http://disqus.com/api/docs/threads/set/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top