Skip to main content

Get List of Poll Votes for a Specific Post

This endpoint retrieves all poll votes for a specific post. The choice parameter is used to filter the votes by a given poll choice of the poll. If the post has no poll associated the response status code is 404.

info

This operation requires authentication only if content_availability community option is false

HTTP Request‚Äč

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

Parameters‚Äč

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this post.
limitqueryintegerfalseNumber of results to return per page.
offsetqueryintegerfalseThe initial index from which to return the results.
choicequeryintegerfalseThe choice id of the poll. If is specified the endpoint retrieves the votes of only that choice

Example Request‚Äč

const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/post/{id}/poll/vote/',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Response Schema‚Äč

Status Code 200

NameTypeRequiredRestrictionsDescription
¬Ľ countintegertruenoneTotal results count
¬Ľ nextstring¬¶nullfalsenoneNext page url
¬Ľ previousstring¬¶nullfalsenonePrevious page url
¬Ľ resultslist(PollVote)truenoneList of results

Example responses‚Äč

{
"count": 123,
"next": "string",
"previous": "string",
"results": [
{
"id": 0,
"choice": "string",
"user": {
"id": 0,
"username": "string",
"real_name": "string",
"email": "user@example.com",
"email_isvalid": true,
"date_joined": "2019-08-24T14:15:22Z",
"bio": "string",
"location": "string",
"location_lat_lng": "string",
"position_lat_lng": "string",
"date_of_birth": "2019-08-24",
"description": "string",
"gender": "Male",
"status": "a",
"website": "https://example.com",
"avatar": "string",
"cover": "string",
"ext_id": "string",
"tags": [
{
"id": 0,
"active": true,
"type": "user",
"name": "string",
"description": "string",
"color": "string",
"visible": true,
"deleted": true,
"created_at": "2019-08-24T14:15:22Z"
}
],
"reputation":111,
"followings_counter": 0,
"followers_counter": 0,
"posts_counter": 0,
"discussions_counter": 0,
"statuses_counter": 0,
"polls_counter": 0
},
}
]
}