curl --request GET \
--url https://pollunit.com/api/v1/polls/{poll_id}/votes \
--header 'Authorization: Bearer <token>'import requests
url = "https://pollunit.com/api/v1/polls/{poll_id}/votes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://pollunit.com/api/v1/polls/{poll_id}/votes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pollunit.com/api/v1/polls/{poll_id}/votes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pollunit.com/api/v1/polls/{poll_id}/votes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://pollunit.com/api/v1/polls/{poll_id}/votes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls/{poll_id}/votes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"type": "Votes::RatingVote",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"option_id": "<string>",
"loser_option_id": "<string>",
"voter_id": "<string>",
"vote": 123,
"vote_date": "2023-12-25",
"vote_text": "<string>",
"paid": true,
"voting_category_id": 123
}
]{
"error": "Unauthorized"
}{
"error": "Not Found"
}List poll votes
Returns one page of the votes of the poll, oldest first. Polls that hide their votes only list them with admin access. Pass voter_id or option_id to list the votes of one participant or one option. Use the X-Total-Pages / X-Total-Count response headers to page through the full list.
curl --request GET \
--url https://pollunit.com/api/v1/polls/{poll_id}/votes \
--header 'Authorization: Bearer <token>'import requests
url = "https://pollunit.com/api/v1/polls/{poll_id}/votes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://pollunit.com/api/v1/polls/{poll_id}/votes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pollunit.com/api/v1/polls/{poll_id}/votes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pollunit.com/api/v1/polls/{poll_id}/votes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://pollunit.com/api/v1/polls/{poll_id}/votes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls/{poll_id}/votes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"type": "Votes::RatingVote",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"option_id": "<string>",
"loser_option_id": "<string>",
"voter_id": "<string>",
"vote": 123,
"vote_date": "2023-12-25",
"vote_text": "<string>",
"paid": true,
"voting_category_id": 123
}
]{
"error": "Unauthorized"
}{
"error": "Not Found"
}Authorizations
Personal API token — find yours under My Account → API.
Path Parameters
Poll member_hash or admin_hash
Query Parameters
Voter public_id: only list the votes of this participant.
Option public_id: only list the votes for this option. Ignored when voter_id is given.
Page to return, 1-based. Defaults to 1.
Votes per page. Defaults to 30. At most 100.
public_id of an organization the user belongs to. When given, the request runs in that organization context instead of the personal account.
Response
votes listed
Vote id
"Votes::RatingVote"
Option public_id. For pairwise comparisons the option that won the comparison.
Pairwise comparisons only: option public_id of the option that lost the comparison.
Voter public_id
The value of the vote, whichever of vote, vote_date, vote_text or the decimal value is set.
Day the vote was cast on, for polls with vote_per_day.
Value of text votes, e.g. table columns.
Admin access only, and only for polls with a voting wallet. false while bought votes are not paid yet.
Only for polls with voting_categories.