Retrieve Question Information

You can use this API request to retrieve detailed information about a question posted to your AnswerHub site.

/services/v2/question/[questionId].json

You can use the following parameters in your retrieve question information request:

Projection: include, exclude, includeOnly
Other options: wrap, v1

🚧

Permissions & Notes:

  • You must have the View the question page permission under Anonymous Roles in the Advanced Editor.

  • With the includeOnly parameter set to id and name (/services/v2/question.json?includeOnly=id,name) to the AnswerHub REST API.

  • We added this request in version 1.6.3.

Sample Request

A GET retrieve question information request for a question (questionId: 4) sent to https://apidocs.cloud.answerhub.com using a human-readable Username/Password (answerhub/test123) would look like this:

curl 
-u answerhub:test123 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X GET "https://apidocs.cloud.answerhub.com/services/v2/question/4.json"

Sample Response

Successful Response:

  • HTTP Status 200 - OK
{
    "id": 4,
    "type": "question",
    "creationDate": 1545231735000,
    "creationDateFormatted": "12/19/2018 03:02 PM",
    "title": "Where is the safest place to stand outside in a thunderstorm?",
    "body": "",
    "bodyAsHTML": "",
    "author": {
        "id": 22,
        "username": "confused",
        "realname": "Confused User",
        "reputation": 0
    },
    "lastEditedAction": 29,
    "activeRevisionId": 4,
    "revisionIds": [
        4
    ],
    "lastActiveUserId": 22,
    "lastActiveDate": 1545231735000,
    "attachments": [],
    "childrenIds": [
        5
    ],
    "commentIds": [],
    "marked": false,
    "topics": [
        {
            "id": 1,
            "creationDate": 1545231736000,
            "creationDateFormatted": "12/19/2018 03:02 PM",
            "name": "science",
            "author": {
                "id": 22,
                "username": "confused",
                "realname": "Confused User",
                "reputation": 0
            },
            "usedCount": 36,
            "getImmediateChildren": [],
            "getParents": []
        },
        {
            "id": 2,
            "creationDate": 1545231736000,
            "creationDateFormatted": "12/19/2018 03:02 PM",
            "name": "weather",
            "author": {
                "id": 22,
                "username": "confused",
                "realname": "Confused User",
                "reputation": 0
            },
            "usedCount": 7,
            "getImmediateChildren": [],
            "getParents": []
        },
        {
            "id": 3,
            "creationDate": 1545231736000,
            "creationDateFormatted": "12/19/2018 03:02 PM",
            "name": "storm",
            "author": {
                "id": 22,
                "username": "confused",
                "realname": "Confused User",
                "reputation": 0
            },
            "usedCount": 3,
            "getImmediateChildren": [],
            "getParents": []
        }
    ],
    "primaryContainerId": 11,
    "containerIds": [
        7,
        11
    ],
    "slug": "where-is-the-safest-place-to-stand-outside-in-a-th",
    "wiki": false,
    "score": 0,
    "depth": 0,
    "viewCount": 3,
    "upVoteCount": 0,
    "downVoteCount": 0,
    "nodeStates": [],
    "answers": [
        5
    ],
    "answerCount": 1
}
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!