diff --git a/learn/product-and-developer-guide/question-and-question-set-service/apis/questionset-apis/read-comment-questionset.md b/learn/product-and-developer-guide/question-and-question-set-service/apis/questionset-apis/read-comment-questionset.md new file mode 100644 index 0000000..10d01e7 --- /dev/null +++ b/learn/product-and-developer-guide/question-and-question-set-service/apis/questionset-apis/read-comment-questionset.md @@ -0,0 +1,112 @@ +--- +description: >- + This API is used to read an existing comment for a question set on the Sunbird-inQuiry + Platform. +--- + +# Read Comment QuestionSet + +{% swagger method="get" path="/comment/read/{QuestionSet_Id}" baseUrl="" summary="This API is used to read an existing comment for a question set on the Sunbird-inQuiry Platform." expanded="true" %} +{% swagger-description %} +• The /questionset/v1/comment/read/{QuestionSet\_Id} endpoint executes a request for fetching the read comment data.\ +• This API returns the metadata of the question set containing the information related to read comment.\ +• The endpoint for reading QuestionSet comment is `/questionset/v1/comment/read`\ +• It points to inquiry-api-service (assessment service) - /questionset/v4/comment/read/\ +• You need to provide a valid QuestionSet Id value in {QuestionSet\_Id} field of the API URL. \ +• It is mandatory to provide values for parameters marked with \*\ +• Mandatory fields cannot be null or empty. +{% endswagger-description %} + +{% swagger-parameter in="path" name="QuestionSet_Id" type="String" required="true" %} +Append a valid Question Set Id To the Request URL +{% endswagger-parameter %} + +{% swagger-parameter in="header" name="Content-Type" type="String" required="false" %} +The Content-Type entity is the media type of the resource. Possible media types can be: Application/json +{% endswagger-parameter %} + +{% swagger-parameter in="header" name="Authorization" type="String" required="true" %} +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.\ +Set Bearer \{{api\_key\}} +{% endswagger-parameter %} + +{% swagger-response status="200: OK" description="The "Read Comment Question Set" operation was successfully executed" %} +```javascript +{ + "id": "api.questionset.read.comment", + "ver": "3.0", + "ts": "2023-12-06T08:43:11ZZ", + "params": { + "resmsgid": "20954dd1-6b33-4a2f-abff-c41e2607a233", + "msgid": null, + "err": null, + "status": "successful", + "errmsg": null + }, + "responseCode": "OK", + "result": { + "comments": [ + { + "identifier": "do_11394153349658214411", + "comment": "Comments made by the reviewer-1" + } + ] + } +} +``` +{% endswagger-response %} + +{% swagger-response status="404: Not Found" description="The Read Comment Question Set operation failed! The possible reason for failure is that you may have provided wrong question set ID." %} +```javascript +{ + "id": "api.questionset.read.comment", + "ver": "3.0", + "ts": "2023-12-06T08:45:11ZZ", + "params": { + "resmsgid": "41cafaaa-29d9-4d0f-a0c9-d49932018da2", + "msgid": null, + "err": "NOT_FOUND", + "status": "failed", + "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11394153349658214412" + }, + "responseCode": "RESOURCE_NOT_FOUND", + "result": { + "messages": null + } +} +``` +{% endswagger-response %} + +{% swagger-response status="500: Internal Server Error" description="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" +} +``` +{% endswagger-response %} +{% endswagger %} + +#### Success response schema + +
AttributeTypeDescription
identifierStringUnique Question set Identifier
commentStringComments made by the reviewer
+ +#### cURL + +**Sample CURL to read comment for QuestionSet** + +```shell +curl --location -g --request GET '{{host}}/questionset/v1/comment/read/{{questionSet_id}}' \ +--header 'Authorization: Bearer {{api_key}}' +``` + diff --git a/learn/product-and-developer-guide/question-and-question-set-service/apis/questionset-apis/update-comment-questionset.md b/learn/product-and-developer-guide/question-and-question-set-service/apis/questionset-apis/update-comment-questionset.md new file mode 100644 index 0000000..4daac14 --- /dev/null +++ b/learn/product-and-developer-guide/question-and-question-set-service/apis/questionset-apis/update-comment-questionset.md @@ -0,0 +1,168 @@ +--- +description: >- + This API will allow the reviewer to save comments as a draft for question set before he clicks on the final publish/reject on the Sunbird-inQuiry + Platform. +--- + +# Update Comment QuestionSet + +{% swagger method="patch" path="/questionset/v1/comment/update" baseUrl="" summary="This API will allow the reviewer to save comments as a draft for question set before he clicks on the final publish/reject on the Sunbird-inQuiry Platform." expanded="true" %} +{% swagger-description %} +• /comment/update/ endpoint executes the "Update Comment QuestionSet" request based on parameters provided as metadata in the request body.\ +• It points to inquiry-api-service (assessment service) - /questionset/v4/comment/update\ +• It is mandatory to provide values for parameters marked with \*. \ +• Mandatory fields cannot be null or empty. +{% endswagger-description %} + +{% swagger-parameter in="header" name="Content-Type" type="String" required="true" %} +The Content-Type entity is the media type of the resource. Possible media types can be:-Application/json +{% endswagger-parameter %} + +{% swagger-parameter in="header" name="Authorization" type="String" required="true" %} +All question APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.\ +Set Bearer \{{api\_key\}} +{% endswagger-parameter %} + +{% swagger-parameter in="body" name="request" type="Object" required="true" %} +It contains metadata about the comments to be updated for a particular QuestionSet_Id. +{% endswagger-parameter %} + +{% swagger-response status="200: OK" description="The Update Comment Question Set operation was successfuly executed." %} +```javascript +{ + "id": "api.questionset.update.comment", + "ver": "3.0", + "ts": "2023-12-06T08:40:14ZZ", + "params": { + "resmsgid": "2657c6f8-8554-4efa-9cc5-6c6e656ebf50", + "msgid": null, + "err": null, + "status": "successful", + "errmsg": null + }, + "responseCode": "OK", + "result": { + "identifiers": [ + "do_11393730666569728019", + "do_11394153349658214411" + ] + } +} +``` +{% endswagger-response %} + +{% swagger-response status="400: Bad Request" description="The 'Update Comment QuestionSet' operation failed ! The possible reason for failure is that the provided identifier does not have a status Review, or it is not Question Set." %} +```javascript +{ + "id": "api.questionset.update.comment", + "ver": "3.0", + "ts": "2023-12-06T08:36:09ZZ", + "params": { + "resmsgid": "bea8fce0-b3f5-48e5-8c38-e46be652f010", + "msgid": null, + "err": "ERR_QUESTION_SET_UPDATE_COMMENT", + "status": "failed", + "errmsg": "Node with Identifier do_11394153349658214411 does not have a status Review." + }, + "responseCode": "CLIENT_ERROR", + "result": { + "messages": null + } +} +``` +{% endswagger-response %} + +{% swagger-response status="404: Not Found" description="The Update Comment Question Set operation failed ! The possible reason for failure is that the provided identifier is not a valid Question Set ID." %} +```javascript +{ + "id": "api.questionset.update.comment", + "ver": "3.0", + "ts": "2023-12-06T08:40:09ZZ", + "params": { + "resmsgid": "09f9fd7e-af05-4e25-9b1e-559eccd6b1cf", + "msgid": null, + "err": "ERR_QUESTION_SET_ID", + "status": "failed", + "errmsg": "Node with Identifier do_11387792783489433611 is not a Question Set" + }, + "responseCode": "RESOURCE_NOT_FOUND", + "result": { + "messages": null + } +} +``` +{% endswagger-response %} + +{% swagger-response status="500: Internal Server Error" description="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" +} +``` +{% endswagger-response %} +{% endswagger %} + +#### Sample Request + +```json +{ + "request":{ + "comments" : [ + { + "identifier" : "do_11394153349658214411", + "comment" : "Comments made by reviewer-1" + }, + { + "identifier" : "do_11393730666569728019", + "comment" : "Comments made by reviewer-2" + } + ] + } +} +``` + +#### Request schema + +
AttributeTypeDescriptionRequired
identifierStringRepresents the unique ID of a QuestionsetYes
commentStringRepresents the comment made by reviewerYes
+ +#### Success result schema + +| Attribute | Type | Description | +|-------------| ------ |----------------------------------| +| identifiers | String | List of all updated identifier | + +#### + +#### cURL + +```shell +curl --location -g --request PATCH '{{host}}/questionset/v1/comment/update' \ +--header 'Content-Type: application/json' \ +--header 'Authorization: Bearer {{api_key}}' \ +--data-raw '{ + "request":{ + "comments" : [ + { + "identifier" : "do_11394153349658214411", + "comment" : "Comments made by the reviewer-1" + }, + { + "identifier" : "do_11393730666569728019", + "comment" : "Comments made by the reviewer-2" + } + ] + } +}' +``` +