Skip to main content

Get List of Votes for a Specific Post

This endpoint retrieves all votes (with the relative reactions) for a specific post

info

This operation requires authentication only if content_availability community option is false.

HTTP Request‚Äč

GET /api/v2/post/{id}/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.

Example Request‚Äč

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

fetch('/api/v2/post/{id}/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(Vote)truenoneList of results

Example responses‚Äč

{
"count": 123,
"next": "string",
"previous": "string",
"results": [
{
"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
},
"reaction": {
"id": 1,
"label": "string",
"image": "url",
"sentiment": 1,
"active": true
},
"voted_at": "2019-08-24T14:15:22Z"
}
]
}