Skip to main content

Upvote for a Specific Poll Choice

This endpoint upvotes a specific poll choice in a post. If the post has no poll associated the response status code is 404

info

This operation requires authentication.

HTTP Request

POST /api/v2/post/{id}/poll/vote/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this post.
choicebodyintegertrueA unique integer value identifying the choice to be upvoted.

Example Request


const inputBody = {
"choice": 0
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/post/{id}/poll/vote/',
{
method: 'POST',
headers: headers,
body: inputBody
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
204No ContentnoneNone