Departments are used to assign employees to different operational areas of a location. Use the API to retrieve a list of all departments, create new departments and the locations they apply to, update the department names, or remove them from your account.
Learn more about departments in the OnLocation Help Center.
Returns a list of departments for the organization. Each department indicates which locations it has been added to.
List of departments
Access denied to this resource
Resource not found
curl -i -X GET \ https://api.whosonlocation.com/v1/department
[- {
- "id": 1658,
- "created": "2021-08-12T10:54:13+12:00",
- "modified": "2021-08-13T10:54:13+12:00",
- "name": "Administration",
- "locations": [
- {
- "id": 556,
- "name": "Example Name"
}
]
}
]
Add a new department, details include the name and locations.
Department created
Access denied to this resource
Internal server error
{- "name": "Department of Examples"
}
{- "id": 1658,
- "created": "2021-08-12T10:54:13+12:00",
- "modified": "2021-08-13T10:54:13+12:00",
- "name": "Administration",
- "locations": [
- {
- "id": 556,
- "name": "Example Name"
}
]
}
Retrieves a single department, filtering with the provided ID.
Department returned
Access denied to resource
Resource not found
curl -i -X GET \ https://api.whosonlocation.com/v1/department/:id
{- "id": 1658,
- "created": "2021-08-12T10:54:13+12:00",
- "modified": "2021-08-13T10:54:13+12:00",
- "name": "Administration",
- "locations": [
- {
- "id": 556,
- "name": "Example Name"
}
]
}