API Reference
Users
Users
In the Hapn platform, users can interact with devices through secure access to the web and mobile apps, as well as through notifications and alerts. A Hapn account supports multiple users, and each user may have access to different groups of devices. Access can be managed from the applications or through the API, which provides fine-grained control over which devices each user can access.
User Invitations
Creating users via the API or in any automated way is not possible. Instead, a user can be invited to an existing account via email. Only the recipient of the email can go through the user registration flow. Using the Hapn API, you can invite users to the account or cancel an existing invitation.
User Resources
User access can be restricted to a subset of devices. This limits what devices users can see on the map and what notifications they receive. The access level can also define how far back users can view device data and whether they have access to boundaries or not.
User Settings
User settings allow configuration of the date and time, metrics, and visualization behaviors used when presenting information in the system. Whenever a setting for a given user needs to be updated, at least one setting must be provided.
Example:
{
"defaultMapLayer": "streets",
"speedUnits": "mph",
"distanceUnits": "mi",
"homepage": "trackers",
"alertsNotificationsOn": true,
"temperatureUnits": "F",
"timeZone": "US/Central"
}
User Alert Settings
User alert settings allow you to configure the alert value and notification channels (email, SMS, app, or push) for each alert type that will be used when the alert is raised. Whenever you need to update an alert setting for a user, at least one alert setting other than alertName
must be provided.
Example:
{
"alertName": "Speeding",
"alertValue": "137",
"smsNotification": false,
"emailNotification": true,
"appNotification": false,
"pushNotification": true,
"alertMetadata": "alertMetadata"
}
Endpoints
The Hapn API allows to invite users to an existing account, manage invitations, user access, and settings:
- Create User Invitation Creates a new user invitation and sends an email with the instructions to create a new account.
- Delete User Invitation Deletes an existing user invitation. Only pending invitations can be deleted.
- Update User Access Updates the resources a user has access to.
- Deactivate User Deactivates an existing user. Only active users can be deactivated.
- Get User Settings Fetch user settings in the account by user id.
- Update User Settings Update the settings of a user.
- Get User Alert Settings Fetch the user alerts settings by user id.
- Update User Alert Settings Update the alert settings of a user.
- Get User Resources Fetch the list of imeis and boundaries ids by user id.