ankit
ankit

Reputation: 1529

Number of comments posted by a user in disqus

Is there any way to get the number of comments posted by a user in disqus API.

I went through their Public/API data and found out that there is a field named numPosts in User.

But couldn't get how to retrieve it for a user registered on my site using disqus SSO.

Upvotes: 1

Views: 162

Answers (1)

ankit
ankit

Reputation: 1529

It can be retrieved by making a call to : "https://disqus.com/api/3.0/users/details.json" url

The response contains the field numPosts

var disqusPublicKey = "<yourkey>";
var disqusShortname = "<shortname>";
    $.ajax({
        type: 'GET',
        url: 'https://disqus.com/api/3.0/users/details.json',
        data: { api_key: disqusPublicKey, user:"<userid>"},
        cache: false,
        dataType: 'jsonp',
        success: function(response) {
            console.log(response);
        }
    });

For more details refer : https://disqus.com/api/docs/users/details/

Upvotes: 1

Related Questions