URL = FunctionParameters["Bitrix24_URL"]; Name = "Main department"; ParentID = 1; Result = OPI_Bitrix24.CreateDepartment(URL, Name, ParentID); OPI_TestDataRetrieval.WriteLog(Result, "CreateDepartment (wh)", "Bitrix24"); URL = FunctionParameters["Bitrix24_Domain"]; Token = FunctionParameters["Bitrix24_Token"]; Name = "Subordinate department"; ParentID = FunctionParameters["Bitrix24_HookDepID"]; HeadID = 1; Result = OPI_Bitrix24.CreateDepartment(URL, Name, ParentID, HeadID, Token);