Update checklist item
POST /api/sync/v1/surveys/answers
Operation id: updateChecklist
Description
This API allows the assigned user or the user with task-view-all permission within the same site to update the survey answers for a particular assignment of a to-do. The surveyType currently support is CHECKLIST. So, that value should be entered as a parameter. The entityId should be the assignmentId of the specific assignment of a to-do. The list of assignmentIds can be fetched using GET ASSIGNMENT LIST API.
Accepted values for reasonTypeId are 10 (Not Applicable) and 11 (Cannot Do) The displayType value should be CHECKLIST for checklist based survey which is currently supported. The numeric values for valueNum represent the checklist item status:
0 indicates that the item is not complete 1 indicates that the item is marked as complete 2 indicates that the item is marked as not applicable
The valueString should not be used for Checklist based survey
Permissions Required:
- Assignee of the todo or have task-view-all permission within the same site
Tags: Survey APIs
Parameters
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
entityId | integer (int32) | Yes | Entity Id |
surveyType | string | Yes | Type of Survey |
Security
- Bearer (http / bearer)
- enter the client service token value.
Responses
200 — Answer Submitted successfully
Content type: application/json
400 — Bad Request
500 — Internal Server Error
Request body
Required: Yes
application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
id | integer (int32) | No | |
questionId | integer (int32) | No | |
questionOptionId | integer (int32) | No | |
displayType | string | No | |
dataType | string | No | |
valueNum | number | No | |
valueString | string | No | |
valueDate | string (date-time) | No | |
reason | string | No | |
reasonTypeId | integer (int32) | No | |
answerAttachments | array | No | |
offlineActionTimestamp | string (date-time) | No |
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"questionId": {
"type": "integer",
"format": "int32"
},
"questionOptionId": {
"type": "integer",
"format": "int32"
},
"displayType": {
"type": "string",
"enum": [
"INPUTBOX",
"DATEPICKER",
"NUMBER_SCROLLER",
"DROPDOWN",
"MULTISELECT",
"CHECKBOX",
"RADIO",
"CONFIRM_WITH_PHOTO"
]
},
"dataType": {
"type": "string",
"enum": [
"INTEGER",
"DECIMAL",
"STRING",
"BOOLEAN",
"JSON",
"DATE",
"TIMESTAMP"
]
},
"valueNum": {
"type": "number"
},
"valueString": {
"type": "string"
},
"valueDate": {
"type": "string",
"format": "date-time"
},
"reason": {
"type": "string"
},
"reasonTypeId": {
"type": "integer",
"format": "int32"
},
"answerAttachments": {
"type": "array",
"items": {
"type": "object",
"required": [
"fileHash"
],
"properties": {
"fileHash": {
"type": "string",
"description": "Hash of file",
"example": "f5160b088f2650b1398b5d13e41a42ec6cc36521"
},
"id": {
"type": "integer",
"format": "int32"
}
}
}
},
"offlineActionTimestamp": {
"type": "string",
"format": "date-time"
}
}
}
Response models
200 — Answer Submitted successfully
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
message | string | No | |
status | string | No | |
statusCode | integer (int32) | No | |
debugErrorMessage | string | No | |
messageCode | string | No | message codes |
messageParams | array | No | |
data | object | No |
{
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"SUCCESS",
"FAIL",
"BAD_REQUEST",
"NO_CONTENT",
"UNAUTHORIZED",
"FORBIDDEN",
"NOT_FOUND",
"INTERNAL_SERVER_ERROR",
"UNSUPPORTED_MEDIA_TYPE"
]
},
"statusCode": {
"type": "integer",
"format": "int32"
},
"debugErrorMessage": {
"type": "string"
},
"messageCode": {
"type": "string",
"description": "message codes",
"items": {
"type": "string",
"example": [
"ERROR12-To-Do has expired.",
"ERROR13-To-Do has been recalled.",
"ERROR14-Complete all checklist items.",
"ERROR15-Error updating status.",
"ERROR16-Error fetching assignment.",
"ERROR55-Error updating status.",
"ERROR59-To-do is already completed by {name}",
"ERROR75-To-Do has been Recalled.",
"ERROR17-To-Do can not be reassigned as it has been completed.",
"ERROR18-This To-Do is confidential and can not be reassigned.",
"ERROR19-Error while reassigning.",
"ERROR36-Current assignee's site id doesn't match",
"ERROR20-This To-Do can not be recalled as it has not been launched.",
"ERROR21-Error while recalling To-Do.",
"ERROR35-Please select a reason type while recalling a task",
"ERROR58-To-do can not be recalled."
]
}
},
"messageParams": {
"type": "array",
"items": {
"type": "string"
}
},
"data": {
"type": "object"
}
}
}