API Reference

Messages

A message is data transmitted from a connected device to a remote server or cloud platform. It may contain various types of information, such as GPS coordinates, sensor readings, status updates, alerts, and commands. The Hapn platform parses and processes device messages to generate trips, positions, status updates, and alerts. Users can access the raw message data collected by the cloud platform through the API. Messages are immutable and identified by a 128-bit unique message identifier, messageId.

Example

{
  "result": {
    "items": [
      {
        "type": "GTSOS",
        "gpsUTCTime": "20210817215336",
        "imei": "868239050345326",
        "latitude": 40.830866,
        "longitude": -74.117153,
        "odoMileage": 896,
        "sendTime": "2021-08-17T21:53:36.000Z",
        "messageId": "09e75b48-f04b-42b0-8ee1-e9c9eb5e8780",
        "speed": 0,
        "batteryPercentage": 81
      },
      {
        "type": "GTFRI",
        "gpsUTCTime": "20210817215336",
        "imei": "868239050345326",
        "latitude": 40.830866,
        "longitude": -74.117153,
        "odoMileage": 0,
        "sendTime": "2021-08-17T21:54:05.000Z",
        "messageId": "c89fcbfd-a35a-4e9f-921c-e3b7e51466d2",
        "speed": 0,
        "batteryPercentage": 81
      },
     ...
    ],
   }
}