For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 departments

post
/department/list

List all departments belonging to the current user.

Callable with an empty body. Also accepts GET.

Authorizations
AuthorizationstringRequired

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.

Responses
200

The departments

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/department/list
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 department

post
/department/create

Create a department, and return its ID.

Requires the employee_update right.

Authorizations
AuthorizationstringRequired

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.

Body
Responses
200

The created department

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
idintegerOptional

ID of the new department.

post/department/create
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 department

post
/department/update

Update a department. Pass a full department object including its id.

Requires the employee_update right.

Authorizations
AuthorizationstringRequired

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.

Body
Responses
200

Department updated

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/department/update
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 department

post
/department/delete

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.

Authorizations
AuthorizationstringRequired

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.

Body
department_idinteger · min: 1Required

ID of the department to delete.

Responses
200

Department deleted

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/department/delete
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?