intelliFleet360 REST API

Our REST API provides programmatic access to your fleet data, allowing you to build powerful integrations and custom applications.

The API is organized around REST principles, uses predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

The base URL for all API requests is: https://api.intelliFleet360.co.ke/v1

Authentication

The intelliFleet360 API uses API Keys to authenticate requests. Provide your API key in the Authorization header as a Bearer token.

GET/vehicles

Returns a list of all vehicles associated with your account.

GET/trips

Returns a list of historical and ongoing trips for your vehicles.

MQTT Integration for Vehicle Telematics Devices (ADAS & DMS)

This documentation provides step-by-step guidelines for manufacturers and software developers to enable their telematics devices to securely and effectively communicate with our MQTT server.

All device manufacturers must follow these requirements for seamless integration, message handling, and event video uploads. Upon registration, you will receive credentials for both MQTT and FTP access.

Version 1.0.4 - 2025-07-15
Strict compliance with these specifications is required for platform compatibility.

General Device Requirements

Before integrating MQTT communication, ensure your device complies with the following:

  • Cameras: Minimum 2 cameras (ADAS & DMS).
  • Storage: Internal storage must retain all data and videos for at least 7 days. Files should use readable formats such as JSON or XML.
  • Time: All timestamps and date-time values must be in UTC, and device clocks must not deviate more than ±3 seconds from actual UTC time.
  • Video Recording: Continuous video recording from all cameras for 7 days. Video files must be segmented at 1-minute intervals.
  • Speed: All speed values must be in KM/H.
  • Communication: All communication with the MQTT broker must be in JSON format over a secure (SSL/TLS) connection.

Reference Tables

Camera ID Table

Cam ID Description Requirement
1 ADAS (Front) Required
2 DMS (Driver) Required
3-8 Extra Cameras Optional

Event Reference

Type Event ID Name Description
ADAS 0 No warning event No event
ADAS 1 Forward collision detection Forward collision detected.
ADAS 2 Pedestrian detection Pedestrian detection
ADAS 3 Lane departure detection Lane departure detection
ADAS 4 Traffic sign recognition Traffic sign recognition
ADAS 5 ADAS Camera Occlusion ADAS Camera Occlusion
ADAS 6 Driver abnormal alarm No driver or driver not seated correctly
ADAS 7 Undesignated Driver Unapproved driver (ID/face recognition)
G-sensor 8 Harsh braking Harsh braking
G-sensor 9 Harsh acceleration Harsh acceleration
G-sensor 10 Harsh cornering Harsh cornering
DMS 11 Phone Use Driver using mobile phone
DMS 12 Driver smoking Driver smoking
DMS 13 Distracted driving Distracted driving
DMS 14 No Seatbelt Seat belt not worn
DMS 15 DMS Camera Occlusion DSM Camera Occlusion
DMS 16 Driver Yawning Driver Yawning
DMS 17 Driver Eyes closed Driver Eyes closed
other 18 System disconnection System disconnection
other 19 Power supply disruption Power supply disruption
other 20 Data transmission interference Interference with data transmission

Credentials

You will receive the following credentials upon successful registration:

  • MQTT Hostname & Port
  • MQTT Username & Password
  • FTP Hostname, Port
  • FTP Username & Password
  • SSL Certificates

MQTT Topics and Messaging

PUBLISHdevice/messages-1

  • Connect: Publisher
  • QoS: 0
  • Action: Publish live device data every 30 seconds or immediately upon event triggered.
  • Response: None

Conditions

  • Event-triggered videos must be uploaded to FTP path "/event/<IMEI>"
  • Timestamp in JSON and video filename must match for events

Field Descriptions

Field Type Description
ident String Device unique identifier (IMEI)
device.name String User-assigned name (e.g., vehicle number)
gsm.sim.imsi String SIM IMSI
gsm.sim.iccid String SIM ICCID
timestamp Int UTC seconds since epoch
position.altitude Number Altitude in meters
position.latitude Decimal Latitude
position.longitude Decimal Longitude
position.direction Decimal Heading angle (degrees)
position.speed Int Speed in KM/H
position.satellites Int Number of GPS satellites used
gsm.signal.level Number GSM signal percentage
access.technology String LTE/3G/2G/etc.
device.temperature Int (Optional) °C
engine.ignition.status Boolean Engine on/off
warning.event.id Number See Event Reference table
adas.cal.state Boolean ADAS calibrated?
dms.cal.state Boolean DMS calibrated?
storage_size Number SD card size (GB)
software_version String Firmware version
camX_status Boolean 1 = working, 0 = not connected (for cams 1-8)
sdcard_status Boolean SD card/TFC present and working?
tempering Boolean Device tampering status
gps_status Integer Number of satellites connected

Device Commands

SUBSCRIBEdevice/commands/<IMEI>

Devices must subscribe to their unique command topic to receive instructions from the server. QoS should be set to 1.

Command: Upload Live Snapshot

  • QoS: 1
  • Action: Device captures a live snapshot from the specified camera and uploads it to the given FTP path
  • FTP Path: /snapshoot/<IMEI>
  • Format: JPG
  • Response: Required
{
    "upload_live_snapshot": {
        "upload_path": "/snapshoot/863819070001762",
        "cam_id": 1,
        "filename": "63hs72kd93j.jpg",
        "job_id": 1
    }
}

Command: Upload Video

  • Action: Device uploads all videos stored on the device between "from_time" and "to_time" to the target FTP path
{
    "upload_video": {
        "upload_path": "/video/863819070001762",
        "cam_id": 1,
        "from_time": "20250630160500",
        "to_time": "20250630160600",
        "name_prefix": "m8vsndjcda_",
        "job_id": 23
    }
}

Command: Start Live Streaming

  • Action: Device starts streaming video to the target RTMP server
{
    "start_live_stream": {
        "cam_id": 1,
        "stream_uri": "rtmp://138.2.32.9/live/j7s93jhf893klsd",
        "job_id": 7
    }
}

Command: Stop Live Streaming

  • Action: Device stops streaming video to the target RTMP server
{
    "stop_stream": {
        "job_id": 23
    }
}

Command: Request Screenshot

  • Action: Device uploads screenshot of the specified camera at specific time and uploads it to the given FTP path
  • FTP Path: /screenshot/<IMEI>
  • Format: JPG
{
    "upload_screenshot": {
        "upload_path": "/screenshot/863819070001762",
        "cam_id": 1,
        "filename": "63hs72kd93j.jpg",
        "screenshot_time": "202505101805620",
        "job_id": 47
    }
}

Command Response

PUBLISHdevice/response/

  • Connect: Publisher
  • QoS: 1
  • Action: Device response to a command
  • Description: Respond to any action or command (e.g., upload snapshot/video)

Response Examples

Success Response:

{
    "status": true,
    "description": "successfully uploaded the snapshot",
    "job_id": 1
}

Failure Response:

{
    "status": false,
    "description": "error uploading snapshot",
    "job_id": 1
}

File Storage and Naming

Loop Videos

  • Duration: Each file must be max 1 minute
  • Format: MP4 (H265 video, ACC audio)
  • FTP Upload Path: /video/<IMEI>
  • Naming Format: [name_prefix]_[00-99]
  • Video Watermark: Date/time (YYYY-MM-DD HH:MM:SS), latitude, longitude, speed

Examples:

  • Single file: m8vsndjcda_01.mp4
  • Multiple files: m8vsndjcda_01.mp4, m8vsndjcda_02.mp4, m8vsndjcda_03.mp4

Event-triggered Videos

  • Duration: Max 15 seconds (5s before, 10s after the event)
  • Format: MP4 (H265 video, ACC audio)
  • FTP Upload Path: /event/<IMEI>
  • Naming Format: CAM-ID_EVENT-ID_YYYYMMDD_HHMMSS.mp4
  • Video Watermark: Date/time (YYYY-MM-DD HH:MM:SS), latitude, longitude, speed

Example: 01_3_20250630_132705.mp4 (Event 3, CAM-ID 1, June 30, 2025, 13:27:05)

Auto-Upload Required: Videos must be uploaded automatically for Forward collision detection (Event ID: 1) and Phone Use (Event ID: 11).

Best Practices

  • All communication must use secure (SSL/TLS) connections
  • Do not exceed the specified timing for message publishing and subscription checks
  • Always match filenames and timestamps for loop and event-triggered videos
  • Ensure all files are uploaded to the correct FTP directory structure

Troubleshooting

  • Ensure your device is synchronized to UTC and maintains the ±3 second margin
  • Double-check camera IDs and file naming conventions
  • Validate that all responses to MQTT commands are properly acknowledged
  • Refer to field descriptions and sample JSON for correct data formatting

Support

For further integration assistance or credential issues, please contact our technical support team after registering your device(s) on our platform.

Quick Reference

MQTT Topics Summary

Topic Purpose Details
device/messages-1 Publish Device Data Publish every 30s or on event trigger, QoS 0
device/commands/<IMEI> Receive Commands Subscribe for all device commands, QoS 1
device/response/ Command Response Publish responses to commands, QoS 1

FTP Upload Paths

Content Type Path Description
Event Videos /event/<IMEI> Event-triggered videos (max 15s)
Continuous Videos /video/<IMEI> Loop videos (max 1 minute each)
Live Snapshots /snapshoot/<IMEI> Real-time camera snapshots
Screenshots /screenshot/<IMEI> Historical screenshots

File Naming Conventions

  • Event Videos: CAM-ID_EVENT-ID_YYYYMMDD_HHMMSS.mp4
  • Loop Videos: [name_prefix]_[00-99].mp4
  • Snapshots/Screenshots: Custom filename with .jpg extension