User guide for version 7.10
Previous versions: 7.9 | 7.8 | 7.7
×

Get the latest vehicle event

The API returns the latest event for a vehicle from the preceding 24 hours.
The method supports account mapping: a user can retrieve an event for a vehicle from a mapped account if the user has access to that vehicle.

How to get data

Method

GET

Request address

Use the following address to retrieve the data: https://<server_address>/api/v3/events/live
Replace <server_address> with the PILOT server address.

Request parameters

Add the following parameter to the request address:
  • agent_id — the vehicle identifier in PILOT.
The vehicle must be available to the authenticated user.
 

Example request

GET https://<server_address>/api/v3/events/live?agent_id=2000
Authorization: Bearer <token>
X-Node: 0

Response

{
  "code": 0,
  "msg": "OK",
  "events": [
    {
      "Cotract Number": 1102,
      "Company Name": "Boooch Test",
      "AgentId": 2000,
      "VehicleID": "10-14262 Sunny",
      "Road Type": "Blacktop",
      "EventID": 4531206,
      "Event Type": 103,
      "Event Message": "SpeedN|110|>|112|10|ss|17",
      "Event Start Time": 1785746496,
      "Event Start Speed": null,
      "Event Start location": {
        "lat": "25.164997",
        "lon": "55.235535"
      },
      "Event End Time": null,
      "Event duration": null
    }
  ],
  "process_time": 0.0222
}
The API response contains:
  • code — the request result code. A value of 0 indicates that the request was successful
  • msg — the request result
  • events — an array of the events found
  • process_time — the request processing time in seconds
The events array contains:
  • Cotract Number — the identifier of the account to which the vehicle belongs
  • Company Name — the account name
  • AgentId — the vehicle identifier in PILOT
  • VehicleID — the vehicle name
  • Road Type — the road surface type. The current version returns Blacktop
  • EventID — the event identifier
  • Event Type — the event type
  • Event Message — the event message
  • Event Start Time — the event start time as a Unix timestamp
  • Event Start Speed — the speed at the beginning of the event. If the data is unavailable, the method returns null
  • Event Start location — the vehicle coordinates at the beginning of the event:
  • lat — latitude
  • lon — longitude
  • Event End Time — the event end time as a Unix timestamp. If the data is unavailable, the method returns null
  • Event duration — the event duration in seconds. It is calculated as the event end time minus the event start time. If either value is unavailable, the method returns null