NAV
Nukio
shell

Introduction

Summary

The Nukio Asset Protection API adheres to REST design principals. URLs aim to be predictable, resource oriented, use standard HTTP verbs, and return standard HTTP status codes to indicate success or failure.

JSON encoding is used for request and response payloads.

Response format

A successful request and response

{
  "data": []
}

A problem with the request or response

{
  "error": {}
}

All JSON response formats take has one of the following root elements:

Date & time

Date and time are specified and returned in Unix Epoch date format:

{
  "1768920791": {}
}

Date and time are specified and returned in Unix Epoch date format:

1768920791

Coordinates

Coordinates are always specified in two values, meaning longitude and latitude:

{
  "deviceLastValidLatitude":28.594765799999998,: {}
}
  "deviceLastValidLongitude":-100.5939765,: {}
}

Coordinates are always specified in two values, meaning longitude and latitude.

Longitude

[45.850875,]

Latitude

[ -84.62456]

API schema

The Nukio API has a schema provided in Swagger format. The schema can be utilized to generate API clients in many different languages utilizing the Swagger Editor. Additional API endpoints are also available, above and beyond what is disccused in this documentation, and available for browsing here

Login

Login code example:

curl -X POST -H "Content-Type: application/json" -d '{"accountID": "jmvillarreal" , "userID": "api" , "password": "api123@" }' https://app.nukio.mx/api/v1/auth/login

Response

{
    "status_code": "200",
    "success": "1",
    "token": "jmvillarreal%7Capi%7Cals474rbcuka6b3045as0glr9q"
}

Login & API Access In order to use our API endpoints, all requests must be authenticated using an API access token. API tokens are generated through the authentication process and are required to authorize and secure every request to the platform. To obtain a valid token, you must first log in using your account credentials. Once authenticated, the API will return a token that must be included in subsequent requests. You may also explicitly terminate a session using the logout endpoint. The following endpoints handle user authentication for the Nukio API. Examples below demonstrate the required parameters, request formats, and expected responses.

Answer:"status_code": "200","success": "1","token": nukio.api.token

Authentication

Authorization example code:

curl -X GET -H "authorization: jmvillarreal%7Capi%7Cals474rbcuka6b3045as0glr9q" https://app.nukio.mx/api/v1/device/getalldevices/authorization

Answer

{ 
  "status_code": "200",
    "geozones": {},
    "devices": [
        {
            "deviceNotifyEmail": "",
            "pinColor": "FF0000",
            "deviceLastValidLongitude": -100.5984871,
            "deviceCreatedOn": 1679016078,
            "features": {
                "cargoaccess": {
                    "displayText": "Cargo Access",
                    "states": {
                        "0": "Disallowed",
                        "1": "Allowed"
                    }
                },
                "enginecutoff": {
                    "displayText": "Engine Cutoff",
                    "states": {
                        "0": "Disabled",
                        "1": "Enabled"
                    }
                }
            },
            "deviceLastGeozoneID": "",
            "state": {
                "enginecutoff": {
                    "onText": "on",
                    "displayName": "Engine Cutoff",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": "0",
                    "offText": "off"
                }
            },
            "pinTag": "Jm10",
            "fuelLevelAverage": "0.0",
            "deviceLastValidAddress": "",
            "deviceType": "CALAMP",
            "deviceDescription": "Jm10",
            "deviceLastValidSpeed": 0,
            "deviceDriver": "",
            "deviceLastValidTimestamp": 1768927982,
            "deviceLastHeartbeat": 1768927982,
            "deviceID": "jm10",
            "deviceDisplayName": "Jm10",
            "authorities": {},
            "equipmentTypeId": "calamp",
            "equipmentTypeDesc": "Calamp Default",
            "additionalPinDisplay": "",
            "sensors": {
                "enginecutoff": {
                    "onText": "on",
                    "displayName": "Engine Cutoff",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": "0",
                    "offText": "off"
                },
                "ignition": {
                    "onText": "on",
                    "displayName": "Ignition",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": "0",
                    "offText": "off"
                },
                "panic": {
                    "onText": "on",
                    "displayName": "Panic",
                    "isNegativeTriggered": true,
                    "pendingState": null,
                    "state": "0",
                    "offText": "off"
                }
            },
            "deviceLastValidLatitude": 28.574516499999998,
            "deviceUnique": "4661345865",
            "hasPendingCommands": "false",
            "deviceLastValidHeading": 0,
            "fuelLevels": [
                ""
            ]
        }
    ],
    "success": "1",
    "hasUpdateDevicePrivileges": true
    }
    

API requests are authenticated by specifying your API Token on each request. Provide your API Token as the basic auth Authorization. The password and user portion are ignored.

Authorization: nukio.api.token

Events (Alerts/Activations)

Get all events

Get a summary of activations events:

curl -X GET -H "authorization: jmvillarreal%7Capi%7Cals474rbcuka6b3045as0glr9q" https://app.nukio.mx/api/v1/events/activations/summary/authorization

Answer:

{
    "status_code": "200",
    "fuel": 0,
    "activations": 0,
    "cargo": 0,
    "base": 0
}

This endpoint retrieves all Alerts events for all assets in your organizations regarding fuel, inputs activations, cargo events, base events, in a sumary format.

HTTP request

GET https://app.nukio.mx/api/v1/events/activations/summary/authorization

Get specific event data

Get specific event data:

curl -X GET -H "authorization: jmvillarreal%7Capi%7Cals474rbcuka6b3045as0glr9q" https://app.nukio.mx/api/v1/eventdata/devicemetadata/jm10/1768927982/1768928982/authorization

The above commands returns JSON structured as follows:

{
  "metadata": [
        {
            "statusDescription": "Ubicación",
            "creationTime": 1768928759,
            "pinColor": "FF0000",
            "latitude": "28.574516499999998",
            "count": "14",
            "pinTag": "Jm10",
            "deviceID": "jm10",
            "statusCode": "61472",
            "longitude": "-100.5984871"
        }
    ],
    "sensors": {
        "enginecutoff": {
            "onText": "on",
            "displayName": "de Corte del Motor",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "ignition": {
            "onText": "on",
            "displayName": "Ignición",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "panic": {
            "onText": "on",
            "displayName": "Pánico",
            "isNegativeTriggered": true,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        }
    },
    "status_code": "200",
    "success": "1",
    "hasUpdateDevicePrivileges": true,
    "state": {
        "enginecutoff": {
            "onText": "on",
            "displayName": "de Corte del Motor",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        }
    }
}

This endpoint retrieves event data of a specific device filtered by its unique identifier.

HTTP request

GET https://app.nukio.mx/api/v1/eventdata/devicemetadata/{deviceID}/{startTime}/{endTime}/authorization

URL parameters

Parameter Description
deviceID The ID of the device to retrieve
startTime The start time of the event data to retrieve in Epoch
endTime The end time of the event data to retrieve in Epoch

This endpoint retrieves latest event data of a specific device filtered by its unique identifier.

HTTP request

GET https://app.nukio.mx/api/v1/eventdata/latest/{deviceID}/authorization

URL parameters

Parameter Description
deviceID The ID of the device to retrieve

This endpoint retrieves data entire fleet filtered by time.

HTTP request

GET https://app.nukio.mx/api/v1/eventdata/fleetmetadata/{startTime}/{endTime}/authorization

URL parameters

Parameter Description
startTime The start time of the event data to retrieve in Epoch
endTime The end time of the event data to retrieve in Epoch

Create a device or geozone

Create a device



  curl -X POST 
    -H "Content-Type: application/json" 
    -H "authorization: jmvillarreal%7Capi%7Cals474rbcuka6b3045as0glr9q" 
    -d '{
          "uniqueid": "devunique9" , 
          "deviceID": "mydevice99"
            }' 
https://app.nukio.mx/api/v1/device/createdevice/authorization

The above command returns JSON structured like this:

{
    "deviceType": "",
    "deviceNotifyEmail": "",
    "status_code": "200",
    "deviceDescription": "New Device [mydevice99]",
    "pinColor": "FF0000",
    "deviceDriver": "",
    "deviceLastHeartbeat": 0,
    "deviceID": "mydevice99",
    "deviceDisplayName": "",
    "deviceCreatedOn": 1768964916,
    "authorities": {},
    "features": {
        "cargoaccess": {
            "displayText": "Cargo Access",
            "states": {
                "0": "Disallowed",
                "1": "Allowed"
            }
        },
        "enginecutoff": {
            "displayText": "Engine Cutoff",
            "states": {
                "0": "Disabled",
                "1": "Enabled"
            }
        }
    },
    "equipmentTypeId": "",
    "equipmentTypeDesc": "Default Mapping Template",
    "additionalPinDisplay": "",
    "sensors": {
        "cargoaccess": {
            "onText": "on",
            "displayName": "Cargo Access",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "fuel": {
            "onText": "on",
            "displayName": "Fuel Sensor",
            "isNegativeTriggered": true,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "enginecutoff": {
            "onText": "on",
            "displayName": "Engine Cutoff",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "ignition": {
            "onText": "on",
            "displayName": "Ignition",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "panic": {
            "onText": "on",
            "displayName": "Panic",
            "isNegativeTriggered": true,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        }
    },
    "success": "1",
    "deviceUnique": "devunique9",
    "hasUpdateDevicePrivileges": true,
    "hasPendingCommands": "false",
    "state": {
        "cargoaccess": {
            "onText": "on",
            "displayName": "Cargo Access",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        },
        "enginecutoff": {
            "onText": "on",
            "displayName": "Engine Cutoff",
            "isNegativeTriggered": false,
            "pendingState": null,
            "state": "0",
            "offText": "off"
        }
    },
    "pinTag": "",
    "fuelLevelAverage": null,
    "fuelLevels": []
}

Create a geozone



  curl -X POST 
    -H "Content-Type: application/json" 
    -H "authorization: jmvillarreal%7Capi%7Cals474rbcuka6b3045as0glr9q" 
    -d '{
          "geozoneID": "zone1"
            }' 
https://app.nukio.mx/api/v1/geozone/creategeozone/authorization

The above command returns JSON structured like this:

{
    "geozoneRadius": 500,
    "status_code": "200",
    "geozoneDepartureCabinLock": false,
    "geozonePoint6": "0.00000,0.00000",
    "geozonePoint5": "0.00000,0.00000",
    "geozonePoint4": "0.00000,0.00000",
    "geozonePoint3": "0.00000,0.00000",
    "geozonePoint8": "0.00000,0.00000",
    "geozonePoint7": "0.00000,0.00000",
    "geozoneDepartureCargoLock": false,
    "features": {
        "cargoaccess": {
            "displayText": "Cargo Access",
            "states": {
                "0": "Disallowed",
                "1": "Allowed"
            }
        },
        "enginecutoff": {
            "displayText": "Engine Cutoff",
            "states": {
                "0": "Disabled",
                "1": "Enabled"
            }
        }
    },
    "hasUpdateGeozonePrivileges": true,
    "geozoneArrivalCabinLock": false,
    "geozoneDisplayName": "",
    "geozoneArrivalCargoLock": false,
    "geozoneArrivalEngineOn": false,
    "geozoneDepartureCargoUnlock": false,
    "geozoneID": "zone1",
    "geozoneDepartureEngineOff": false,
    "geozoneType": 3,
    "sections": {
        "arrive": {
            "displayText": "Arrival",
            "features": {
                "cargoaccess": {
                    "onText": "on",
                    "displayName": "Cargo Access",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": null,
                    "offText": "off"
                },
                "enginecutoff": {
                    "onText": "on",
                    "displayName": "Engine Cutoff",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": null,
                    "offText": "off"
                }
            }
        },
        "depart": {
            "displayText": "Departure",
            "features": {
                "cargoaccess": {
                    "onText": "on",
                    "displayName": "Cargo Access",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": null,
                    "offText": "off"
                },
                "enginecutoff": {
                    "onText": "on",
                    "displayName": "Engine Cutoff",
                    "isNegativeTriggered": false,
                    "pendingState": null,
                    "state": null,
                    "offText": "off"
                }
            }
        }
    },
    "geozoneArrivalCargoUnlock": false,
    "geozoneArrivalEngineOff": false,
    "geozoneDepartureCabinUnlock": false,
    "geozonePoint2": "0.00000,0.00000",
    "geozonePoint1": "0.00000,0.00000",
    "success": "1",
    "geozoneArrivalCabinUnlock": false,
    "geozoneDepartureEngineOn": false,
    "geozoneAlertEntry": false,
    "geozoneAlertExit": false
}

This endpoint creates and update devices and geozones

HTTP request for device

POST https://app.nukio.mx/api/v1/device/createdevice/authorization

HTTP request for geozone

POST https://app.nukio.mx/api/v1/geozone/creategeozone/authorization

HTTP request body

A JSON formatted payload is required. The root element of the document must be data.

Properties

All properties are optional unless otherwise noted.

Device properties

Parameter Description
uniqueID integer
deviceID String required
sms String
deviceDescription String
deviceDriver String

Geozone properties

Parameter Description
geozoneID string required

Summary

Summary

Tag: auth

Access authorization

https://nukio.mx

Operation Description
POST /auth/login

Generates an authorization token.

GET /auth/logout/{accountID}/{userID}

Unauthorizes a token.

Tag: devices

Access device information

https://nukio.mx

Operation Description
GET /device/getalldevices/authorization

Get all devices for your account

GET /device/getdevice/{deviceID}/authorization

Get a device by deviceID

GET /device/getdeviceactivations/{deviceID}/authorization

Get recent activations for the deviceID

POST /device/createdevice/authorization

Create a new device

POST /api/v1/device/updatedevice/authorization

Create a new device

Tag: eventdata

Access eventdata information

https://nukio.mx

Operation Description
GET /api/v1/eventdata/devicemetadata/{deviceID}/{startTime}/{endTime}/authorization

Get device metadata for a time period

GET /api/v1/eventdata/latest/{deviceID}/authorization

Get latest event data for a device

GET /eventdata/fleetmetadata/{startTime}/{endTime}/authorization

Get fleet metadata for a time period

Tag: activations

Access activation information

https://nukio.mx

Operation Description
GET /events/activations/summary/authorization

Get activation information for your account

Tag: geozones

Access geozone information

https://nukio.mx

Operation Description
POST /api/v1/geozone/creategeozone/authorization

Create a new geozone

POST /api/v1/geozone/updategeozone/authorization

Update a geozone

Tag: routes

Access routes information

https://nukio.mx

Operation Description

Paths

Paths

Create a new device

POST /api/v1/device/updatedevice/authorization

Tags: devices

application/json

{
"deviceid": "demo_device",
"uniqueid": 11112222
}
uniqueid: integer

deviceid: string

sms: string

devicedescription: string

devicedriver: string

authorization

Token from the auth/login response

header string

200 OK

Device

Get device metadata for a time period

GET /api/v1/eventdata/devicemetadata/{deviceID}/{startTime}/{endTime}/authorization

Tags: eventdata

deviceID

Device ID of the device to get

path string
startTime

Start time or 0 for all

path string
endTime

End time or 0 for now

path string
authorization

Token from the auth/login response

header string
200 OK

status_code: string

eventdata: EventData

Get latest event data for a device

GET /api/v1/eventdata/latest/{deviceID}/authorization

Tags: eventdata

deviceID

Device ID of the device to get

path string
authorization

Token from the auth/login response

header string
200 OK

status_code: string

eventdata: EventData

Create a new geozone

POST /api/v1/geozone/creategeozone/authorization

Tags: geozones

application/json

authorization

Token from the auth/login response

header string
200 OK

Geozone

Update a geozone

POST /api/v1/geozone/updategeozone/authorization

Tags: geozones

application/json

authorization

Token from the auth/login response

header string
200 OK

Geozone

Generates an authorization token.

POST /auth/login

Tags: auth

application/json

{
"accountID": "demo",
"password": "apidemopass",
"userID": "apidemo"
}
accountID: string

userID: string

password: string

200 OK

{
"status_code": 200,
"success": 1,
"token": "demo%7Capidemo%7Ctqaua81k3k2b9n01b3c6pacanv"
}
status_code: string

success: string

token: string

Unauthorizes a token.

GET /auth/logout/{accountID}/{userID}

Tags: auth

accountID

Device ID of the device to get

path string
userID

Device ID of the device to get

path string

200 OK

Confirmation

Create a new device

POST /device/createdevice/authorization

Tags: devices

application/json

{
"deviceid": "demo_device",
"uniqueid": 11112222
}
uniqueid: integer

deviceid: string

authorization

Token from the auth/login response

header string

200 OK

Device

Get all devices for your account

GET /device/getalldevices/authorization

Tags: devices

authorization

Token from the auth/login response

header string
200 OK

Devices

Get a device by deviceID

GET /device/getdevice/{deviceID}/authorization

Tags: devices

deviceID

Device ID of the device to get

path string
authorization

Token from the auth/login response

header string
200 OK

Device

Get recent activations for the deviceID

GET /device/getdeviceactivations/{deviceID}/authorization

Tags: devices

deviceID

Device ID of the device to get

path string
authorization

Token from the auth/login response

header string
200 OK

status_code: string

eventdata: EventData

Get fleet metadata for a time period

GET /eventdata/fleetmetadata/{startTime}/{endTime}/authorization

Tags: eventdata

startTime

Start time or 0 for all

path string
endTime

End time or 0 for now

path string
authorization

Token from the auth/login response

header string
200 OK

status_code: string

eventdata: EventData

Get activation information for your account

GET /events/activations/summary/authorization

Tags: activations

authorization

Token from the auth/login response

header string
200 OK

status_code: string

eventdata: Activation

Schema definitions

Schema definitions

Activation: object

devices: EventData

Device: object

deviceType: string

deviceNotifyEmail: string

status_code: string

deviceDescription: string

deviceDriver: string

deviceLastHeartbeat: integer

deviceID: string

cargoUnlocked: string

deviceDisplayName: string

deviceCreatedOn: string

authorities: object

features: object

equipmentTypeId: string

equipmentTypeDesc: string

sensors: object

deviceEngineOff: string

success: string

deviceUnique: string

hasPendingCommands: string

cabinUnlocked: string

state: object

DeviceEventData: object

address: string

deviceDescription: string

creationTime: integer

latitude: integer

geozoneID: string

geozoneDescription: string

deviceID: string

speed: integer

statusDescription: string

geozoneDisplayName: string

statusCode: integer

longitude: integer

timestamp: integer

Devices: object

status_code: string

geozones: object

devices: Device

EventData: object

devices: DeviceEventData

Geozone: object

geozoneRadius: integer

geozoneDepartureCabinLock: boolean

geozonePoint6: string

geozonePoint5: string

geozonePoint4: string

geozonePoint3: string

geozonePoint8: string

geozonePoint7: string

geozoneDepartureCargoLock: boolean

features: object

geozoneArrivalCabinLock: boolean

geozoneDisplayName: string

geozoneArrivalCargoLock: boolean

geozoneArrivalEngineOn: boolean

geozoneDepartureCargoUnlock: boolean

geozoneID: string

geozoneDepartureEngineOff: boolean

geozoneType: integer

sections: object

geozoneArrivalCargoUnlock: boolean

geozoneArrivalEngineOff: boolean

geozoneDepartureCabinUnlock: boolean

geozonePoint2: string

geozonePoint1: string

success: string

geozoneArrivalCabinUnlock: boolean

geozoneDepartureEngineOn: boolean

Errors

The Nukio API uses the following error codes:

Error Code Meaning
400 Bad Request – Malformed request
401 Unauthorized – The provided API key is incorrect
404 Not Found – The specified resource could not be found
405 Method Not Allowed – A resource was access with an invalid method
406 Not Acceptable – Only JSON is supported by the API
422 Unprocessable Entity – The content of the request was invalid
500 Internal Server Error – There was an interal server error. Try again later
503 Service Unavailable – Server is temporarily unavailable