REST API
warning
The REST API is still in beta and is subject to change.
warning
! The request structure was updated on November 28, 2024, due to significant storage changes.
Before using the REST API to access polls, please configure the access token.
GET Get polls for content
Get polls related to content (issues in Jira and pages in Confluence).
Request
Query parameters
token(required): Your access tokentype(required): 'polls' for getting pollsworkspace(required): Project key in Jira and Space id in Confluencecontent(required): Issue key for Jira and page id in Confluencecontainer(required for Confluence only): Empty in Jira and macro id in Confluenceexpand(optional): Use the value 'results' to retrieve polls that include calculated results.
Example for Jira version:
https://1d609651-8def-4d6b-aadc-d4e843273d1d.hello.atlassian-dev.net/x1/xs2i4ODeo611kO2x4adU6sCYcqM?token=f991ebe3-2d93-4fd9-b8ee-4a1725c9f337&type=polls&workspace=PLAT&content=PLAT-254604
where:
- 'https://1d609651-8def-4d6b-aadc-d4e843273d1d.hello.atlassian-dev.net/x1/xs2i4ODeo611kO2x4adU6sCYcqM' = REST endpoint
- token = f991ebe3-2d93-4fd9-b8ee-4a1725c9f337
- type = polls
- workspace = PLAT
- content = PLAT-254604
Responses
200OK, application/json, Body: Poll[]
Response example
[
{
"settings": {
"allowSelectionOfMultipleOptions": false,
"resultsVisibility": "alwaysPublic",
"endDate": "",
"hideAbsoluteNumbers": false,
"allowRevote": false,
"saveParticipantNames": false,
"closePollOnEndDate": false,
"allowComment": false
},
"options": [
{
"id": "1",
"title": "⭐",
"order": 0
},
{
"id": "2",
"title": "⭐⭐",
"order": 1
},
{
"id": "3",
"title": "⭐⭐⭐",
"order": 2
},
{
"id": "4",
"title": "⭐⭐⭐⭐",
"order": 3
},
{
"id": "5",
"title": "⭐⭐⭐⭐⭐",
"order": 4
}
],
"description": "Simple scoring from 1 to 5 stars",
"id": "ee9107b5-5041-4c15-8c76-f14404fa1fad",
"title": "Stars from ⭐ to ⭐⭐⭐⭐⭐"
}
]
400Bad request. Required field is not defined in query parameters403Not permitted. 'token' is not provided or is not valid404Not found. If 'pollId' is defined, but a poll with this ID is not found
POST Create poll for content
Creates a new poll for defined content.
Request
Query parameters
token(required): Your access tokentype(required): 'polls' for creating new pollworkspace(required): Project key in Jira and Space id in Confluencecontent(required): Issue key for Jira and page id in Confluencecontainer(required for Confluence only): Empty in Jira and macro id in Confluence
Body
Poll
Poll object example
{
"settings": {
"allowSelectionOfMultipleOptions": false,
"resultsVisibility": "alwaysPublic",
"endDate": "",
"hideAbsoluteNumbers": false,
"allowRevote": false,
"saveParticipantNames": false,
"closePollOnEndDate": false,
"allowComment": false
},
"options": [
{
"id": "1",
"title": "⭐",
"order": 0
},
{
"id": "2",
"title": "⭐⭐",
"order": 1
},
{
"id": "3",
"title": "⭐⭐⭐",
"order": 2
},
{
"id": "4",
"title": "⭐⭐⭐⭐",
"order": 3
},
{
"id": "5",
"title": "⭐⭐⭐⭐⭐",
"order": 4
}
],
"description": "Simple scoring from 1 to 5 stars",
"title": "Stars from ⭐ to ⭐⭐⭐⭐⭐"
}
Responses
200OK, application/json, Body: Poll400Bad request. Required field is not defined in query parameters403Not permitted. 'token' is not provided or not valid
PUT Update poll
Update an existing poll in defined content.
Request
Query parameters
token(required): Your access tokentype(required): 'polls' for updating an existing pollworkspace(required): Project key in Jira and Space id in Confluencecontent(required): Issue key for Jira and page id in Confluencecontainer(required for Confluence only): Empty in Jira and macro id in ConfluencepollId(required): Exact poll ID
Body
Poll
Poll object example
{
"settings": {
"allowSelectionOfMultipleOptions": false,
"resultsVisibility": "alwaysPublic",
"endDate": "",
"hideAbsoluteNumbers": false,
"allowRevote": false,
"saveParticipantNames": false,
"closePollOnEndDate": false,
"allowComment": false
},
"options": [
{
"id": "1",
"title": "⭐",
"order": 0
},
{
"id": "2",
"title": "⭐⭐",
"order": 1
},
{
"id": "3",
"title": "⭐⭐⭐",
"order": 2
},
{
"id": "4",
"title": "⭐⭐⭐⭐",
"order": 3
},
{
"id": "5",
"title": "⭐⭐⭐⭐⭐",
"order": 4
}
],
"description": "Simple scoring from 1 to 5 stars",
"title": "Stars from ⭐ to ⭐⭐⭐⭐⭐",
"id": "ee9107b5-5041-4c15-8c76-f14404fa1fad"
}
Responses
200OK, application/json, Body: Poll400Bad request. Required field is not defined in query parameters403Not permitted. 'token' is not provided or not valid
DELETE Delete poll
Delete an existing poll in defined content.
Request
Query parameters
token(required): Your access tokentype(required): 'polls' for deleting an existing pollworkspace(required): Project key in Jira and Space id in Confluencecontent(required): Issue key for Jira and page id in Confluencecontainer(required for Confluence only): Empty in Jira and macro id in ConfluencepollId(required): Exact poll ID
Responses
200OK400Bad request. Required field is not defined in query parameters for Jira version403Not permitted. 'token' is not provided or not valid404Not found. 'pollId' is not found