Create a draft copy of an existing To-Do
POST /api/sync/v1/todos/duplicate
Operation id: duplicateTask
Description
This API creates a clone of the specified to-do (original to-do) including its attachments, tags, attributes, and related data.
status of cloned to-do will be DRAFT.
if repeatingTask field value is sent as true in request and original to-do is a repeating to-do then the clone which is created will be a repeating to-do else it will be a non repeating to-do.
if cloned to-do is a repeating to-do and is WEEKLY or MONTHLY then start date of cloned to-do will be calculated accordingly as per the next occurrence else start date of cloned to-do will be current date
due date of cloned to-do will be calculated by adding difference of start date and due date from original to-do to the start date of cloned to-do.
assignees will be copied if site id is same as of creator
The following parameters are mandatory: 1)taskId
Permissions Required:
- user should be the creator of the given to-do. (the token we are passing in request should be of the creator of to-do)
Tags: To-Do APIs
Security
- Bearer (http / bearer)
- enter the client service token value.
Responses
200 — To-Do Duplicated Successfully
Content type: application/json
400 — Bad Request
401 — Unauthorized Access
403 — Forbidden
422 — Unprocessable Entity
500 — Internal Server Error
Request body
Required: Yes
application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
taskId | integer (int32) | Yes | id of task for which copy needs to be created |
repeatingTask | boolean | No |
{
"type": "object",
"required": [
"taskId"
],
"properties": {
"taskId": {
"type": "integer",
"format": "int32",
"description": "id of task for which copy needs to be created"
},
"repeatingTask": {
"type": "boolean"
}
}
}
Response models
200 — To-Do Duplicated Successfully
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
message | string | No | response message |
status | string | No | response status |
statusCode | integer (int32) | No | response status code |
debugErrorMessage | string | No | error message |
messageCode | string | No | message codes |
messageParams | array | No | message parameters |
data | object | No | |
taskId | integer (int32) | No | identifier of task |
{
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "response message"
},
"status": {
"type": "string",
"description": "response status",
"enum": [
"SUCCESS",
"FAIL",
"BAD_REQUEST",
"NO_CONTENT",
"UNAUTHORIZED",
"FORBIDDEN",
"NOT_FOUND",
"INTERNAL_SERVER_ERROR",
"UNSUPPORTED_MEDIA_TYPE"
]
},
"statusCode": {
"type": "integer",
"format": "int32",
"description": "response status code"
},
"debugErrorMessage": {
"type": "string",
"description": "error message"
},
"messageCode": {
"type": "string",
"description": "message codes",
"items": {
"type": "string",
"example": [
"ERROR403_10 - User does not met the required permissions to duplicate task"
]
}
},
"messageParams": {
"type": "array",
"description": "message parameters",
"items": {
"type": "string"
}
},
"data": {
"type": "object"
},
"taskId": {
"type": "integer",
"format": "int32",
"description": "identifier of task"
}
}
}