Enterprise Departments¶
Only suitable for enterprises
Display tenant’s list of departments¶
-
GET
/api/v1/tenants/
(string: tenant_id)/departments/
¶ Retrieve a list of departments assigned to the tenant. Only suitable for enterprises.
Authorization rights: minimum Tenant (Enterprise) Admin.
Example request:
GET /api/v1/tenants/fooEnterprise/departments/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "includeGroupDepartments": true }
- Request JSON Object:
includeGroupDepartments (boolean) – (Optional) Specify if to include the group departments.
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "departments": [ { "tenantId": "ApioEntTest", "departmentName": "test_department_parent_1", "fullPathName": "test_department_parent_1" }, { "tenantId": "ApioEntTest", "departmentName": "test_department_initial", "fullPathName": "test_department_parent_1 \\ test_department_initial" }, { "tenantId": "ApioEntTest", "groupId": "ApioEntGrpTest", "departmentName": "test_department_ent_grp_initial", "fullPathName": "test_department_ent_grp_initial (ApioEntGrpTest)" } ] }
- Response JSON Object:
departments (array) – a list of department objects as defined as Tenant department in list attributes or, in case of group department, as Group department key attributes.
- Status Codes:
200 OK – no error
invalid data due to bad parameters, with possible sub-error codes:
42: NOT_AVAILABLE_IN_SP_MODE, “This API is not available in SP Mode.”
Add a tenant’s department¶
-
POST
/api/v1/tenants/
(string: tenant_id)/departments/
¶ Add a new department to the tenant. Only suitable for enterprises.
Authorization rights: minimum Tenant (Enterprise) Admin.
Example request:
POST /api/v1/tenants/fooEnterprise/departments/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "departmentName": "test_department_initial", "parentDepartment": "test_department_parent_1" }
- Request JSON Object:
departmentName (string) – the name of the department as defined in Tenant department attributes.
parentDepartment (string) – (Optional) the name of the parent department.
Example response:
- Response:
Similar to GET list method response.
- Status Codes:
201 Created – no error, instance created
invalid data due to bad parameters, with possible sub-error codes:
42: NOT_AVAILABLE_IN_SP_MODE, “This API is not available in SP Mode.”
Get informations of a single department¶
-
GET
/api/v1/tenants/
(string: tenant_id)/departments/
(string: instance_name)/
¶ Get informations of a single department. Only suitable for enterprises.
Authorization rights: minimum Tenant (Enterprise) Admin.
Example request:
GET /api/v1/tenants/fooEnterprise/departments/fooDepartment/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "parentDepartment": { "tenantId": "ApioEntTest", "departmentName": "test_department_parent_1" }, } OR { "parentDepartment": {}, }
- Response JSON Object:
parentDepartment (object) – an object as defined in Tenant department attributes. An empty object if the department has no parent.
- Status Codes:
200 OK – no error
invalid data due to bad parameters, with possible sub-error codes:
42: NOT_AVAILABLE_IN_SP_MODE, “This API is not available in SP Mode.”
404 Not Found – not found
Remove a department¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/departments/
(string: instance_name)/
¶ Remove a single department. Only suitable for enterprises.
Authorization rights: minimum Tenant (Enterprise) Admin.
Example request:
DELETE /api/v1/tenants/fooEnterprise/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
invalid data due to bad parameters, with possible sub-error codes:
42: NOT_AVAILABLE_IN_SP_MODE, “This API is not available in SP Mode.”
404 Not Found – not found
Modify a department attributes¶
-
PUT
/api/v1/tenants/
(string: tenant_id)/departments/
(string: instance_name)/
¶ Modify the attributes of a department. Only suitable for enterprises.
Authorization rights: minimum Tenant (Enterprise) Admin.
Example request:
PUT /api/v1/tenants/fooEnterprise/departments/fooDepartment/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "departmentName": "newname", "parentDepartment": "test_department_available_parent_1" }
- Request JSON Object:
departmentName (string) – (Optional) the new name of the department as defined in Tenant department attributes.
parentDepartment (string) – (Optional) the name of the new department parent.
Example response:
- Response:
Similar to GET list method response.
- Status Codes:
200 OK – no error
invalid data due to bad parameters, with possible sub-error codes:
42: NOT_AVAILABLE_IN_SP_MODE, “This API is not available in SP Mode.”
404 Not Found – not found
Display a list of a department available parents¶
-
GET
/api/v1/tenants/
(string: tenant_id)/departments/
(string: instance_name)/available_parents/
¶ Retrieve a list of a department available parents. Only suitable for enterprises.
Authorization rights: minimum Tenant (Enterprise) Admin.
Example request:
GET /api/v1/tenants/fooEnterprise/departments/fooDepartment/available_parents/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "availableParents": [ { "tenantId": "ApioEntTest", "departmentName": "test_department_parent_1", "fullPathName": "test_department_parent_1" }, { "tenantId": "ApioEntTest", "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 Tenant department available parent list attributes.
- Status Codes:
200 OK – no error
invalid data due to bad parameters, with possible sub-error codes:
42: NOT_AVAILABLE_IN_SP_MODE, “This API is not available in SP Mode.”