curl --request GET \
--url https://pollunit.com/api/v1/polls/{poll_id}/votes/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://pollunit.com/api/v1/polls/{poll_id}/votes/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls/{poll_id}/votes/{id}")
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"
}Get vote
Polls that hide their votes only return the own votes of the requesting user, or any vote with admin access. For polls with vote_per_day only the votes of the current day are found.
curl --request GET \
--url https://pollunit.com/api/v1/polls/{poll_id}/votes/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://pollunit.com/api/v1/polls/{poll_id}/votes/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls/{poll_id}/votes/{id}")
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.
Headers
Your own identification of the user on whose behalf the request is made, any string. The user identifiers should not be guessable and stay secret, otherwise users could get access to other users' contents. Only used with a public API token: the created or changed object belongs to that anonymous user instead of the token owner, which keeps the user in control of it in later requests with the same identifier.
Access password of the poll. Only needed for password protected polls.
Query Parameters
public_id of an organization the user belongs to. When given, the request runs in that organization context instead of the personal account.
Response
vote found
A vote of one participant for one option. Which value field is set depends on the poll's vote_type.
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.