Confluence Questions REST ResourcesPUBLIC SINCE 2.3

by Atlassian for Confluence Server 5.3+

QuestionResource

The following resources are applicable:

/question

Mount Point: /rest/questions/1.0/question

POST

Ask a question

Request Body

element: questionJson
media types: application/json

a JSON representation of the question input

Response Body

element: questionDTO
media types: application/json

a JSON representation of the new question

GET

Get a list of questions

Parameters

name description type default
limit the number of questions needed (required) query
start the start index (0 by default) query 0
topicId ID of the topic query -1
spaceKey The optional space key (if the questions belong to a specific space) query
filter The optional filter string which value is one of "unanswered", "popular", "my", "recent" (default value) query recent
username the username of the user asking the questions (or the current user if this parameter is not provided) query

Response Body

element: (custom)
media types: application/json

a JSON array representation of the questions

/question/{questionId}

Mount Point: /rest/questions/1.0/question/{questionId}

GET

Get a question by its ID

Parameters

name description type default
questionId the question's ID path

Response Body

element: questionDTO
media types: application/json

a JSON representation of the question or 404 NOT FOUND if the question is not found

DELETE

Delete a question by ID

Parameters

name description type default
questionId the ID of the question to be deleted path

Response Body

element: (custom)
media types: application/json

200 OK on success or 404 NOT FOUND if the question is not found

/question/{questionId}/answerDrafts

Mount Point: /rest/questions/1.0/question/{questionId}/answerDrafts

POST

Create an answer draft for a question

Parameters

name description type default
questionId ID of the question path

Response Body

element: answerDTO
media types: application/json

a JSON representation of the answer draft or 500 INTERNAL SERVER ERROR if the answer draft cannot be created.

/question/{questionId}/answers

Mount Point: /rest/questions/1.0/question/{questionId}/answers

POST

Add an answer for a question

Parameters

name description type default
questionId ID of the question path

Request Body

element: answerJson
media types: application/json

a JSON representation of the answer input

Response Body

element: answerDTO
media types: application/json

a JSON representation of the new answer or 400 BAD REQUEST if the answer is invalid or 404 NOT FOUND if the question is not found

GET

Get list of answers of a question

Parameters

name description type default
questionId ID of the question path
limit the number of answers needed (10 by default) query 10
start the start index (0 by default) query 0

Response Body

element: detailedAnswerDTO
media types: application/json

a JSON representation of the list answers

/question/{questionId}/answers/{answerId}

Mount Point: /rest/questions/1.0/question/{questionId}/answers/{answerId}

DELETE

Delete an answer of a question

Parameters

name description type default
questionId ID of the question path
answerId ID of the answer path

Response Body

element: (custom)
media types: application/json

200 OK on success or 404 NOT FOUND if the answer is not found

/question/{questionId}/answers/{answerId}/accept

Mount Point: /rest/questions/1.0/question/{questionId}/answers/{answerId}/accept

POST

Accept an answer of a question

Parameters

name description type default
questionId ID of the question path
answerId ID of the answer path

Response Body

element: answerDTO
media types: application/json

a JSON representation of the accepted answer

DELETE

Unaccept an answer of a question

Parameters

name description type default
questionId (no documentation provided) path
answerId (no documentation provided) path

Response Body

element: answerDTO
media types: application/json

a JSON representation of the unaccepted answer

/question/{questionId}/answers/{answerId}/comments

Mount Point: /rest/questions/1.0/question/{questionId}/answers/{answerId}/comments

POST

Add a comment to an answer

Parameters

name description type default
questionId ID of the question path
answerId ID of the answer path

Request Body

element: commentJson
media types: application/json

a JSON representation of the comment input

Response Body

element: commentDTO
media types: application/json

a JSON representation of the new comment

/question/{questionId}/answers/{answerId}/convert

Mount Point: /rest/questions/1.0/question/{questionId}/answers/{answerId}/convert

POST

Convert an answer to a comment

Parameters

name description type default
questionId ID of the question path
answerId ID of the answer path
targetId ID of the target question/answer query

Response Body

element: commentDTO
media types: application/json

a JSON representation of the comment converted from the answer or 404 NOT FOUND if the answer is not found or 400 BAD REQUEST if the answer cannot be converted

/question/{questionId}/comments

Mount Point: /rest/questions/1.0/question/{questionId}/comments

POST

Add a comment to a question

Parameters

name description type default
questionId ID of the question path

Request Body

element: commentJson
media types: application/json

a JSON representation of the new comment input

Response Body

element: commentDTO
media types: application/json

a JSON representation of the added comment

/question/{questionId}/comments/{commentId}

Mount Point: /rest/questions/1.0/question/{questionId}/comments/{commentId}

DELETE

Delete a comment of a question

Parameters

name description type default
questionId ID of the question path
commentId ID of the comment path

Response Body

element: (custom)
media types: application/json

200 OK on success or 404 NOT FOUND if the comment is not found

/question/{questionId}/comments/{commentId}/convert

Mount Point: /rest/questions/1.0/question/{questionId}/comments/{commentId}/convert

POST

Convert a comment to an answer

Parameters

name description type default
questionId ID of the question path
commentId ID of the comment path

Response Body

element: answerDTO
media types: application/json

a JSON representation of the answer or 404 NOT FOUND if the comment is not found

/question/{questionId}/topics

Mount Point: /rest/questions/1.0/question/{questionId}/topics

PUT

Update the topics of a question

Parameters

name description type default
questionId (no documentation provided) path

Request Body

element: inlineEditTopicListJson
media types: application/json

(no documentation provided)

Response Body

element: (custom)
media types: application/json

200 OK on success or 404 NOT FOUND if the question is not found or 400 BAD REQUEST on failure

/question/{questionId}/topicSuggestions

Mount Point: /rest/questions/1.0/question/{questionId}/topicSuggestions

GET

Get topic suggestions for a question

Parameters

name description type default
questionId the question's ID path

Response Body

element: questionDTO
media types: application/json

a JSON representation of the suggestions or 404 NOT FOUND if the question or topic suggestion is not found

/question/{questionId}/vote

Mount Point: /rest/questions/1.0/question/{questionId}/vote

GET

Get the vote summary of a question

Parameters

name description type default
questionId ID of the question path

Response Body

element: votesDTO
media types: application/json

a JSON representation of the votes of a question

/question/{questionId}/vote/{type}

Mount Point: /rest/questions/1.0/question/{questionId}/vote/{type}

POST

Vote a question

Parameters

name description type default
questionId the ID of the question path
type the type of a vote. Possible values are: "none", "up", "down" path

Response Body

element: votesDTO
media types: application/json

a JSON representation of the new votes on success. Otherwise, 400 BAD REQUEST if the vote type is invalid or the question is not found

DELETE

Remove vote from a question

Parameters

name description type default
questionId ID of the question path
type type of the vote. Possible values are: "none", "up", "down" path

Response Body

element: votesDTO
media types: application/json

a JSON representation of the removed vote

/question/{questionId}/watch

Mount Point: /rest/questions/1.0/question/{questionId}/watch

POST

Watch a question

Parameters

name description type default
questionId ID of the question path

Response Body

element: questionDTO
media types: application/json

a JSON representation of the watched question or 404 NOT FOUND error if the question is not found

DELETE

Unwatch a question

Parameters

name description type default
questionId ID of the question path

Response Body

element: questionDTO
media types: application/json

a JSON representation of the unwatched question or 404 NOT FOUND error if the question is not found

/question/{questionId}/watch/{userKey}

Mount Point: /rest/questions/1.0/question/{questionId}/watch/{userKey}

GET

Check if a user is watching a question

Parameters

name description type default
questionId ID of the question path
userKey the user key (not username) path

Response Body

element: (custom)
media types: application/json

a JSON map which contains: an entry for "userKey", and another entry "watching" to indicate if the user is watching the question

/question/count

Mount Point: /rest/questions/1.0/question/count

GET

Get the total number of questions for a topic or a space

Parameters

name description type default
topicId an optional topic ID query -1
spaceKey an optional space key (ignored if a topic ID is provided) query

Response Body

element: (custom)
media types: application/json

the total number of questions for a topic or a space or 0 if no topic or space is specified

/question/related/{questionId}/{topic}

Mount Point: /rest/questions/1.0/question/related/{questionId}/{topic}

GET

Get a list of related questions for a question

Parameters

name description type default
questionId the ID of the question path
topic the topic name path

Response Body

element: (custom)
media types: application/json

a JSON array representation of the questions

/question/watch

Mount Point: /rest/questions/1.0/question/watch

POST

Wach global questions

Response Body

element: (custom)
media types: application/json

200 OK on success

DELETE

Unwatch global questions

Response Body

element: (custom)
media types: application/json

200 OK on success

/question/watch/{userKey}

Mount Point: /rest/questions/1.0/question/watch/{userKey}

GET

Check if a user is watching global questions

Parameters

name description type default
userKey the user key path

Response Body

element: (custom)
media types: application/json

a JSON map containing 2 entries: "userKey" and "watching" (that indicates if the user is watching the global section) or 400 BAD REQUEST if the user is not found.