Employee
Assign an employee as the driver of a tracker, and read who is assigned now.
Assigning an employee to a tracker records who is driving it. That link is what lets reports attribute trips, mileage, and behaviour to a person rather than only to a device.
Reading the assignment returns more than the name: it also reports the hardware key used to identify the driver, and when and where the assignment was made.
API actions
API base path: /tracker/employee.
Required sub-user rights: employee_update.
Required tariff feature: app_fleet.
Assign or unassign the employee (driver) on a tracker.
Requires the app_fleet tariff feature.
When new_employee_id is provided, that employee is assigned to the tracker. When it is omitted or null, any existing assignment is cleared (unassign). Error 263 is returned when the call would produce no change, for example unassigning a tracker that already has no employee.
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 tracker, also known as the object ID. Must belong to the current account and not be blocked.
123456ID of the employee to assign. Omit or pass null to unassign the current employee from the tracker.
12345The assignment was 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 201: no tracker or employee with this ID belongs to the account. Error 208: the tracker exists but is blocked, normally because its tariff ended. Error 263: no change needed, because the tracker already has this assignment state.
Error response object
POST /v2/tracker/employee/assign HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 45
{
"tracker_id": 123456,
"new_employee_id": 12345
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - No tracker or employee with this ID belongs to the account.
208 - The tracker exists but is blocked, normally because its tariff ended.
263 - No change needed, because the tracker already has this assignment state.
Get the employee currently assigned to a tracker, and when and where the assignment last changed. Available to demo accounts.
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 tracker, also known as the object ID. Must belong to the current account and not be blocked.
123456The assignment
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 201: no tracker with this ID belongs to the account. Error 208: the tracker exists but is blocked, normally because its tariff ended.
Error response object
POST /v2/tracker/employee/read HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"tracker_id": 123456
}{
"success": true,
"current": {
"id": null,
"tracker_id": null,
"first_name": "text",
"middle_name": "text",
"last_name": "text",
"email": "text",
"phone": "text",
"driver_license_number": "text",
"driver_license_cats": "text",
"driver_license_issue_date": null,
"driver_license_valid_till": null,
"hardware_key": null,
"icon_id": null,
"avatar_file_name": null,
"department_id": null,
"location": {
"lat": 1,
"lng": 1,
"address": "text",
"radius": 1
},
"personnel_number": "text",
"ssn": "text",
"tags": [
1
]
},
"last_change": {
"id": 1,
"new_employee_id": null,
"location": {
"lat": 1,
"lng": 1,
"address": null
},
"changed": "text",
"origin": "supervisor",
"hardware_key": null
}
}Errors
These errors come in addition to the general error codes:
201 - No tracker with this ID belongs to the account.
208 - The tracker exists but is blocked, normally because its tariff ended.
Last updated
Was this helpful?