Complete a business process task bizproc.task.complete
Scope:
bizprocWho can execute the method: any user
This method completes a business process task:
- Document approval
- Document acknowledgment
- Request for additional information
- Request for additional information with rejection
You can only complete your own task.
User documentation
Method parameters
Required parameters are marked with *
|
Name |
Description |
|
TASK_ID* |
Task identifier. You can obtain the identifier using the bizproc.task.list method. |
|
STATUS* |
Target status of the task. Possible values:
The set of acceptable values changes depending on the type of task:
|
|
COMMENT |
User comment. The requirement for this parameter depends on the task settings. |
|
FIELDS |
An object describing fields for completing tasks with a request for additional information in the format
You can obtain field descriptions in the task using the bizproc.task.list method in the object
The
Values are passed in this format to the
To pass a value in a File type field, specify:
More about working with files can be found in the article How to Upload Files |
Code example
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"TASK_ID":1501,"STATUS":1,"COMMENT":"Added","Fields":{"contractor":"C_607","phone_number":"+19991234567"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/bizproc.task.complete
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"TASK_ID":1501,"STATUS":1,"COMMENT":"Added","Fields":{"contractor":"C_607","phone_number":"+19991234567"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/bizproc.task.complete
try
{
const response = await $b24.callMethod(
'bizproc.task.complete',
{
'TASK_ID': 1501,
'STATUS': 1,
'COMMENT': 'Added',
"Fields": {
'contractor': 'C_607',
'phone_number': '+19991234567'
}
}
);
const result = response.getData().result;
console.log(result);
}
catch( error )
{
alert("Error: " + error);
}
try {
$response = $b24Service
->core
->call(
'bizproc.task.complete',
[
'TASK_ID' => 1501,
'STATUS' => 1,
'COMMENT' => 'Added',
'Fields' => [
'contractor' => 'C_607',
'phone_number' => '+19991234567'
]
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
echo 'Success: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error completing task: ' . $e->getMessage();
}
BX24.callMethod(
'bizproc.task.complete',
{
'TASK_ID': 1501,
'STATUS': 1,
'COMMENT': 'Added',
"Fields": {
'contractor': 'C_607',
'phone_number': '+19991234567'
}
},
function(result)
{
if(result.error())
alert("Error: " + result.error());
else
console.log(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'bizproc.task.complete',
[
'TASK_ID' => 1501,
'STATUS' => 1,
'COMMENT' => 'Added',
'Fields' => [
'contractor' => 'C_607',
'phone_number' => '+19991234567'
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response handling
HTTP status: 200
{
"result": true,
"time": {
"start": 1738746693.9218969,
"finish": 1738746694.1367991,
"duration": 0.21490216255187988,
"processing": 0.19237995147705078,
"date_start": "2025-02-05T12:11:33+01:00",
"date_finish": "2025-02-05T12:11:34+01:00",
"operating_reset_at": 1738747293,
"operating": 0.19236207008361816
}
}
Returned data
|
Name |
Description |
|
result |
Returns |
|
time |
Information about the request execution time. |
Error handling
HTTP status: 400
{
"error": "ERROR_TASK_VALIDATION",
"error_description": "incorrect STATUS"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible error codes
|
Code |
Error message |
Description |
|
|
empty TASK_ID |
|
|
|
incorrect STATUS |
An incorrect task status is specified. |
|
|
Task not found |
No task found with the specified |
|
|
Task already completed |
The task has already been completed. |
|
|
Incorrect task type |
Incorrect task type. This task cannot be completed via REST. |
|
|
error text from the task |
An error occurred during the execution of the task. |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue learning
- Workflow Tasks: Overview of Methods
- Get a List of Workflow Tasks bizproc.task.list
- Delegate a workflow task bizproc.task.delegate