Skip to content

How to work with statuses

Statuses are used to track current employee activity (in fact, of tracking devices owned by employees). The simplest example is "busy" | "not busy". This is a status listing consisting of two elements (working statuses). Different trackers can be assigned different status lists.


Create

We need to create a working status list that we will assign to the device. Based on the working statuses that are created for the sheet - we will have a choice - what working status can be assigned to the tracker.

To create the working status list we need only one parameter: * listing - status_listing object without "id" and "entries" fields.

For example, we will create a working status list for the delivery service to allow drivers and supervisors to change the working status. Drivers can change their working status using the X-GPS app. Supervisors can change working status using the UI.

API request:

curl -X POST 'https://api.navixy.com/v2/status/listing/create' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing": {"label": "Delivery_service", "employee_controlled": true, "supervisor_controlled": true}'

The response will contain id of a new working status list:

{
    "success": true,
    "id": 1111
}

When we created a working status list, we need to fill it with working statuses, and we should use one request per one working status.

For example, we have 4 working statuses: "Free", "Break", "Pick up the goods from storage", "Deliver goods".

API request:

curl -X POST 'https://api.navixy.com/v2/status/create' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing_id": 1111, "status": {"label": "Free", "color": "E57373"}}'

The response will contain id of a new working status:

{
    "success": true,
    "id": 1
}

Assign

To assign the working status list to some devices, we use the tracker_id and listing_id.

For example, we have 10 drivers. We should create 10 requests for assigning the working status list to them.

API request:

curl -X POST 'https://api.navixy.com/v2/status/listing/tracker/assign' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "tracker_id": 615487, "listing_id": 111}'

The platform will notify you about success in reply.

After that, our drivers and supervisors will have access to change working statuses. Where they could be used: We can create a script that will assign a new task to a driver with the working status "Free". After assigning the task, this script will change the working status itself to "Pick up the goods from storage". Or when the task was completed, a script changes the working status to "Free" and gets fields from the ERP system, parses them to create a new task assigns this task to a driver and so on.


Last update: July 22, 2021