Adds a watcher to a To-Do
PUT /api/sync/v1/todos/watcher
Operation id: watchTask
Description
This API allows you to add watcher to a to-do. Specify the to-do ID, user ID, and watcher status in the request body. Authentication and appropriate permissions are required to add watcher.
Tags: Add watcher for a To-Do
Security
- Bearer (http / bearer)
- enter the client service token value.
Responses
200 — Watchers added successfully
Content type: application/json
400 — Bad Request
401 — Unauthorized Access
403 — Forbidden
404 — Todo Not Found
412 — Precondition Failed
500 — Internal Server Error
Request body
Required: Yes
application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
taskId | integer (int32) | Yes | ID of the todo/task |
userId | integer (int32) | Yes | ID of the watcher user |
active | boolean | Yes | Indicates if the watcher is active |
{
"type": "object",
"required": [
"taskId",
"userId",
"active"
],
"properties": {
"taskId": {
"type": "integer",
"format": "int32",
"description": "ID of the todo/task",
"example": 1
},
"userId": {
"type": "integer",
"format": "int32",
"description": "ID of the watcher user",
"example": 1
},
"active": {
"type": "boolean",
"description": "Indicates if the watcher is active",
"example": true
}
}
}
Response models
200 — Watchers added 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"
}
}
}