How to get lists of employees and departments

To get the list of employees: api_employees

Request:

{
  "server_token": "...",
  "app_version": "...",
  "controller": "api_employees"
}

Response:

{
"items":
[{
"employee_id": 1,
"is_deleted": 0,
"display_name": "Petrov Ivan",
"first_name": "Ivan",
"second_name": "Petrov",
"email": "petrov@mail.loc",
"privilege": -1,
"time_zone": "Europe/Moscow",
"parent_group_id": 1
}]
}

itemsList of employees;
employee_idEmployee’s ID;
is_deletedIf an employee’s profile was deleted from the AD, but remained in the system.
display_nameDisplay name;
first_nameEmployee’s name;
second_nameEmployee’s surname;
emailEmployee’s e-mail;
time_zoneTime zone ID;
parent_group_idParent group ID;

To get the tree of departments: api_departments

Request:

{
  "server_token": "...",
  "app_version": "...",
  "controller": "api_departments"
}

Respone:

{
"items":
[{
"department_id": 21,
"display_name": "Head office",
"items":
[{
"department_id": 38,
"display_name": "Logistics Department",
"items":
[{
"employee_id": 120,
"first_name": "Ivan",
"second_name": "Petrov"
}]
}]
}]
}

itemsList of employees;
department_idDepartment’s ID;
display_nameDepartment’s name;
employee_idEmployee’s ID;
first_nameEmployee’s name;
second_nameEmployee’s surname;