Setting up
Creating the endpoint on your server and registering it on the platform.
1. Create the endpoint
- Accept POST requests
- Use HTTPS in production
- Reply with a status between 200 and 299 to confirm receipt
- Reply quickly: the timeout is 10 seconds
javascript
const express = require("express");
const crypto = require("crypto");
const app = express();
app.use(express.json());
app.post("/webhooks/droidsender", (req, res) => {
// reply first, process afterwards: the timeout is 10 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
Automatic deactivation
After 15 consecutive failures the webhook is deactivated and stops receiving events. Fix your server and reactivate it on the Webhooks page. You can ask to be warned by SMS when that happens.