Proper way to determine if a user has already voted on a Thread/Post using the Disqus API?

108 views Asked by At

The Disqus API docs at https://disqus.com/api/docs/posts/vote/ and https://disqus.com/api/docs/threads/vote/ show some examples on registering votes for Posts and Threads, respectively.

These are the only documented API calls related to voting, and from the docs the calls are to be used to:

Register a vote on a post.

and

Register a vote on a thread.

So what API call should be used to determine if a user has already voted, and what their vote was? Is it up to the application developer utilizing the API to keep track of this?

1

There are 1 answers

5
Ryan V On BEST ANSWER

If you authenticate your API requests with an access token, any requests that include a post or thread will have a property called userScore.

On posts, this can be -1, 0 or 1, which follows the same voting pattern in the posts/vote API.

A thread won't have downvotes of course, so it'll be limited to 0 or 1