API Reference
Webhooks
Webhooks
Webhooks offer an efficient way to receive real-time notifications about events in the Hapn platform. Instead of constantly polling API endpoints for updates, developers can subscribe to specific events and receive notifications as they occur. This greatly reduces unnecessary API calls and allows for more efficient use of resources.
Using the Webhooks API, developers can subscribe to events such as when a new location is updated, when a device enters or exits a specific area, or when a speeding alert is detected. In addition to reducing the number of API calls, Webhooks also provide more timely and accurate data. By receiving real-time notifications about events, developers can quickly take action and make informed decisions based on the latest data.
To get started with our Webhooks API, simply subscribe to the desired events and specify the endpoint for receiving notifications. Our platform will then send an HTTP request to the specified endpoint with the event payload.
The following example shows the payload of an ignition event.
Example
{
"messageId": "cb44ad2a-6096-4a37-93a9-41b4882593e9",
"imei": "015181000393760",
"type": "GTVGN",
"sendTime": "2020-02-25T18:09:10.000Z",
"gpsUTCTime": "20200225180852",
"latitude": 26.111229,
"longitude": -81.757925,
"odoMileage": 2918.4,
"speed": 0,
"batteryPercentage": 88,
"ignition": "ON"
}
Endpoints
Manage webhooks through the following endpoints:
- Get Webhooks Get a list of all the webhook subscriptions in the account.
- Create Webhook Create a new webhook subscription.
- Delete Webhook Delete an existing webhook subscription.
- Update Webhook Update an existing webhook subscription.