---
title: "API reference"
canonical: "https://support.appfire.com/space/POLL/151847209/API%20reference"
format: markdown
---
> Macro (aura-html)

> ⚠️ This API reference is applicable only for the server version of the *Polls for Confluence* app.

Click any of the following API methods to know more:

> Macro (children)

Note that the authentication method used is basic authentication for all the operations.

# Points to remember

- You can create a poll even if you provide the mandatory parameters only. The default values for the optional parameters, if any, are then used.
- By default, a choice poll is created unless the *datePoll* parameter is set as *true* to create an event poll.

# Common parameters

Parameters used for both choice and event polls are listed below:

| **Name** | **Default value** | **Required?** | **Description** | **Example** |
| --- | --- | --- | --- | --- |
| *name* |  | **Mandatory** | Name for the poll. | `"name": "Choice poll - What product do you like best?"` |
| *description* |  | Optional | Description about the poll. | `"description": "Choose the product you like most"` |
| *enddate* |  | Optional | End date; till when the poll is available.This should be always greater than current date.<br>Format to be used: **yyyy-MM-dd** | `"enddate": "2022-04-17"` |
| *datePoll* | *false* | Optional | Indicate if this is a choice poll or an event poll.<br>- Set to *false* for a choice poll or *true* for an event poll.
- If not given, a choice poll is created. | `"datePoll": false` |
| *nonUserVotesAllowed* | *false* | Optional | Indicate if unregistered users are allowed to vote.<br>- Set to *true* if unregistered users can vote.
- Once enabled, this setting cannot be changed. | `"nonUserVotesAllowed": false` |
| *pollAnonymous* | *false* | Optional | Indicate if users can vote anonymously.<br>- Set to *true* if users can vote anonymously.
- Once enabled, this setting cannot be changed. | `"pollAnonymous": true` |
| *votersVisible* | *true* | Optional | Indicate if the names of the voters can be displayed.<br>Set to *false* to hide the voter names. | `"votersVisible": true` |
| *resultsBeforeClosed* | *true* | Optional | Indicate if the result can be displayed before the poll is closed.<br>Set to *false* to hide the poll result. | `"resultsBeforeClosed": true` |
| *undoAllowed* | *true* | Optional | Indicate if users can change their vote.<br>Set to *false* to keep the vote as-is. | `"undoAllowed": true` |
| *multipleChoice* | *false* | Optional | Indicate if users can select multiple choices.<br>Set to *true* to allow users to make multiple choices. | `"multipleChoice": false` |
| *optionsExtendable* | *false* | Optional | Indicate if users can add custom choices.<br>Set to *true* to allow users to create their own choice option. | `"optionsExtendable": false` |
| *tinyUrlEnabled* | *false* | Optional | Indicate if a tiny URL for the poll is to be generated (usually to be sent in mails).<br>Set to *true* to create a tiny URL for the poll. | `"tinyUrlEnabled": false` |

# Parameters specific to choice polls

Parameters specific to choice polls are as follows:

| **Parameter** | **Default value** | **Required?** | **Description** | **Example** |
| --- | --- | --- | --- | --- |
| *percentsVisible* | *true* | Optional | Indicate if poll votes is to be displayed in percentages.<br>Set to *false* to hide the percent values. | `"percentsVisible": true` |
| *voteCountVisible* | *true* | Optional | Indicate if the vote counts per option is to be displayed for the poll.<br>Set to *false* to hide the counts. | `"voteCountVisible": true` |
| *options*, *stringValue* |  | **Mandatory** | Provide an array of values (choices) using the *stringValue* attribute. At least two choices must be given for a choice poll. | `"options": `<br>`[`  
`{ "stringValue": "choice1" },`  
`{ "stringValue": "choice2" }`  
`]` |

# Parameters specific to event polls

Parameters relevant to event polls are as follows:

| **Parameter [Attributes]** | **Default value** | **Required?** | **Description** | **Example** |
| --- | --- | --- | --- | --- |
| *options*, *dateValue*, *stringValue* |  | **Mandatory** | Provide an array of dates (*dateValue*) and the time representation for each date (*stringValue*).<br>- *dateValue *is mandatory whereas *stringValue* is optional.
- Date format used must be **yyyy-MM-dd**. | `"options": `<br>`[`<br>`{"dateValue":"2022-03-19", "stringValue": "1"}`,<br>`{"dateValue":"2022-03-19", "stringValue": "2"}`<br>`]` |