> For the complete documentation index, see [llms.txt](https://inquiry.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-service/apis/v2/question-apis/read-question.md).

# Read Question

## This API is used to read the question on the Sunbird-inQuiry Platform.

<mark style="color:blue;">`GET`</mark> `/question/v2/read/{question_id}`

• It points to inquiry-api-service (assessment service)  - <mark style="color:orange;">`/question/v5/read`</mark>\
• You need to provide a valid Question Id value in <mark style="color:orange;">{question\_id}</mark> field of the API URL.\
• It is mandatory to provide values for parameters marked with <mark style="color:red;">\*</mark>.\
• Mandatory fields cannot be null or empty.

#### Path Parameters

| Name                                           | Type   | Description                                   |
| ---------------------------------------------- | ------ | --------------------------------------------- |
| question\_id<mark style="color:red;">\*</mark> | String | Append a valid Question ID To the Request URL |

#### Query Parameters

| Name                                  | Type   | Description                                                                                   |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| mode=edit                             | String | To fetch the latest version of node from the database for edit purpose                        |
| fields=comma separated metadata names | String | To fetch the specific fields, this query parameter can be used eg. fields=name,body,answer... |

#### Headers

| Name                                            | Type   | Description                                                                                                                                                                                                                                                     |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Content-Type                                    | String | The Content-Type entity is the media type of the resource. It should be <mark style="color:green;">Application/json</mark>                                                                                                                                      |
| Authorization<mark style="color:red;">\*</mark> | String | <p>To make use of the API, you require authorization. Raise a request to the administrator, for the use of the API. You will receive the authorization key. Specify the key received, here.</p><p>Set <mark style="color:green;">Bearer {{api\_key}}</mark></p> |
| x-channel-id                                    | String | Unique identification number associated with a root organization.                                                                                                                                                                                               |

{% tabs %}
{% tab title="200: OK Successful operation" %}
{% code overflow="wrap" %}

```javascript
{
    "id": "api.question.read",
    "ver": "5.0",
    "ts": "2023-06-29T03:49:09ZZ",
    "params": {
        "resmsgid": "8b56f8d3-4bba-4040-903d-1d8cbd01658a",
        "msgid": null,
        "err": null,
        "status": "successful",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "question": {
            "copyright": "NIT123",
            "code": "ad6f06e4-1a36-47c2-964a-91c249191e4b",
            "subject": [
                "Math"
            ],
            "qumlVersion": 1.1,
            "channel": "01309282781705830427",
            "language": [
                "English"
            ],
            "medium": [
                "English"
            ],
            "mimeType": "application/vnd.sunbird.question",
            "showHints": false,
            "templateId": "mcq-vertical",
            "createdOn": "2023-06-29T03:45:06.917+0000",
            "objectType": "Question",
            "gradeLevel": [
                "Class 1"
            ],
            "primaryCategory": "Multiple Choice Question",
            "contentDisposition": "inline",
            "lastUpdatedOn": "2023-06-29T03:45:07.002+0000",
            "contentEncoding": "gzip",
            "showSolutions": false,
            "allowAnonymousAccess": "Yes",
            "identifier": "do_2138281804342640641518",
            "lastStatusChangedOn": "2023-06-29T03:45:06.917+0000",
            "audience": [
                "Student"
            ],
            "schemaVersion": "1.1",
            "visibility": "Parent",
            "showTimer": false,
            "author": "Creator1",
            "qType": "MCQ",
            "maxScore": 1,
            "languageCode": [
                "en"
            ],
            "versionKey": "1688010307002",
            "showFeedback": false,
            "license": "CC BY 4.0",
            "complexityLevel": [
                "evaluate"
            ],
            "interactionTypes": [
                "choice"
            ],
            "framework": "inquiry_k-12",
            "createdBy": "5a587cc1-e018-4859-a0a8-e842650b9d64",
            "compatibilityLevel": 5,
            "name": "MCQ-1",
            "board": "CBSE",
            "status": "Draft"
        }
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found Resource not found" %}

```javascript
{
    "id": "api.question.read",
    "ver": "5.0",
    "ts": "2023-06-29T03:50:10ZZ",
    "params": {
        "resmsgid": "fd2271fc-6a7d-493d-a2ee-9cdcd20492e4",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213828180434264064151"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error Looks like something went wrong" %}

```javascript
{
  "id": "api.question.read",
  "ver": "5.0",
  "ts": "2023-06-29T03:50:10ZZ",
  "params": {
    "resmsgid": "f234a6f0-3ac4-11eb-b0a2-8d5c9f561887",
    "msgid": null,
    "status": "failed",
    "err": null,
    "errmsg": null
  },
  "responseCode": "SERVER_ERROR",
  "result": {}
}
```

{% endtab %}
{% endtabs %}

#### Success Result Schema

<table><thead><tr><th width="232">Attribute</th><th width="109.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>identifier</td><td>string</td><td>Unique Question Identifier</td></tr><tr><td>name</td><td>string</td><td>Question name</td></tr><tr><td>versionKey</td><td>string</td><td>Question versionKey</td></tr><tr><td>code</td><td>string</td><td>Unique Question code</td></tr><tr><td>lastStatusChangedOn</td><td>string</td><td>Last status changed time</td></tr><tr><td>visibility</td><td>string</td><td>Question visibility eg. parent</td></tr><tr><td>mimeType</td><td>string</td><td>Question mimeType eg. application/vnd.sunbird.question</td></tr><tr><td>createdOn</td><td>string</td><td>Question createdOn Time</td></tr><tr><td>objectType</td><td>string</td><td>Question objectType</td></tr><tr><td>primaryCategory</td><td>string</td><td>Type of question (Multiple Choice Question or Subjective Question)</td></tr><tr><td>lastUpdatedOn</td><td>string</td><td>Question lastUpdatedOn</td></tr><tr><td>status</td><td>string</td><td>Question status Draft/Review/Live</td></tr></tbody></table>

#### cURL

**sample curl to read the metadata**

```shell
curl --location -g --request GET '{{host}}/question/v2/read/{{question_id}}' \
--header 'Authorization: Bearer {{api_key}}
```

**Sample curl to read specific metadata**

```
curl --location -g --request GET '{{host}}/question/v2/read/{{question_id}}?fields=name,body,responseDeclaration,outcomeDeclaration' \
--header 'Authorization: Bearer {{api_key}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-service/apis/v2/question-apis/read-question.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
