Skip to main content

Delete department

Delets department by ID

Function DeleteDepartment(Val URL, Val DepartmentID, Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
DepartmentID--depidString, NumberDepartment ID for deletion
Token--tokenStringAccess token, when app auth method used

Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API


tip

Method at API documentation: department.delete


1C:Enterprise/OneScript code example
    URL          = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";
DepartmentID = "1070";

Result = OPI_Bitrix24.DeleteDepartment(URL, DepartmentID);

URL = "b24-ar17wx.bitrix24.by";
Token = "2f4e4067006e9f06006b12e400000001000...";
DepartmentID = "1068";

Result = OPI_Bitrix24.DeleteDepartment(URL, DepartmentID, Token);
    oint bitrix24 DeleteDepartment \
--url "b24-ar17wx.bitrix24.by" \
--depid 1084 \
--token "***"
Result
{
"result": true,
"time": {
"start": 1728454928.30262,
"finish": 1728454928.41098,
"duration": 0.108357906341553,
"processing": 0.0806529521942139,
"date_start": "2024-10-09T09:22:08+03:00",
"date_finish": "2024-10-09T09:22:08+03:00",
"operating_reset_at": 1728455528,
"operating": 0
}
}