A webhook is a mechanism that allows Samsara to send an HTTP request to your application when an event occurs. Webhooks exist in the Samsara Connected Operations Cloud as part of two features:
-
Alert Webhooks: Examples include geofence alerts and speeding alerts
-
Event Subscriptions: Examples include document submitted and vehicle updated
View the Webhooks page on the Samsara developer site for more information about how to configure secure webhooks in your dashboard or using our API.
If your network settings restrict access for inbound connections, you must allow inbound traffic from IP addresses to receive Webhook events from Samsara.
You can view the list of static IP addresses in the Samsara dashboard (Settings > Webhooks).
Learn more about managing network access for Webhooks on our developer site.
Samsara expects your webhook endpoint to return an HTTP 2xx status code to confirm receipt of each notification. Any 2xx status, including 202 Accepted, is a successful delivery. Samsara does not retry a successful delivery.
If your endpoint does not respond within 10 seconds, or returns an HTTP status of 400 or higher, Samsara treats the attempt as a delivery error. Samsara retries the same notification with exponential backoff, up to five attempts. After five failed attempts, Samsara does not retry that notification.
If your endpoint returns a redirect (HTTP 3xx), Samsara treats the attempt as a delivery error and does not retry the notification.
Tip
Return a 2xx response as quickly as possible. Do longer-running processing asynchronously in the background.
You can view webhook activity in Developer Metrics.
On the Webhook Traffic tab, you can review delivery attempts from the past 7 days, including HTTP status codes. You can filter by status code, webhook name, and payload source. Success rate is the percentage of 2xx responses.
If a delivery times out, the attempt is recorded with status code 499.
You can disable or re-enable a webhook from Settings > Webhooks.
While a webhook is disabled, Samsara does not send new events to that webhook. After you re-enable the webhook, Samsara resumes delivery for new events. Events that occurred while the webhook was disabled are not sent.
Comments
0 comments
Please sign in to leave a comment.