Overview
The Poll API on the server side allows you to create, manage, and participate in polls and quizzes. Polls are an effective way to gather opinions, feedback, and insights from a group of people in a quick and convenient manner. With the Polls APIs you can create polls and gather information about polls sessions, results and responses.
This feature can also be used to create quizzes. Under the hood, quizzes are like polls where questions have right or wrong answers.
This document provides guidance on how to use the Poll APIs to create a poll, update polls, fetch results, responses and sessions.
Polls and quizzes can be created/updated using these APIs. A recommended way to create a poll is to provide a list of questions while creating poll, then update those questions by modifying them using update question/delete question or update/delete options API.
To fetch results/responses use get results/result and response/responses APIs.
To enable auto start of polls and to import/link polls in a room, use rooms update/create API with polls field.
Understand polls object
Name | Type | Description | Required |
---|---|---|---|
id | string | id for polls. Created after polls object is created. | NA |
title | string | title for poll. | No |
duration | int | number of second for which poll is active after start, 0 means poll can only be stopped by command or session end | No |
anonymous | bool | poll is anonymous, peer id or user id is not stored, default: false | No |
mode | string | polling mode, userid, peerid, default: userid | No |
type | string | type = quiz or poll, default=poll. | No |
start | string | auto, manual, default=auto | No |
questions | array | array of questions | No |
question object
Name | Type | Description | Required |
---|---|---|---|
index | int | unique index of question | No |
text | string | Publish parameters for this role. Object of type publishParams with the collection of objects such as allowed , audio , video , screen , etc | No |
format | string | text format, default text | No |
attachment | array | list of URLs for attachment | No |
skippable | bool | true if question can be skipped, default: true | No |
duration | int | number of seconds for which this question will be shown | No |
once | bool | if true the response can not be updated, default: false | No |
weight | int | weight for the question, default: 1 | No |
answer_min_len | int | minimum length for short/long answers | No |
answer_max_len | int | maximum length for short/long answers | No |
answer | object | answer object | No |
options | array | options object | No |
answer object
Name | Type | Description | Required |
---|---|---|---|
hidden | bool | if true answer will not be returned when poll is running | No |
options | array | list of options that should be in answer | No |
text | string | answer text for answer. | No |
case | bool | if false case is ignored when comparing. | No |
trim | bool | if true, empty space is trimmed from start and end of answer. | No |
option object
Name | Type | Description | Required |
---|---|---|---|
index | int | unique index for option | No |
text | string | option index | No |
weight | int | weight for the option | No |
Postman collection
You can use our Postman collection to start exploring 100ms APIs.
Refer to the Postman guide to get started with 100ms API collection.