POST
api/v1/vote/{type}/{id}/{vote}?revokeOnRevote={revokeOnRevote}

Submit votes of a user

Request

URL Parameters

Name (Data Type)Description
type: string

Specifies what the ID value refers to. One of the following: comment, submission

Additional information

  • Required

id: integer

ID of content to vote on. The CommentID or SubmissionID.

Additional information

  • Required

vote: integer

One of the following: -1 (down vote), 0 (revoke, unvote), 1 (up vote)

Additional information

  • Required

revokeOnRevote: boolean

Optional. If true then a duplicate vote will revoke (undo) the existing vote, if false then a duplicate vote will be ignored. Choosing to use this setting depends on your UI and how your users will interact with it. If a user upvotes a submission but then wants to remove the upvote they typically upvote the submission a second time, thus revoking the original upvote and now the submission will be in an unvoted/revoked state for the user. Default value is [true].

Additional information

  • Required

Response

Value indicating the result of the vote operation.

ApiDataResponseOfVoteResponse
Name (Data Type)Description
data: VoteResponse

success: boolean

version: string

error: ErrorInfo

Response Formats

application/json

Sample:
{
  "success": true,
  "data": {
    "recordedValue": 1,
    "response": null,
    "message": "Sucessfully Recorded",
    "status": "Success",
    "success": true
  },
  "version": "1.1.6291.19775"
}