API reference

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:

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

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.

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.

  • 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.

  • 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.

  • 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.

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.

Set to false to hide the poll result.

"resultsBeforeClosed": true

undoAllowed

true

Optional

Indicate if users can change their vote.

Set to false to keep the vote as-is.

"undoAllowed": true

multipleChoice

false

Optional

Indicate if users can select multiple choices.

Set to true to allow users to make multiple choices.

"multipleChoice": false

optionsExtendable

false

Optional

Indicate if users can add custom choices.

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).

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

Parameter

Default value

Required?

Description

Example

percentsVisible

true

Optional

Indicate if poll votes is to be displayed in percentages.

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.

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":

[
{ "stringValue": "choice1" },
{ "stringValue": "choice2" }
]

Parameters specific to event polls

Parameters relevant to event polls are as follows:

Parameter [Attributes]

Default value

Required?

Description

Example

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).

  • dateValue is mandatory whereas stringValue is optional.

  • Date format used must be yyyy-MM-dd.

"options":

[

{"dateValue":"2022-03-19", "stringValue": "1"},

{"dateValue":"2022-03-19", "stringValue": "2"}

]

Â