Skip to main content

Update department

Update an existing department

Function UpdateDepartment(Val URL, Val DepartmentID, Val Name = "", Val ParentID = "", Val HeadID = "", Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
DepartmentID--depidString, NumberDepartment ID
Name--titleStringDepartment name
ParentID--parentidString, NumberID of parent department
HeadID--headidString, NumberID of department manager
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.update


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

DepartmentID = "710";
ParentID = 7;

Result = OPI_Bitrix24.UpdateDepartment(URL, DepartmentID, , ParentID);

URL = "b24-ar17wx.bitrix24.by";
Token = "35c31667006e9f06006b12e400000001000...";

DepartmentID = "712";
Name = "New department";
ParentID = 1;
HeadID = 10;

Result = OPI_Bitrix24.UpdateDepartment(URL
, DepartmentID
, Name
, ParentID
, HeadID
, Token);
    oint bitrix24 UpdateDepartment \
--url "b24-ar17wx.bitrix24.by" \
--depid 798 \
--title "New department" \
--parentid 1 \
--headid 10 \
--token "***"
Result
{
"result": true,
"time": {
"start": 1728454927.77891,
"finish": 1728454928.01456,
"duration": 0.235645055770874,
"processing": 0.204494953155518,
"date_start": "2024-10-09T09:22:07+03:00",
"date_finish": "2024-10-09T09:22:08+03:00",
"operating_reset_at": 1728455527,
"operating": 0.20447301864624
}
}