Set up your SMS webhook endpoint
Creating the endpoint on your server and registering it on the platform.
Last updated
1. Create the endpoint
- Accept POST requests
- The URL must be public HTTPS: http:// and local or private addresses are refused. To test from your machine, use a tunnel such as ngrok
- Reply with a status between 200 and 299 to confirm receipt
- Reply quickly: the timeout is 5 seconds
const express = require("express");
const crypto = require("crypto");
const app = express();
app.use(express.json());
// the URL you register on the Webhooks page
const ENDPOINT = new URL("https://example.com/webhooks/droidsender");
app.post(ENDPOINT.pathname, (req, res) => {
// reply first, process afterwards: the timeout is 5 seconds
res.sendStatus(200);
handle(req.body);
});
app.listen(3000);2. Register it on the platform
- Open the Webhooks page
- Click New webhook
- Give it a name and the endpoint URL
- Pick the events you want to receive