API Reference
Messages
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
},
...
],
}
}
Endpoints
Fetching device messages provides access to the raw data generated by a device as soon as it is parsed by our platform, before any processing occurs:
- Get Messages Get messages from multiple devices on the account over a period of time.
- Get Device Messages Get the messages sent by a device over a period of time.