Update
Partial update of a task
POST https://do.workzeal.com/task/update
Only the fields you pass are changed; everything else in the task stays as it was. The most common scenario is closing a task: pass id, status_id: 2, and the result text.
Request Body
| Name | Type | Description |
|---|---|---|
| task* | JSON |
200: OK Standard response object
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "5001"
}
JSON
All available parameters
- id - * Task code
- note - Task text
- status_id - Status: 1 for in progress, 2 for completed
- result - Completion result (usually when closing)
- type_id - Task type code
- user_id - Assignee code
- deal_id - Deal code
- contact_id - Contact person code
- date_start - Start date/time
- date_finish - End date/time
- is_hot - 1 for an urgent task
- tags - Comma-separated tags (replace the old ones)
{
"id": 5001,
"status_id": 2,
"result": "Called, terms agreed, invoice sent"
}
Note
Required parameter: only id (task code) plus at least one field to update.
When a task is closed (status_id: 2), its reminder is turned off automatically. Numeric fields with the value 0 are treated as "not passed", while note, result, and tags, when passed, completely replace the old value.
Example
cURL
NodeJS (Request)
curl --location --request POST 'https://do.workzeal.com/task/update' \
--header 'Authorization: Bearer XXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 5001,
"status_id": 2,
"result": "Called, terms agreed, invoice sent"
}
'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://do.workzeal.com/task/update',
'headers': {
'Authorization': 'Bearer XXXX-XXXXXXX-XXXXXXX',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": 5001,
"status_id": 2,
"result": "Called, terms agreed, invoice sent"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Response
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "5001"
}
// value - ID of the updated task, 0 - error (the text is in the error field)