Delete Specific Department / Roles API
Require Authentication
This API is used to Delete Specific Department / Roles for the company based on combination of deviceID and token.
Only users that have module "user_and_roles_menu" and "manage_user" in their role/department (currently only Administrator) can delete role/department
Only department with no user in it can be deleted. Default department (Administrator or department with createdBy = 0) can not be deleted.
URL
api/companies/deletedepartment/:departmentID
Required parameter (in URL)
- :departmentID «contains departmentID that will be deleted. It must be put in the URL, e.g: api/companies/deletedepartment/2»
Required parameter (POST)
- deviceID
- token
Optional parameter
Example JSON Payload
{
"deviceID": "ABCD-EFGH-IJKL-MNOP",
"token": "bb602ab13b8090268cd6e3bb9dfa39e2"
}
Possible return HTTP status code
- 200
- 400
- 401
- 404
- 405
Return message
{
"status": "success",
"message": ["Department \"tes\" has been deleted."]
}