> 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/questionset-apis/read-questionset.md).

# Read QuestionSet

This API is used to read an existing question set on the Sunbird-inQuiry Platform.

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

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

• The <mark style="color:orange;">/questionset/v2/read/{</mark>questionSet\_id<mark style="color:orange;">}</mark> endpoint executes a request for fetching the question to read.\
• This API returns only the metadata of the question set not the hierarchical structure. To read  hierarchical structure please use **read** **questionset hierarchy** API\
• The endpoint for reading QuestionSet is <mark style="color:orange;">`/questionset/v2/read`</mark>\
• It points to inquiry-api-service (assessment service)  - <mark style="color:orange;">/questionset/v5/read</mark>\
• You need to provide a valid QuestionSet Id value in <mark style="color:orange;">{questionSet\_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                                       |
| ------------------------------------------------- | ------ | ------------------------------------------------- |
| questionSet\_id<mark style="color:red;">\*</mark> | String | Append a valid Question Set 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,description,outcomDeclaration... |

#### Headers

| Name          | Type   | Description                                                                                                                                                                                                                                                 |
| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Content-Type  | String | The Content-Type entity is the media type of the resource. Possible media types can be: <mark style="color:green;">Application/json</mark>                                                                                                                  |
| Authorization | 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.<br>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 The "Read Question Set" operation was successfully executed" %}

```javascript
{
    "id": "api.questionset.read",
    "ver": "5.0",
    "ts": "2023-06-29T11:15:59ZZ",
    "params": {
        "resmsgid": "813ea426-92f2-4e5b-b9bf-c19bbd8e2b23",
        "msgid": null,
        "err": null,
        "status": "successful",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "questionset": {
            "code": "sunbird.qs.1",
            "allowSkip": "Yes",
            "containsUserData": "No",
            "qumlVersion": 1.1,
            "language": [
                "English"
            ],
            "mimeType": "application/vnd.sunbird.questionset",
            "showHints": false,
            "createdOn": "2023-06-29T11:15:31.610+0000",
            "objectType": "QuestionSet",
            "scoreCutoffType": "AssessmentLevel",
            "primaryCategory": "Practice Question Set",
            "contentDisposition": "inline",
            "lastUpdatedOn": "2023-06-29T11:15:31.610+0000",
            "contentEncoding": "gzip",
            "generateDIALCodes": "No",
            "showSolutions": false,
            "trackable": {
                "enabled": "No",
                "autoBatch": "No"
            },
            "allowAnonymousAccess": "Yes",
            "identifier": "do_2138284018199265281540",
            "lastStatusChangedOn": "2023-06-29T11:15:31.610+0000",
            "schemaVersion": "1.1",
            "requiresSubmit": "No",
            "visibility": "Default",
            "showTimer": true,
            "consumerId": "6968004d-c67e-434a-a350-773aa1e068a3",
            "setType": "materialised",
            "languageCode": [
                "en"
            ],
            "versionKey": "1688037331610",
            "showFeedback": false,
            "license": "CC BY 4.0",
            "createdBy": "sunbird-user-1",
            "compatibilityLevel": 6,
            "name": "QuestionSet-FT-1",
            "navigationMode": "non-linear",
            "allowBranching": "No",
            "shuffle": true,
            "status": "Draft"
        }
    }
}
```

{% endtab %}

{% tab title="404: Not Found The Read Question Set operation failed! The possible reason for failure is that you may have provided wrong question set ID." %}

```javascript
{
  "id": "api.questionset.read",
  "ver": "5.0",
  "ts": "2023-06-29T11:15:59ZZ",
  "params": {
    "resmsgid": "815b341a-7984-45a1-b1f9-4335da18985e",
    "msgid": null,
    "err": "NOT_FOUND",
    "status": "failed",
    "errmsg": "Error! Node(s) does not exist. | [Invalid Node Id.]: do_1132083238015549441201"
  },
  "responseCode": "RESOURCE_NOT_FOUND",
  "result": {
    "messages": null
  }
}
```

{% endtab %}

{% tab title="500: Internal Server Error Looks like something went wrong! These errors are tracked automatically" %}

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

{% endtab %}
{% endtabs %}

#### Success response schema

<table><thead><tr><th width="223">Attribute</th><th width="121.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>identifier</td><td>String</td><td>Unique Question set Identifier</td></tr><tr><td>name</td><td>String</td><td>Name of the Question set</td></tr><tr><td>versionKey</td><td>String</td><td>Unique version key of Question set</td></tr><tr><td>code</td><td>String</td><td>Unique Code for Question set</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 set Visibility eg. parent or default</td></tr><tr><td>mimeType</td><td>String</td><td>Question mimeType eg. application/vnd.sunbird.questionset</td></tr><tr><td>createdOn</td><td>String</td><td>Time of question set creation</td></tr><tr><td>objectType</td><td>String</td><td>QuestionSet objectType</td></tr><tr><td>primaryCategory</td><td>String</td><td>Eg - <code>Practice Question set</code> or <code>Exam Question set</code></td></tr><tr><td>status</td><td>String</td><td>Question status <code>Draft/Review/Live</code></td></tr><tr><td>lastUpdatedOn</td><td>String</td><td>Last updated time</td></tr></tbody></table>

#### cURL

**Sample CURL to read all metadata**

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

**Sample CURL to read all metadata**

```
curl --location -g --request GET '{{host}}/questionset/v2/read/{{questionSet_id}}?fields=name,description' \
--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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
