Departments¶
Display group’s list of departments¶
-
GET
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/departments/
¶ Retrieve a list of departments assigned to the group.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/departments/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "departments": [ { "departmentName": "test_department_parent_1", "enterpriseDepartment": "false", "fullPathName": "test_department_parent_1", "cliName": "", "cliPhoneNumber": "" }, { "departmentName": "test_department_initial", "enterpriseDepartment": "false", "fullPathName": "test_department_parent_1 \\ test_department_initial", "cliName": "test_cLineIdName_initial", "cliPhoneNumber": "+3225126777" } ] }
- Response JSON Object:
departments (array) – a list of department objects as defined as Group department in list attributes.
- Status Codes:
200 OK – no error
Add a group’s department¶
-
POST
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/departments/
¶ Add a new department to the group.
Example request:
POST /api/v1/tenants/foo/groups/foogroup/departments/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "departmentName": "test_department_initial", "parentDepartment": { "tenantId": "ApioSpTest", "groupId": "ApioGrpTest", "departmentName": "test_department_parent_1" }, "cliName": "test_cLineIdName_initial", "cliPhoneNumber": "025126777" }
- Request JSON Object:
departmentName (string) – the name of the department as defined in Group department attributes.
parentDepartment (object) – (Optional) an object as defined in Group department attributes.
cliName (string) – (Optional) a string as defined in Group department attributes.
cliPhoneNumber (string) – (Optional) a string as defined in Group department attributes.
Example response:
HTTP/1.1 201 CREATED
- Status Codes:
201 Created – no error
400 Bad Request – invalid data
Get informations of a single department¶
-
GET
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/departments/
(string: instance_name)/
¶ Get informations of a single department.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/departments/fooDepartment/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "parentDepartment": { "tenantId": "ApioSpTest", "groupId": "ApioGrpTest", "departmentName": "test_department_parent_1" }, "cliName": "test_cLineIdName_initial", "cliPhoneNumber": "+3225126777" }
- Response JSON Object:
parentDepartment (object) – (Optional) an object as defined in Group department attributes.
cliName (string) – (Optional) a string as defined in Group department attributes.
cliPhoneNumber (string) – (Optional) a string as defined in Group department attributes.
- Status Codes:
200 OK – no error
Remove a department¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/departments/
(string: instance_name)/
¶ Remove a single department.
Example request:
DELETE /api/v1/tenants/foo/groups/foogroup/departments/fooDepartment/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – no error
Modify a department attributes¶
-
PUT
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/departments/
(string: instance_name)/
¶ Modify the attributes of a department.
Example request:
PUT /api/v1/tenants/footenant/groups/foogroup/departments/fooDepartment/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "departmentName": "newname", "parentDepartment": { "tenantId": "ApioSpTest", "groupId": "ApioGrpTest", "departmentName": "test_department_available_parent_1" }, "cliName": "newNamecallId", "cliPhoneNumber": "3225126778" }
- Request JSON Object:
departmentName (string) – (Optional) the new name of the department as defined in Group department attributes.
parentDepartment (object) – (Optional) an object as defined in Group department attributes.
cliName (string) – (Optional) a string as defined in Group department attributes.
cliPhoneNumber (string) – (Optional) a string as defined in Group department attributes.
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – no error
400 Bad Request – bad request
Display a list of a department available parents¶
-
GET
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/departments/
(string: instance_name)/available_parent/
¶ Retrieve a list of a department available parents.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/departments/fooDepartment/available_parent/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "availableParents": [ { "tenantId": "ApioSpTest", "groupId": "ApioGrpTest", "departmentName": "test_department_parent_1", "fullPathName": "test_department_parent_1" }, { "tenantId": "ApioSpTest", "groupId": "ApioGrpTest", "departmentName": "test_department_initial", "fullPathName": "test_department_parent_1 \\ test_department_initial" } ] }
- Response JSON Object:
availableParents (array) – a list of departments object as defined in Group department available parent list attributes.
- Status Codes:
200 OK – no error
Configuration Information for the Password¶
The rules are the same as for the Group Admins. See Configuration Information for the Password.