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