Get poll
curl --request GET \
--url https://pollunit.com/api/v1/polls/{poll_hash} \
--header 'Authorization: Bearer <token>'import requests
url = "https://pollunit.com/api/v1/polls/{poll_hash}"
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_hash}', 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_hash}",
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_hash}"
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_hash}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls/{poll_hash}")
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{
"public_url": "<string>",
"member_hash": "<string>",
"title": "<string>",
"type": "Polls::Voting",
"status": "active",
"admin_url": "<string>",
"admin_hash": "<string>",
"description": "<string>",
"location": "<string>",
"options_count": 123,
"voters_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"settings": {
"access_by_provider": "facebook",
"additional_attributes": {},
"additional_option_attributes": {},
"advent_calendar_shape": "number",
"allow_attachments": true,
"allow_change_sort": true,
"allow_comments": true,
"allow_description": true,
"allow_group_submissions": true,
"allow_info_link": true,
"allow_new_options": true,
"allow_new_rows": true,
"allow_search": true,
"allow_share": true,
"allow_subtitle": true,
"allow_voting": true,
"allowed_hosts": [
"<string>"
],
"anonymize_voter_names": true,
"custom_hash": true,
"deadline_submission": "2023-11-07T05:31:56Z",
"deadline_voting": "2023-11-07T05:31:56Z",
"default_sort": "options.average_rating desc",
"default_states": [
"incoming"
],
"disable_participant_sign_up": true,
"dot_vote_icon": "dot",
"effect": "snow",
"file_size_max_mb": 123,
"file_size_min_mb": 123,
"forward_url_parameters": true,
"group_submission_max_entries": 123,
"hidden_author_name": true,
"hidden_best_rating": true,
"hidden_image_name": true,
"hidden_participants": true,
"hide_options": true,
"hide_results": true,
"hide_tags": true,
"hide_votes": true,
"image_min_height": 123,
"image_min_smallest_side_length": 123,
"image_min_width": 123,
"image_orientation": "all",
"indexing": true,
"jury_mode": true,
"limit_per_option": 123,
"limit_per_option_type": "no_limit",
"notify_new_options": true,
"option_limit": 123,
"option_type": "Options::AdventCalendarOption",
"option_vote_requirement": "optional",
"options_per_page": 123,
"options_visible_before_voting": true,
"participant_limitation_type": "check_nothing",
"photo_gallery_full_width": true,
"photo_gallery_image_mode": "contain",
"photo_gallery_layout": "auto",
"prevent_vote_for_own_options": true,
"privacy_policy": "<string>",
"privacy_policy_for_option_creators": true,
"privacy_policy_for_voters": true,
"private_comments": true,
"public_admin_link": true,
"publisher": "<string>",
"publisher_email": "<string>",
"publisher_info": "<string>",
"randomize_options": true,
"rating_method": "average_by_voted",
"require_all_dots": false,
"require_approval": true,
"require_author_name": true,
"require_description": true,
"require_voter_name": true,
"restrict_view_access": true,
"restricted_double_opt_in_domains": "<array>",
"show_as_list": true,
"show_metadata": true,
"show_photo_info_by_default": true,
"show_quiz_points": true,
"social_media_description": "<string>",
"social_media_image_data": {},
"social_media_title": "<string>",
"start_date_submission": "2023-11-07T05:31:56Z",
"start_date_voting": "2023-11-07T05:31:56Z",
"submission_fee": 123,
"submission_fee_title": "<string>",
"submission_fee_type": "submission_fee",
"target": "best_option",
"terms": "<string>",
"terms_for_option_creators": true,
"terms_for_voters": true,
"thank_you_page": true,
"thank_you_page_data": {},
"thank_you_page_submitter": true,
"thank_you_page_submitter_data": {},
"timezone": "<string>",
"vote_limit_per_option": 123,
"vote_limit_per_option_min": 123,
"vote_limit_per_voter": 123,
"vote_per_day": true,
"vote_type": "Votes::BooleanVote",
"voting_categories": [
"creativity"
],
"voting_fee": 123,
"voting_fee_title": "<string>",
"voting_fee_type": "voting_fee",
"white_label": true
},
"configuration_hints": {},
"voter_required_fields": [
"user_name",
"terms_accepted",
{
"additional_attributes": [
"ID1",
"optin_email"
]
}
],
"option_required_fields": [
"user_name",
"terms_accepted",
{
"additional_attributes": [
"ID1",
"optin_email"
]
}
]
}{
"error": "Unauthorized"
}Polls
Get poll
GET
/
api
/
v1
/
polls
/
{poll_hash}
Get poll
curl --request GET \
--url https://pollunit.com/api/v1/polls/{poll_hash} \
--header 'Authorization: Bearer <token>'import requests
url = "https://pollunit.com/api/v1/polls/{poll_hash}"
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_hash}', 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_hash}",
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_hash}"
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_hash}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls/{poll_hash}")
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{
"public_url": "<string>",
"member_hash": "<string>",
"title": "<string>",
"type": "Polls::Voting",
"status": "active",
"admin_url": "<string>",
"admin_hash": "<string>",
"description": "<string>",
"location": "<string>",
"options_count": 123,
"voters_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"settings": {
"access_by_provider": "facebook",
"additional_attributes": {},
"additional_option_attributes": {},
"advent_calendar_shape": "number",
"allow_attachments": true,
"allow_change_sort": true,
"allow_comments": true,
"allow_description": true,
"allow_group_submissions": true,
"allow_info_link": true,
"allow_new_options": true,
"allow_new_rows": true,
"allow_search": true,
"allow_share": true,
"allow_subtitle": true,
"allow_voting": true,
"allowed_hosts": [
"<string>"
],
"anonymize_voter_names": true,
"custom_hash": true,
"deadline_submission": "2023-11-07T05:31:56Z",
"deadline_voting": "2023-11-07T05:31:56Z",
"default_sort": "options.average_rating desc",
"default_states": [
"incoming"
],
"disable_participant_sign_up": true,
"dot_vote_icon": "dot",
"effect": "snow",
"file_size_max_mb": 123,
"file_size_min_mb": 123,
"forward_url_parameters": true,
"group_submission_max_entries": 123,
"hidden_author_name": true,
"hidden_best_rating": true,
"hidden_image_name": true,
"hidden_participants": true,
"hide_options": true,
"hide_results": true,
"hide_tags": true,
"hide_votes": true,
"image_min_height": 123,
"image_min_smallest_side_length": 123,
"image_min_width": 123,
"image_orientation": "all",
"indexing": true,
"jury_mode": true,
"limit_per_option": 123,
"limit_per_option_type": "no_limit",
"notify_new_options": true,
"option_limit": 123,
"option_type": "Options::AdventCalendarOption",
"option_vote_requirement": "optional",
"options_per_page": 123,
"options_visible_before_voting": true,
"participant_limitation_type": "check_nothing",
"photo_gallery_full_width": true,
"photo_gallery_image_mode": "contain",
"photo_gallery_layout": "auto",
"prevent_vote_for_own_options": true,
"privacy_policy": "<string>",
"privacy_policy_for_option_creators": true,
"privacy_policy_for_voters": true,
"private_comments": true,
"public_admin_link": true,
"publisher": "<string>",
"publisher_email": "<string>",
"publisher_info": "<string>",
"randomize_options": true,
"rating_method": "average_by_voted",
"require_all_dots": false,
"require_approval": true,
"require_author_name": true,
"require_description": true,
"require_voter_name": true,
"restrict_view_access": true,
"restricted_double_opt_in_domains": "<array>",
"show_as_list": true,
"show_metadata": true,
"show_photo_info_by_default": true,
"show_quiz_points": true,
"social_media_description": "<string>",
"social_media_image_data": {},
"social_media_title": "<string>",
"start_date_submission": "2023-11-07T05:31:56Z",
"start_date_voting": "2023-11-07T05:31:56Z",
"submission_fee": 123,
"submission_fee_title": "<string>",
"submission_fee_type": "submission_fee",
"target": "best_option",
"terms": "<string>",
"terms_for_option_creators": true,
"terms_for_voters": true,
"thank_you_page": true,
"thank_you_page_data": {},
"thank_you_page_submitter": true,
"thank_you_page_submitter_data": {},
"timezone": "<string>",
"vote_limit_per_option": 123,
"vote_limit_per_option_min": 123,
"vote_limit_per_voter": 123,
"vote_per_day": true,
"vote_type": "Votes::BooleanVote",
"voting_categories": [
"creativity"
],
"voting_fee": 123,
"voting_fee_title": "<string>",
"voting_fee_type": "voting_fee",
"white_label": true
},
"configuration_hints": {},
"voter_required_fields": [
"user_name",
"terms_accepted",
{
"additional_attributes": [
"ID1",
"optin_email"
]
}
],
"option_required_fields": [
"user_name",
"terms_accepted",
{
"additional_attributes": [
"ID1",
"optin_email"
]
}
]
}{
"error": "Unauthorized"
}Authorizations
Query Parameters
Response
poll found
Attributes the poll configuration makes mandatory when a voter or an option is created. Entries are attribute names; the last entry is an object { "additional_attributes": [...] } listing the ids of the required additional attributes, when the poll defines any (the double opt in address is listed as optin_email).
Example:
[
"user_name",
"terms_accepted",
{
"additional_attributes": ["ID1", "optin_email"]
}
]
Attributes the poll configuration makes mandatory when a voter or an option is created. Entries are attribute names; the last entry is an object { "additional_attributes": [...] } listing the ids of the required additional attributes, when the poll defines any (the double opt in address is listed as optin_email).
Example:
[
"user_name",
"terms_accepted",
{
"additional_attributes": ["ID1", "optin_email"]
}
]