Create New Department / Roles API
Require Authentication
This API is used to create new 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 add new role/department
URL
api/companies/adddepartment
Required parameter (POST)
- deviceID
- token
- departmentName
Optional parameter
Example JSON Payload
{
"deviceID": "ABCD-EFGH-IJKL-MNOP",
"token": "bb602ab13b8090268cd6e3bb9dfa39e2",
"departmentName": "department from api"
}
Possible return HTTP status code
- 201
- 400
- 401
- 405
Return message, contains newly created department information
{
"status": "success",
"message": {
"departmentID": 2,
"departmentName": "department from api",
"createdDate": 1449307732,
"createdBy": 3,
"modifiedDate": 1449307732,
"modifiedBy": 3,
"companyID": 1
}
}