Departments
A group of employees, used to organise them into teams.
A department is a group of employees. An employee joins one by carrying its ID in department_id, and a null value leaves them in no department.
Department object
API actions
API base path: /department.
List all departments belonging to the current user.
Callable with an empty body. Also accepts GET.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
The departments
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/department/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Accept: */*
{
"success": true,
"list": [
{
"id": 1,
"label": "text",
"location": {
"lat": 1,
"lng": 1,
"address": "text",
"radius": 1
}
}
]
}Errors
These errors come in addition to the general error codes:
7 - Invalid parameters.
217 - The list contains non-existent entities.
221 - Device limit exceeded - if device limit set for the user's dealer has been exceeded.
Required sub-user rights: employee_update.
Create a department, and return its ID.
Requires the employee_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
The created department
true if request finished successfully.
trueID of the new department.
Bad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/department/create HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 95
{
"department": {
"id": 1,
"label": "text",
"location": {
"lat": 1,
"lng": 1,
"address": "text",
"radius": 1
}
}
}{
"success": true,
"id": 1
}Errors
These errors come in addition to the general error codes:
7 - Invalid parameters.
217 - The list contains non-existent entities.
221 - Device limit exceeded - if device limit set for the user's dealer has been exceeded.
Required sub-user rights: employee_update.
Update a department. Pass a full department object including its id.
Requires the employee_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
Department updated
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/department/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 95
{
"department": {
"id": 1,
"label": "text",
"location": {
"lat": 1,
"lng": 1,
"address": "text",
"radius": 1
}
}
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database.
Required sub-user rights: employee_update.
Delete a department by ID.
Employees assigned to it are not deleted; their department_id becomes null.
Also accepts GET with the same parameters as query-string values.
Requires the employee_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
ID of the department to delete.
Department deleted
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/department/delete HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"department_id": 1
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database.
Last updated
Was this helpful?