API Reference
Alerts
Alerts
The Hapn platform incorporates a robust alert mechanism designed to notify users promptly when significant events occur, such as Speeding
, Boundary entry and exit
, Movement
, Device battery level
and more.
These alerts can be customised by users according to their preferences. Users have the flexibility to choose their preferred notification methods or opt out entirely. There are four primary notification channels available:
- SMS
- Push notifications for mobile applications
- Websocket for web application
Additionally, certain alerts offer configurable thresholds, allowing users to tailor them to their specific needs. For instance, the Speeding
alert permits users to set a maximum speed threshold, beyond which the alert will be triggered.
These settings can be managed by user, using the API.
{
"alertName": "Speeding",
"alertValue": "137",
"smsNotification": false,
"emailNotification": true,
"appNotification": false,
"pushNotification": true,
"alertMetadata": "alertMetadata"
}
Alerts restrictions
By default, alerts are continuously processed and can notify at any hour of the day. However, this standard behavior might prove to be excessively disruptive for certain large accounts with a considerable amount of users. In such cases, a more sophisticated logic can be implemented to reduce this noise.
With the help of the API, users can establish custom alert restrictions to specify, for example, a time windows during which the alerts should be processed. This allows for greater control over when alerts are triggered, enabling users to tailor the system to their specific needs and preferences.
Alerts restrictions can be set by user, which come in two forms:
- Global. Theses restrictions apply to every tracker within the customer account.
- By device. Theses restrictions apply to individual trackers, affecting only designated devices.
An illustration of a custom alert restriction is provided below. In this case, the Speeding
alert for a particular user is limited to processing only from Monday to Friday, between 8 AM and 4 PM.
{
"alertName": "Speeding",
"userId": "2a75189d-b5f4-4be6-9b3b-0552615e4494",
"clientId": 123,
"weekDaysSelection": "0111110",
"startTime": "08:00",
"endTime": "16:00",
"type": "global",
"label": "Between 8:00 AM and 4:00 PM"
}
Endpoints
The Hapn API enables users to configure their alert settings and also establish custom alert restrictions.
- Get User Alert Settings Fetch the user alerts settings by user id.
- Update User Alert Settings Update the alert settings of a user.
- Create Custom Alert Restriction
- Get all the Custom Alert Restrictions
- Get the User Custom Alert Restrictions
- Update Custom Alert Restriction
- Delete a Custom Alert Restriction
Create a custom alert restriction for a specific user or all the users of the current account.
Get all the custom alert restrictions for all the users of the current account.
Get all the custom alert restrictions for the current user.
Update part of a custom alert restriction.
Delete a custom alert restriction.
On This Page