REST API
Use the Team Voice REST API to get, create, update, and delete polls on Jira work items and Confluence pages.
The REST API is still in beta and is subject to change. 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 (work items in Jira and pages in Confluence).
Requestβ
Query parameters
token(required): Your access tokentype(required):pollsfor getting pollsworkspace(required): Space key in Jira and space ID in Confluencecontent(required): Work item key in Jira and page ID in Confluencecontainer(required for Confluence only): Empty in Jira and macro ID in Confluenceexpand(optional): Use the valueresultsto retrieve polls that include calculated results.
Example for Jira version:
The REST endpoint URL and access token are unique to your instance. Copy them from the Team Voice settings page after generating an access token.
https://<your-app-id>.hello.atlassian-dev.net/x1/<your-endpoint>?token=<your-access-token>&type=polls&workspace=PLAT&content=PLAT-254604
where:
- 'https://<your-app-id>.hello.atlassian-dev.net/x1/<your-endpoint>' = REST endpoint (copied from Team Voice settings)
- token = <your-access-token>
- type = polls
- workspace = PLAT (your Jira space key)
- content = PLAT-254604 (your Jira work item key)
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.tokenis not provided or is not valid404Not found. IfpollIdis 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):pollsfor creating new pollworkspace(required): Space key in Jira and space ID in Confluencecontent(required): Work item key in 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.tokenis not provided or not valid
PUT Update pollβ
Update an existing poll in defined content.
Requestβ
Query parameters
token(required): Your access tokentype(required):pollsfor updating an existing pollworkspace(required): Space key in Jira and space ID in Confluencecontent(required): Work item key in 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.tokenis not provided or not valid
DELETE Delete pollβ
Delete an existing poll in defined content.
Requestβ
Query parameters
token(required): Your access tokentype(required):pollsfor deleting an existing pollworkspace(required): Space key in Jira and space ID in Confluencecontent(required): Work item key in 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.tokenis not provided or not valid404Not found.pollIdis not found