๐ Afaqy Knowledge Base / AVL / Messages / API Documentation
<aside> CONTENTS
</aside>
This flow describes how to integrate your system with the AVL Message Module from authentication to signal mapping.
sensors to true to receive sensor data.prms or root-level keys) and map sensor IDs to names from extra.sensors.value or cValue as needed for meaningful readings.Endpoint
POST <https://api.afaqy.sa/auth/login>
Request Body
{
"data": {
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"
}
}
Response
{
"status": "success",
"message": "Login successful",
"data": {
"token": "YOUR_JWT_TOKEN"
}
}
Endpoint
POST <https://api.afaqy.sa/units/lists>
Request Body
{
"data": {
"offset": 0,
"limit": 1000,
"projection": ["basic", "last_update", "driver"]
}
}
Response Fields
_id โ Unit unique IDname โ Unit namelast_update.dtt โ Last update timestamp (ms)last_update.lat / last_update.lng โ Latest coordinatesdriver.name โ Driver assigned to the unitEndpoint
POST <https://api.afaqy.sa/units/signals>
Request Body Example
{
"data": {
"unit_id": "UNIT_ID_HERE",
"date": {
"interval": "interval",
"from": "2025-08-10 00:00:00",
"to": "2025-08-10 23:59:59",
"interval_count": 1,
"interval_unit": "minutes",
"including_current": false},
"message_type": "data_messages",
"message_options": "parameters",
"parameter": "raw_data",
"limit": 1000,
"offset": 0,
"sensors": true,
"with_extra": true}
}
extra.sensors section, youโll find a mapping of sensor IDs โ sensor names.Example:
"extra": {
"sensors": {
"6823325e71b9d5ce20b25d7": "ACC",
"6823325e71b9d5ce20b25d9": "Vehicle Battery",
"6823325e71b9d5ce20b25db": "Device Battery"
}
}
sensors object of the message payload.sensors object in the main message:"sensors": {
"6823325e71b9d5ce20b25d7": {
"prm": 0,
"value": "OFF",
"cValue": "0"
}
}
Field meanings:
prm โ raw numeric value from the device.value โ human-readable meaning of the reading.cValue โ calibrated numeric value after applying sensor calibration rules.sensors.extra.sensors to find the sensorโs name.value or cValue depending on whether you want calibrated data or raw readings.prm can be used if you need the raw device output for custom processing.spd, lat, lng, altitude, ang) appear directly at the root of the message.sensors object and require mapping via extra.sensors.| Parameter | Purpose |
|---|---|
unit_id |
Selects the unit to query. |
from |
Start datetime for the data range. |
to |
End datetime for the data range. |
sensors |
Must be true to return sensors data in the payload. |
limit and offset) if you expect large datasets.sensors is enabled in requests when mapping is required.