# Reject QuestionSet

## This API is used to reject the question set, which is sent for review on the Sunbird-inQuiry Platform.

<mark style="color:green;">`POST`</mark> `/questionset/v1/reject/{QuestionSet_Id}}`

• The  <mark style="color:orange;">/reject/{QuestionSet\_Id}</mark> endpoint executes the "Rejecting QuestionSet" request based on parameters provided as metadata in the request body.\
• It points to inquiry-api-service (assessment service) - <mark style="color:orange;">/questionset/v4/reject/QuestionSet\_Id</mark>\
• You need to provide a valid QuestionSet Id value in the <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 |

#### Headers

| Name                                            | Type   | Description                                                                                                                                                                                                                    |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Content-Type<mark style="color:red;">\*</mark>  | 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<mark style="color:red;">\*</mark> | String | <p>All content 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 metadata about the questionset to be rejected |

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

```javascript
{
  "id": "api.questionset.reject",
  "ver": "3.0",
  "ts": "2021-02-03T12:11:35ZZ",
  "params": {
    "resmsgid": "a505a723-616f-4e3f-9a52-2f0d9924f732",
    "msgid": null,
    "err": null,
    "status": "successful",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "identifier": "do_113208406116417536122",
    "versionKey": "1612354279918"
  }
}
```

{% endtab %}

{% tab title="400: Bad Request The 'Review Reject QuestionSet' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter." %}

```javascript
{
  "id": "api.questionset.reject",
  "ver": "3.0",
  "ts": "2021-02-03T12:16:59ZZ",
  "params": {
    "resmsgid": "cbcaa290-e132-47e6-b4d9-94212037195d",
    "msgid": null,
    "err": "ERR_QUESTION_SET_REJECT",
    "status": "failed",
    "errmsg": "QuestionSet is not in 'Review' state for identifier: do_113208406116417536122"
  },
  "responseCode": "CLIENT_ERROR",
  "result": {
    "messages": null
  }
}
```

{% endtab %}

{% tab title="404: Not Found The 'Review Reject QuestionSet' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter." %}

```javascript
{
  "id": "api.questionset.reject",
  "ver": "3.0",
  "ts": "2021-02-03T12:15:36ZZ",
  "params": {
    "resmsgid": "6fc0bd55-e99e-4ae1-80e2-7275458258ab",
    "msgid": null,
    "err": "NOT_FOUND",
    "status": "failed",
    "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_1132084061164175361221"
  },
  "responseCode": "RESOURCE_NOT_FOUND",
  "result": {
    "messages": null
  }
}
```

{% endtab %}

{% tab title="500: Internal Server Error Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing." %}

```javascript
{
  "result": {},
  "id": "string",
  "ver": "string",
  "ts": "string",
  "params": {
    "resmsgid": "string",
    "msgid": "string",
    "err": "string",
    "status": "string",
    "errmsg": "string"
  },
  "responseCode": "string"
}
```

{% endtab %}
{% endtabs %}

#### Request Sample

```json
{
  "request": {
    "questionset": {
      "rejectComment": "Rejected for testing"
    }
  }
}
```

#### Request Schema

<table><thead><tr><th>Attribute</th><th width="122">Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>rejectComment</td><td>String</td><td>Question set rejection comment/reason</td><td>Yes</td></tr></tbody></table>

#### Success result schema

<table><thead><tr><th width="189">Attribute</th><th width="120.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 '{{host}}/questionset/v1/reject/{{questionSet_id}}' \
  -H 'Authorization: Bearer {{api_key}}' \
  -H 'Content-Type: application/json' \
  --data-raw '{"request":{"questionset":{"rejectComment":"Not aligned"}}}' \
  --compressed
```


---

# 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/reject-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.
