Question Upvote Resource

Upvoting Questions

Describes a parameterless endpoint which allow upvoting and downvoting of questions.

A question can be voted once by the currently signed user. Users can vote any question that was not authored by them as long as it wasn't deleted or the user has already voted on it. All votes can be withdrawn, so if the user changes their mind, they can vote again.

Feedback on the reason for a downvote can also be provided in a separate endpoint.

Upvote Question

A user may upvote a question via this endpoint. It will fail if the user already upvoted the question, but will replace their previous downvote, if it exists.

POST /questions/:ID/upvote

Response

HTTP 200 OK without body.

Downvote Question

A user may downvote a question via this endpoint. It will fail if the user already downvoted the question, but will replace their previous upvote, if it exists.

POST /questions/:ID/downvote

Response

HTTP 200 OK without body.

Give feedback for downvote

A user may provide feedback for their downvote specifying the reasons for which they downvoted the question. The request will fail if the user does not have an active (non-withdrawn) downvote for the question, or if the user has already given feedback.

Request

{
  "feedbacks": [
    {
      "feedback_type": "other",
      "feedback_text": "I feel personally offended with this question."
    },
    {
      "feedback_type": "asked_before"
    }
  ]
}

Where the possible values for feedback_type are:

  • value_for_community

  • question_clarity_and_context

  • writing_and_grammar

  • politeness_and_tone_of_voice

  • asked_before

  • other

If the specified type is other, the field feedback_text must be specified, whereas in all other cases it must not.

Response

HTTP 200 OK without body.

Withdraw vote for Question

A vote for a Question can be revoked by calling the Endpoint with DELETE method. User must have voted the Question before, otherwise the request will fail.

DELETE /questions/:ID/upvote

OR

DELETE /questions/:ID/downvote

Response

HTTP 200 OK without body.