API Reference
Devices
Devices
A Hapn device is an electronic hardware that receives signals from GPS satellites and calculates its location. It typically consists of a GPS receiver, a cellular modem, and a battery. The GPS receiver uses satellite signals to calculate the device's location, while the cellular modem allows it to transmit its location and other data to the Hapn platform. The battery powers the device, enabling it to operate for extended periods without needing to be charged. Hapn devices come in different sizes and shapes, depending on their purpose. Some are small and intended for personal tracking, while others are large enough to be installed in a vehicle or shipping container.
Hapn devices are mainly used for tracking and monitoring the location of vehicles and assets, but they can also collect other information such as speed, altitude, and equipment data. These features make them useful for businesses that need to track their assets.
Identifying a Device
Hapn devices use an IMEI number to identify each device. An IMEI is a 15-digit code uniquely assigned to every mobile device that uses cellular networks. Therefore, every Hapn device has its own unique IMEI number. The number is usually printed on the device itself.
Example
{
...
"result": {
"imei": "862785041422448",
"clientId": 6278789,
"created": "2020-06-02T20:48:24.494Z",
"modified": "2021-06-10T11:13:59.864Z",
"name": "Van #2",
"status": "A",
"iccid": "8944500204198462404",
"color": "#579db5",
"icon": "location-arrow",
"description": "Delivery Van #2",
"model": {
"name": "OBD Vehicle Tracker",
"description": "OBD GPS Tracker for Vehicles",
...
},
"connectivityProvider": "T-Mobile",
"appUrl": "https://app.gethapn.com/home?tab=trackers&type=tracker&imei=862785041422448"
}
}
Endpoints
The Hapn API provides several endpoints to retrieve information about a particular device or group of devices. When making API requests, the device's IMEI is used as the identifier:
- Get Devices Get a list of all the devices in the account.
- Get Device Fetch a device in the account by IMEI.
- Get Device Status Get the latest known status of a device. A device status contains the last batch of data received from the device. This can include the GPS location, battery level, speed, and altitude, among other data points.
- Update Device Update a device's name and description.
On This Page