Webhooks
A webhook sends events to your server as they happen: a message delivered or failed, a reply received, a phone going offline. Instead of asking the API for news, your server gets a signed POST within seconds. The payloads, headers and retry schedule are in the Webhooks guide.
Add an endpoint
Section titled “Add an endpoint”-
Open Webhooks in the sidebar under Developers.
Open Webhooks. -
Click Add webhook. If your plan’s limit on webhook endpoints is reached, the button is dimmed and says why; see Plan and usage.
Click Add webhook. -
Enter the Endpoint URL. It must be a public
https://address; private and local addresses are refused. Under Events, tick the events you want.message.delivered,message.failedandmessage.receivedare ticked to start with; Select all ticks every event. Click Add endpoint.Enter the URL, pick the events and click Add endpoint. -
Copy the Signing secret (it starts with
whsec_) and store it with your server’s configuration, then click I’ve stored it. It is shown only once. Your server uses it to check that each request really came from SMSFabric.Copy the signing secret.
Send a test event
Section titled “Send a test event”-
Click the endpoint in the list.
Open the endpoint. -
Click Send test event. A test delivery goes out, signed like a real one, and appears under Recent deliveries a moment later. Use it to check that your endpoint answers
2xxand that its signature check passes. Deliveries on pauses and resumes the endpoint without deleting it.Click Send test event.
Read the deliveries and replay a failure
Section titled “Read the deliveries and replay a failure”Each row under Recent deliveries is one event sent to this endpoint.
| Column | Shows |
|---|---|
| Event | The event type, such as message.delivered, and under it when the event happened |
| Result | succeeded, pending (a retry is scheduled) or failed, with the HTTP status your endpoint returned, and under it how many tries were made. A delivery is retried with backoff for about 24 hours, 8 attempts in all. |
-
When your endpoint was down or had a bug, fix it first, then click the replay button at the end of a failed row.
Click replay on the failed delivery. -
The delivery is queued again and goes out within a few seconds. It carries the same event ID, so a server that deduplicates on the ID won’t process it twice.
The delivery is queued again.
Delete an endpoint
Section titled “Delete an endpoint”Open the endpoint and click Delete endpoint, then type delete to confirm. Pending retries are dropped and its signing secret stops working. To stop deliveries for a while instead, turn off Deliveries on.
Read the endpoint list
Section titled “Read the endpoint list”| Column | Shows |
|---|---|
| Endpoint | The URL |
| Events | How many events it receives, or All events. Hover to see them. |
| Status | Enabled or disabled |
| Last delivery | When the last event was sent to it |
Who can manage webhooks
Section titled “Who can manage webhooks”Managing webhooks needs webhooks:manage, which the Owner, Admin and Developer roles have. See Team.