Create poll
curl --request POST \
--url https://pollunit.com/api/v1/polls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"poll": {
"title": "My new poll",
"type": "Polls::Voting",
"additional_attributes": {},
"additional_option_attributes": {},
"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_states": [],
"disable_participant_sign_up": true,
"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,
"indexing": true,
"jury_mode": true,
"limit_per_option": 123,
"notify_new_options": true,
"option_limit": 123,
"options_per_page": 123,
"options_visible_before_voting": true,
"photo_gallery_full_width": true,
"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,
"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,
"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>",
"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,
"voting_fee": 123,
"voting_fee_title": "<string>",
"white_label": true,
"description": "<string>",
"location": "<string>",
"creator_name": "<string>",
"creator_email": "<string>"
}
}
'import requests
url = "https://pollunit.com/api/v1/polls"
payload = { "poll": {
"title": "My new poll",
"type": "Polls::Voting",
"additional_attributes": {},
"additional_option_attributes": {},
"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_states": [],
"disable_participant_sign_up": True,
"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,
"indexing": True,
"jury_mode": True,
"limit_per_option": 123,
"notify_new_options": True,
"option_limit": 123,
"options_per_page": 123,
"options_visible_before_voting": True,
"photo_gallery_full_width": True,
"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,
"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,
"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>",
"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,
"voting_fee": 123,
"voting_fee_title": "<string>",
"white_label": True,
"description": "<string>",
"location": "<string>",
"creator_name": "<string>",
"creator_email": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
poll: {
title: 'My new poll',
type: 'Polls::Voting',
additional_attributes: {},
additional_option_attributes: {},
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_states: [],
disable_participant_sign_up: true,
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,
indexing: true,
jury_mode: true,
limit_per_option: 123,
notify_new_options: true,
option_limit: 123,
options_per_page: 123,
options_visible_before_voting: true,
photo_gallery_full_width: true,
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,
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,
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>',
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,
voting_fee: 123,
voting_fee_title: '<string>',
white_label: true,
description: '<string>',
location: '<string>',
creator_name: '<string>',
creator_email: '<string>'
}
})
};
fetch('https://pollunit.com/api/v1/polls', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'poll' => [
'title' => 'My new poll',
'type' => 'Polls::Voting',
'additional_attributes' => [
],
'additional_option_attributes' => [
],
'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_states' => [
],
'disable_participant_sign_up' => true,
'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,
'indexing' => true,
'jury_mode' => true,
'limit_per_option' => 123,
'notify_new_options' => true,
'option_limit' => 123,
'options_per_page' => 123,
'options_visible_before_voting' => true,
'photo_gallery_full_width' => true,
'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,
'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,
'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>',
'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,
'voting_fee' => 123,
'voting_fee_title' => '<string>',
'white_label' => true,
'description' => '<string>',
'location' => '<string>',
'creator_name' => '<string>',
'creator_email' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pollunit.com/api/v1/polls"
payload := strings.NewReader("{\n \"poll\": {\n \"title\": \"My new poll\",\n \"type\": \"Polls::Voting\",\n \"additional_attributes\": {},\n \"additional_option_attributes\": {},\n \"allow_attachments\": true,\n \"allow_change_sort\": true,\n \"allow_comments\": true,\n \"allow_description\": true,\n \"allow_group_submissions\": true,\n \"allow_info_link\": true,\n \"allow_new_options\": true,\n \"allow_new_rows\": true,\n \"allow_search\": true,\n \"allow_share\": true,\n \"allow_subtitle\": true,\n \"allow_voting\": true,\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"anonymize_voter_names\": true,\n \"custom_hash\": true,\n \"deadline_submission\": \"2023-11-07T05:31:56Z\",\n \"deadline_voting\": \"2023-11-07T05:31:56Z\",\n \"default_states\": [],\n \"disable_participant_sign_up\": true,\n \"file_size_max_mb\": 123,\n \"file_size_min_mb\": 123,\n \"forward_url_parameters\": true,\n \"group_submission_max_entries\": 123,\n \"hidden_author_name\": true,\n \"hidden_best_rating\": true,\n \"hidden_image_name\": true,\n \"hidden_participants\": true,\n \"hide_options\": true,\n \"hide_results\": true,\n \"hide_tags\": true,\n \"hide_votes\": true,\n \"image_min_height\": 123,\n \"image_min_smallest_side_length\": 123,\n \"image_min_width\": 123,\n \"indexing\": true,\n \"jury_mode\": true,\n \"limit_per_option\": 123,\n \"notify_new_options\": true,\n \"option_limit\": 123,\n \"options_per_page\": 123,\n \"options_visible_before_voting\": true,\n \"photo_gallery_full_width\": true,\n \"prevent_vote_for_own_options\": true,\n \"privacy_policy\": \"<string>\",\n \"privacy_policy_for_option_creators\": true,\n \"privacy_policy_for_voters\": true,\n \"private_comments\": true,\n \"public_admin_link\": true,\n \"publisher\": \"<string>\",\n \"publisher_email\": \"<string>\",\n \"publisher_info\": \"<string>\",\n \"randomize_options\": true,\n \"require_approval\": true,\n \"require_author_name\": true,\n \"require_description\": true,\n \"require_voter_name\": true,\n \"restrict_view_access\": true,\n \"restricted_double_opt_in_domains\": \"<array>\",\n \"show_as_list\": true,\n \"show_metadata\": true,\n \"show_photo_info_by_default\": true,\n \"social_media_description\": \"<string>\",\n \"social_media_image_data\": {},\n \"social_media_title\": \"<string>\",\n \"start_date_submission\": \"2023-11-07T05:31:56Z\",\n \"start_date_voting\": \"2023-11-07T05:31:56Z\",\n \"submission_fee\": 123,\n \"submission_fee_title\": \"<string>\",\n \"terms\": \"<string>\",\n \"terms_for_option_creators\": true,\n \"terms_for_voters\": true,\n \"thank_you_page\": true,\n \"thank_you_page_data\": {},\n \"thank_you_page_submitter\": true,\n \"thank_you_page_submitter_data\": {},\n \"timezone\": \"<string>\",\n \"vote_limit_per_option\": 123,\n \"vote_limit_per_option_min\": 123,\n \"vote_limit_per_voter\": 123,\n \"vote_per_day\": true,\n \"voting_fee\": 123,\n \"voting_fee_title\": \"<string>\",\n \"white_label\": true,\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"creator_name\": \"<string>\",\n \"creator_email\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pollunit.com/api/v1/polls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"poll\": {\n \"title\": \"My new poll\",\n \"type\": \"Polls::Voting\",\n \"additional_attributes\": {},\n \"additional_option_attributes\": {},\n \"allow_attachments\": true,\n \"allow_change_sort\": true,\n \"allow_comments\": true,\n \"allow_description\": true,\n \"allow_group_submissions\": true,\n \"allow_info_link\": true,\n \"allow_new_options\": true,\n \"allow_new_rows\": true,\n \"allow_search\": true,\n \"allow_share\": true,\n \"allow_subtitle\": true,\n \"allow_voting\": true,\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"anonymize_voter_names\": true,\n \"custom_hash\": true,\n \"deadline_submission\": \"2023-11-07T05:31:56Z\",\n \"deadline_voting\": \"2023-11-07T05:31:56Z\",\n \"default_states\": [],\n \"disable_participant_sign_up\": true,\n \"file_size_max_mb\": 123,\n \"file_size_min_mb\": 123,\n \"forward_url_parameters\": true,\n \"group_submission_max_entries\": 123,\n \"hidden_author_name\": true,\n \"hidden_best_rating\": true,\n \"hidden_image_name\": true,\n \"hidden_participants\": true,\n \"hide_options\": true,\n \"hide_results\": true,\n \"hide_tags\": true,\n \"hide_votes\": true,\n \"image_min_height\": 123,\n \"image_min_smallest_side_length\": 123,\n \"image_min_width\": 123,\n \"indexing\": true,\n \"jury_mode\": true,\n \"limit_per_option\": 123,\n \"notify_new_options\": true,\n \"option_limit\": 123,\n \"options_per_page\": 123,\n \"options_visible_before_voting\": true,\n \"photo_gallery_full_width\": true,\n \"prevent_vote_for_own_options\": true,\n \"privacy_policy\": \"<string>\",\n \"privacy_policy_for_option_creators\": true,\n \"privacy_policy_for_voters\": true,\n \"private_comments\": true,\n \"public_admin_link\": true,\n \"publisher\": \"<string>\",\n \"publisher_email\": \"<string>\",\n \"publisher_info\": \"<string>\",\n \"randomize_options\": true,\n \"require_approval\": true,\n \"require_author_name\": true,\n \"require_description\": true,\n \"require_voter_name\": true,\n \"restrict_view_access\": true,\n \"restricted_double_opt_in_domains\": \"<array>\",\n \"show_as_list\": true,\n \"show_metadata\": true,\n \"show_photo_info_by_default\": true,\n \"social_media_description\": \"<string>\",\n \"social_media_image_data\": {},\n \"social_media_title\": \"<string>\",\n \"start_date_submission\": \"2023-11-07T05:31:56Z\",\n \"start_date_voting\": \"2023-11-07T05:31:56Z\",\n \"submission_fee\": 123,\n \"submission_fee_title\": \"<string>\",\n \"terms\": \"<string>\",\n \"terms_for_option_creators\": true,\n \"terms_for_voters\": true,\n \"thank_you_page\": true,\n \"thank_you_page_data\": {},\n \"thank_you_page_submitter\": true,\n \"thank_you_page_submitter_data\": {},\n \"timezone\": \"<string>\",\n \"vote_limit_per_option\": 123,\n \"vote_limit_per_option_min\": 123,\n \"vote_limit_per_voter\": 123,\n \"vote_per_day\": true,\n \"voting_fee\": 123,\n \"voting_fee_title\": \"<string>\",\n \"white_label\": true,\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"creator_name\": \"<string>\",\n \"creator_email\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"poll\": {\n \"title\": \"My new poll\",\n \"type\": \"Polls::Voting\",\n \"additional_attributes\": {},\n \"additional_option_attributes\": {},\n \"allow_attachments\": true,\n \"allow_change_sort\": true,\n \"allow_comments\": true,\n \"allow_description\": true,\n \"allow_group_submissions\": true,\n \"allow_info_link\": true,\n \"allow_new_options\": true,\n \"allow_new_rows\": true,\n \"allow_search\": true,\n \"allow_share\": true,\n \"allow_subtitle\": true,\n \"allow_voting\": true,\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"anonymize_voter_names\": true,\n \"custom_hash\": true,\n \"deadline_submission\": \"2023-11-07T05:31:56Z\",\n \"deadline_voting\": \"2023-11-07T05:31:56Z\",\n \"default_states\": [],\n \"disable_participant_sign_up\": true,\n \"file_size_max_mb\": 123,\n \"file_size_min_mb\": 123,\n \"forward_url_parameters\": true,\n \"group_submission_max_entries\": 123,\n \"hidden_author_name\": true,\n \"hidden_best_rating\": true,\n \"hidden_image_name\": true,\n \"hidden_participants\": true,\n \"hide_options\": true,\n \"hide_results\": true,\n \"hide_tags\": true,\n \"hide_votes\": true,\n \"image_min_height\": 123,\n \"image_min_smallest_side_length\": 123,\n \"image_min_width\": 123,\n \"indexing\": true,\n \"jury_mode\": true,\n \"limit_per_option\": 123,\n \"notify_new_options\": true,\n \"option_limit\": 123,\n \"options_per_page\": 123,\n \"options_visible_before_voting\": true,\n \"photo_gallery_full_width\": true,\n \"prevent_vote_for_own_options\": true,\n \"privacy_policy\": \"<string>\",\n \"privacy_policy_for_option_creators\": true,\n \"privacy_policy_for_voters\": true,\n \"private_comments\": true,\n \"public_admin_link\": true,\n \"publisher\": \"<string>\",\n \"publisher_email\": \"<string>\",\n \"publisher_info\": \"<string>\",\n \"randomize_options\": true,\n \"require_approval\": true,\n \"require_author_name\": true,\n \"require_description\": true,\n \"require_voter_name\": true,\n \"restrict_view_access\": true,\n \"restricted_double_opt_in_domains\": \"<array>\",\n \"show_as_list\": true,\n \"show_metadata\": true,\n \"show_photo_info_by_default\": true,\n \"social_media_description\": \"<string>\",\n \"social_media_image_data\": {},\n \"social_media_title\": \"<string>\",\n \"start_date_submission\": \"2023-11-07T05:31:56Z\",\n \"start_date_voting\": \"2023-11-07T05:31:56Z\",\n \"submission_fee\": 123,\n \"submission_fee_title\": \"<string>\",\n \"terms\": \"<string>\",\n \"terms_for_option_creators\": true,\n \"terms_for_voters\": true,\n \"thank_you_page\": true,\n \"thank_you_page_data\": {},\n \"thank_you_page_submitter\": true,\n \"thank_you_page_submitter_data\": {},\n \"timezone\": \"<string>\",\n \"vote_limit_per_option\": 123,\n \"vote_limit_per_option_min\": 123,\n \"vote_limit_per_voter\": 123,\n \"vote_per_day\": true,\n \"voting_fee\": 123,\n \"voting_fee_title\": \"<string>\",\n \"white_label\": true,\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"creator_name\": \"<string>\",\n \"creator_email\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"public_url": "<string>",
"member_hash": "<string>",
"title": "<string>",
"type": "Polls::Voting",
"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": {
"additional_attributes": {},
"additional_option_attributes": {},
"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_states": [],
"disable_participant_sign_up": true,
"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,
"indexing": true,
"jury_mode": true,
"limit_per_option": 123,
"notify_new_options": true,
"option_limit": 123,
"options_per_page": 123,
"options_visible_before_voting": true,
"photo_gallery_full_width": true,
"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,
"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,
"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>",
"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,
"voting_fee": 123,
"voting_fee_title": "<string>",
"white_label": true
},
"configuration_hints": {}
}{
"error": "Unauthorized"
}{
"error": "Unprocessable Entity",
"errors": {}
}Polls
Create poll
POST
/
api
/
v1
/
polls
Create poll
curl --request POST \
--url https://pollunit.com/api/v1/polls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"poll": {
"title": "My new poll",
"type": "Polls::Voting",
"additional_attributes": {},
"additional_option_attributes": {},
"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_states": [],
"disable_participant_sign_up": true,
"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,
"indexing": true,
"jury_mode": true,
"limit_per_option": 123,
"notify_new_options": true,
"option_limit": 123,
"options_per_page": 123,
"options_visible_before_voting": true,
"photo_gallery_full_width": true,
"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,
"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,
"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>",
"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,
"voting_fee": 123,
"voting_fee_title": "<string>",
"white_label": true,
"description": "<string>",
"location": "<string>",
"creator_name": "<string>",
"creator_email": "<string>"
}
}
'import requests
url = "https://pollunit.com/api/v1/polls"
payload = { "poll": {
"title": "My new poll",
"type": "Polls::Voting",
"additional_attributes": {},
"additional_option_attributes": {},
"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_states": [],
"disable_participant_sign_up": True,
"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,
"indexing": True,
"jury_mode": True,
"limit_per_option": 123,
"notify_new_options": True,
"option_limit": 123,
"options_per_page": 123,
"options_visible_before_voting": True,
"photo_gallery_full_width": True,
"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,
"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,
"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>",
"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,
"voting_fee": 123,
"voting_fee_title": "<string>",
"white_label": True,
"description": "<string>",
"location": "<string>",
"creator_name": "<string>",
"creator_email": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
poll: {
title: 'My new poll',
type: 'Polls::Voting',
additional_attributes: {},
additional_option_attributes: {},
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_states: [],
disable_participant_sign_up: true,
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,
indexing: true,
jury_mode: true,
limit_per_option: 123,
notify_new_options: true,
option_limit: 123,
options_per_page: 123,
options_visible_before_voting: true,
photo_gallery_full_width: true,
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,
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,
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>',
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,
voting_fee: 123,
voting_fee_title: '<string>',
white_label: true,
description: '<string>',
location: '<string>',
creator_name: '<string>',
creator_email: '<string>'
}
})
};
fetch('https://pollunit.com/api/v1/polls', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'poll' => [
'title' => 'My new poll',
'type' => 'Polls::Voting',
'additional_attributes' => [
],
'additional_option_attributes' => [
],
'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_states' => [
],
'disable_participant_sign_up' => true,
'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,
'indexing' => true,
'jury_mode' => true,
'limit_per_option' => 123,
'notify_new_options' => true,
'option_limit' => 123,
'options_per_page' => 123,
'options_visible_before_voting' => true,
'photo_gallery_full_width' => true,
'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,
'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,
'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>',
'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,
'voting_fee' => 123,
'voting_fee_title' => '<string>',
'white_label' => true,
'description' => '<string>',
'location' => '<string>',
'creator_name' => '<string>',
'creator_email' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pollunit.com/api/v1/polls"
payload := strings.NewReader("{\n \"poll\": {\n \"title\": \"My new poll\",\n \"type\": \"Polls::Voting\",\n \"additional_attributes\": {},\n \"additional_option_attributes\": {},\n \"allow_attachments\": true,\n \"allow_change_sort\": true,\n \"allow_comments\": true,\n \"allow_description\": true,\n \"allow_group_submissions\": true,\n \"allow_info_link\": true,\n \"allow_new_options\": true,\n \"allow_new_rows\": true,\n \"allow_search\": true,\n \"allow_share\": true,\n \"allow_subtitle\": true,\n \"allow_voting\": true,\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"anonymize_voter_names\": true,\n \"custom_hash\": true,\n \"deadline_submission\": \"2023-11-07T05:31:56Z\",\n \"deadline_voting\": \"2023-11-07T05:31:56Z\",\n \"default_states\": [],\n \"disable_participant_sign_up\": true,\n \"file_size_max_mb\": 123,\n \"file_size_min_mb\": 123,\n \"forward_url_parameters\": true,\n \"group_submission_max_entries\": 123,\n \"hidden_author_name\": true,\n \"hidden_best_rating\": true,\n \"hidden_image_name\": true,\n \"hidden_participants\": true,\n \"hide_options\": true,\n \"hide_results\": true,\n \"hide_tags\": true,\n \"hide_votes\": true,\n \"image_min_height\": 123,\n \"image_min_smallest_side_length\": 123,\n \"image_min_width\": 123,\n \"indexing\": true,\n \"jury_mode\": true,\n \"limit_per_option\": 123,\n \"notify_new_options\": true,\n \"option_limit\": 123,\n \"options_per_page\": 123,\n \"options_visible_before_voting\": true,\n \"photo_gallery_full_width\": true,\n \"prevent_vote_for_own_options\": true,\n \"privacy_policy\": \"<string>\",\n \"privacy_policy_for_option_creators\": true,\n \"privacy_policy_for_voters\": true,\n \"private_comments\": true,\n \"public_admin_link\": true,\n \"publisher\": \"<string>\",\n \"publisher_email\": \"<string>\",\n \"publisher_info\": \"<string>\",\n \"randomize_options\": true,\n \"require_approval\": true,\n \"require_author_name\": true,\n \"require_description\": true,\n \"require_voter_name\": true,\n \"restrict_view_access\": true,\n \"restricted_double_opt_in_domains\": \"<array>\",\n \"show_as_list\": true,\n \"show_metadata\": true,\n \"show_photo_info_by_default\": true,\n \"social_media_description\": \"<string>\",\n \"social_media_image_data\": {},\n \"social_media_title\": \"<string>\",\n \"start_date_submission\": \"2023-11-07T05:31:56Z\",\n \"start_date_voting\": \"2023-11-07T05:31:56Z\",\n \"submission_fee\": 123,\n \"submission_fee_title\": \"<string>\",\n \"terms\": \"<string>\",\n \"terms_for_option_creators\": true,\n \"terms_for_voters\": true,\n \"thank_you_page\": true,\n \"thank_you_page_data\": {},\n \"thank_you_page_submitter\": true,\n \"thank_you_page_submitter_data\": {},\n \"timezone\": \"<string>\",\n \"vote_limit_per_option\": 123,\n \"vote_limit_per_option_min\": 123,\n \"vote_limit_per_voter\": 123,\n \"vote_per_day\": true,\n \"voting_fee\": 123,\n \"voting_fee_title\": \"<string>\",\n \"white_label\": true,\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"creator_name\": \"<string>\",\n \"creator_email\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pollunit.com/api/v1/polls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"poll\": {\n \"title\": \"My new poll\",\n \"type\": \"Polls::Voting\",\n \"additional_attributes\": {},\n \"additional_option_attributes\": {},\n \"allow_attachments\": true,\n \"allow_change_sort\": true,\n \"allow_comments\": true,\n \"allow_description\": true,\n \"allow_group_submissions\": true,\n \"allow_info_link\": true,\n \"allow_new_options\": true,\n \"allow_new_rows\": true,\n \"allow_search\": true,\n \"allow_share\": true,\n \"allow_subtitle\": true,\n \"allow_voting\": true,\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"anonymize_voter_names\": true,\n \"custom_hash\": true,\n \"deadline_submission\": \"2023-11-07T05:31:56Z\",\n \"deadline_voting\": \"2023-11-07T05:31:56Z\",\n \"default_states\": [],\n \"disable_participant_sign_up\": true,\n \"file_size_max_mb\": 123,\n \"file_size_min_mb\": 123,\n \"forward_url_parameters\": true,\n \"group_submission_max_entries\": 123,\n \"hidden_author_name\": true,\n \"hidden_best_rating\": true,\n \"hidden_image_name\": true,\n \"hidden_participants\": true,\n \"hide_options\": true,\n \"hide_results\": true,\n \"hide_tags\": true,\n \"hide_votes\": true,\n \"image_min_height\": 123,\n \"image_min_smallest_side_length\": 123,\n \"image_min_width\": 123,\n \"indexing\": true,\n \"jury_mode\": true,\n \"limit_per_option\": 123,\n \"notify_new_options\": true,\n \"option_limit\": 123,\n \"options_per_page\": 123,\n \"options_visible_before_voting\": true,\n \"photo_gallery_full_width\": true,\n \"prevent_vote_for_own_options\": true,\n \"privacy_policy\": \"<string>\",\n \"privacy_policy_for_option_creators\": true,\n \"privacy_policy_for_voters\": true,\n \"private_comments\": true,\n \"public_admin_link\": true,\n \"publisher\": \"<string>\",\n \"publisher_email\": \"<string>\",\n \"publisher_info\": \"<string>\",\n \"randomize_options\": true,\n \"require_approval\": true,\n \"require_author_name\": true,\n \"require_description\": true,\n \"require_voter_name\": true,\n \"restrict_view_access\": true,\n \"restricted_double_opt_in_domains\": \"<array>\",\n \"show_as_list\": true,\n \"show_metadata\": true,\n \"show_photo_info_by_default\": true,\n \"social_media_description\": \"<string>\",\n \"social_media_image_data\": {},\n \"social_media_title\": \"<string>\",\n \"start_date_submission\": \"2023-11-07T05:31:56Z\",\n \"start_date_voting\": \"2023-11-07T05:31:56Z\",\n \"submission_fee\": 123,\n \"submission_fee_title\": \"<string>\",\n \"terms\": \"<string>\",\n \"terms_for_option_creators\": true,\n \"terms_for_voters\": true,\n \"thank_you_page\": true,\n \"thank_you_page_data\": {},\n \"thank_you_page_submitter\": true,\n \"thank_you_page_submitter_data\": {},\n \"timezone\": \"<string>\",\n \"vote_limit_per_option\": 123,\n \"vote_limit_per_option_min\": 123,\n \"vote_limit_per_voter\": 123,\n \"vote_per_day\": true,\n \"voting_fee\": 123,\n \"voting_fee_title\": \"<string>\",\n \"white_label\": true,\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"creator_name\": \"<string>\",\n \"creator_email\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pollunit.com/api/v1/polls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"poll\": {\n \"title\": \"My new poll\",\n \"type\": \"Polls::Voting\",\n \"additional_attributes\": {},\n \"additional_option_attributes\": {},\n \"allow_attachments\": true,\n \"allow_change_sort\": true,\n \"allow_comments\": true,\n \"allow_description\": true,\n \"allow_group_submissions\": true,\n \"allow_info_link\": true,\n \"allow_new_options\": true,\n \"allow_new_rows\": true,\n \"allow_search\": true,\n \"allow_share\": true,\n \"allow_subtitle\": true,\n \"allow_voting\": true,\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"anonymize_voter_names\": true,\n \"custom_hash\": true,\n \"deadline_submission\": \"2023-11-07T05:31:56Z\",\n \"deadline_voting\": \"2023-11-07T05:31:56Z\",\n \"default_states\": [],\n \"disable_participant_sign_up\": true,\n \"file_size_max_mb\": 123,\n \"file_size_min_mb\": 123,\n \"forward_url_parameters\": true,\n \"group_submission_max_entries\": 123,\n \"hidden_author_name\": true,\n \"hidden_best_rating\": true,\n \"hidden_image_name\": true,\n \"hidden_participants\": true,\n \"hide_options\": true,\n \"hide_results\": true,\n \"hide_tags\": true,\n \"hide_votes\": true,\n \"image_min_height\": 123,\n \"image_min_smallest_side_length\": 123,\n \"image_min_width\": 123,\n \"indexing\": true,\n \"jury_mode\": true,\n \"limit_per_option\": 123,\n \"notify_new_options\": true,\n \"option_limit\": 123,\n \"options_per_page\": 123,\n \"options_visible_before_voting\": true,\n \"photo_gallery_full_width\": true,\n \"prevent_vote_for_own_options\": true,\n \"privacy_policy\": \"<string>\",\n \"privacy_policy_for_option_creators\": true,\n \"privacy_policy_for_voters\": true,\n \"private_comments\": true,\n \"public_admin_link\": true,\n \"publisher\": \"<string>\",\n \"publisher_email\": \"<string>\",\n \"publisher_info\": \"<string>\",\n \"randomize_options\": true,\n \"require_approval\": true,\n \"require_author_name\": true,\n \"require_description\": true,\n \"require_voter_name\": true,\n \"restrict_view_access\": true,\n \"restricted_double_opt_in_domains\": \"<array>\",\n \"show_as_list\": true,\n \"show_metadata\": true,\n \"show_photo_info_by_default\": true,\n \"social_media_description\": \"<string>\",\n \"social_media_image_data\": {},\n \"social_media_title\": \"<string>\",\n \"start_date_submission\": \"2023-11-07T05:31:56Z\",\n \"start_date_voting\": \"2023-11-07T05:31:56Z\",\n \"submission_fee\": 123,\n \"submission_fee_title\": \"<string>\",\n \"terms\": \"<string>\",\n \"terms_for_option_creators\": true,\n \"terms_for_voters\": true,\n \"thank_you_page\": true,\n \"thank_you_page_data\": {},\n \"thank_you_page_submitter\": true,\n \"thank_you_page_submitter_data\": {},\n \"timezone\": \"<string>\",\n \"vote_limit_per_option\": 123,\n \"vote_limit_per_option_min\": 123,\n \"vote_limit_per_voter\": 123,\n \"vote_per_day\": true,\n \"voting_fee\": 123,\n \"voting_fee_title\": \"<string>\",\n \"white_label\": true,\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"creator_name\": \"<string>\",\n \"creator_email\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"public_url": "<string>",
"member_hash": "<string>",
"title": "<string>",
"type": "Polls::Voting",
"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": {
"additional_attributes": {},
"additional_option_attributes": {},
"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_states": [],
"disable_participant_sign_up": true,
"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,
"indexing": true,
"jury_mode": true,
"limit_per_option": 123,
"notify_new_options": true,
"option_limit": 123,
"options_per_page": 123,
"options_visible_before_voting": true,
"photo_gallery_full_width": true,
"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,
"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,
"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>",
"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,
"voting_fee": 123,
"voting_fee_title": "<string>",
"white_label": true
},
"configuration_hints": {}
}{
"error": "Unauthorized"
}{
"error": "Unprocessable Entity",
"errors": {}
}Authorizations
Personal API token — find yours under My Account → API.
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.
Body
application/json
Attributes accepted when creating a poll. All settings are passed FLAT under poll (e.g. { "poll": { "title": "...", "allow_comments": true } }) — NOT nested under a settings key, even though the show response groups them under settings for readability.
Show child attributes
Show child attributes
Response
poll created
Public poll identifier (use for read/submit)
Example:
"Polls::Voting"
Available options:
active, closed Admin URL (owner/admin access only)
Admin identifier (only returned to owner)
Show child attributes
Show child attributes
Allowed values for selected configuration fields (owner/admin only)
⌘I