# Retire QuestionSet

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

<mark style="color:red;">`DELETE`</mark> `/retire/{QuestionSet_Id}`

• The <mark style="color:orange;">/retire/{QuestionSet\_Id}</mark> endpoint executes a "Retire QuestionSet" request based on <mark style="color:orange;">QuestionSet\_Id</mark> to delete the specific Question set.\
• The endpoint for Retire QuestionSet is <mark style="color:orange;">/questionset/v1/retire</mark> \
•  It points to inquiry-api-service (assessment service) - <mark style="color:orange;">/questionset/v4/retire</mark> \
• It is mandatory to provide values for parameters. \
• Mandatory fields cannot be null or empty.

#### Path Parameters

| Name                                              | Type   | Description                                             |
| ------------------------------------------------- | ------ | ------------------------------------------------------- |
| QuestionSet\_Id<mark style="color:red;">\*</mark> | String | Please append a valid QuestionSet Id to the Request URL |

#### Headers

| Name                                            | Type   | Description                                                                                                                                                                                                                        |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | <p>All questionset APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.<br>Set <mark style="color:green;">Bearer {{api\_key}}</mark></p> |
| x-channel-id                                    | String | Unique identification number associated with a root organization.                                                                                                                                                                  |

#### Request Body

| Name    | Type   | Description                                                                       |
| ------- | ------ | --------------------------------------------------------------------------------- |
| request | Object | The body is the representation of the resource object for retiring a question set |

{% tabs %}
{% tab title="200: OK QuestionSet deletion operation was successfully executed." %}

```javascript
{
  "id": "api.questionset.retire",
  "ver": "3.0",
  "ts": "2021-02-02T20:20:56ZZ",
  "params": {
    "resmsgid": "98c9f97d-f9d6-4da9-be88-2852294c2aaa",
    "msgid": null,
    "err": null,
    "status": "successful",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "identifier": "do_113207939069968384112",
    "versionKey": "1612297249754"
  }
}
```

{% endtab %}

{% tab title="400: Bad Request QuestionSet is already retired." %}

```javascript
{
  "id": "api.questionset.retire",
  "ver": "3.0",
  "ts": "2021-02-02T20:21:26ZZ",
  "params": {
    "resmsgid": "0608b59d-dfb9-4c0e-807f-1a19c9a163fe",
    "msgid": null,
    "err": "ERR_QUESTION_RETIRE",
    "status": "failed",
    "errmsg": "QuestionSet with identifier : do_113207939069968384112 is already Retired."
  },
  "responseCode": "CLIENT_ERROR",
  "result": {
    "messages": null
  }
}
```

{% endtab %}

{% tab title="404: Not Found QuestionSet Send for Retire operation failed! The possible reason for failure is that you may have provided wrong questionset id." %}

```javascript
{
  "id": "api.questionset.retire",
  "ver": "3.0",
  "ts": "2021-02-02T20:22:03ZZ",
  "params": {
    "resmsgid": "da7af22e-bdce-48f0-8743-f50fa6c2cd21",
    "msgid": null,
    "err": "NOT_FOUND",
    "status": "failed",
    "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_1132079390699683841121"
  },
  "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
{
  "result": {},
  "id": "string",
  "ver": "string",
  "ts": "string",
  "params": {
    "resmsgid": "string",
    "msgid": "string",
    "err": "string",
    "status": "string",
    "errmsg": "string"
  },
  "responseCode": "string"
}
```

{% endtab %}
{% endtabs %}

#### Success result schema

<table><thead><tr><th width="188">Attribute</th><th width="159.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>identidier</td><td>String</td><td>Unique Question identifier</td></tr><tr><td>versionKey</td><td>String</td><td>Unique version key for question</td></tr></tbody></table>

#### cURL

```shell
curl --location -g --request DELETE '{{host}}/questionset/v1/retire/{{questionSet_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_key}}' \
--header 'X-Channel-Id: {{channel_id}}' \
--data-raw '{
  "request": {
    "questionset": {
    }
  }
}'
```


---

# Agent Instructions: 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:

```
GET https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-service/apis/v1/questionset-apis/retire-questionset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
