Webhooks allow you to receive real-time notifications when events occur in FeedbackEcho. This guide explains how to set up, secure, and handle webhook deliveries.
When you configure a webhook, FeedbackEcho sends HTTP POST requests to your specified URL whenever subscribed events occur. This enables you to:
When you create a webhook, a secret key is generated. This secret is used to verify that webhook deliveries are genuine. Copy and store the secret immediately - it won't be shown again.
After 5 failed attempts, the webhook will be marked as failed.
Use the X-FeedbackEcho-Delivery header to handle duplicate deliveries:
const processedDeliveries = new Set();app.post('/webhooks/feedbackecho', (req, res) => {
const deliveryId = req.headers['x-feedbackecho-delivery'];
if (processedDeliveries.has(deliveryId)) {
return res.status(200).send('Already processed');
}
// Process the webhook...
processedDeliveries.add(deliveryId);
res.status(200).send('OK');
});
Reject webhooks with old timestamps to prevent replay attacks:
const MAX_AGE_SECONDS = 300; // 5 minutesfunction isTimestampValid(timestamp) {
const now = Math.floor(Date.now() / 1000);
return Math.abs(now - parseInt(timestamp)) < MAX_AGE_SECONDS;
}
Use the "Send Test" button in the webhook settings to send a test payload:
{
"event": "test",
"webhook_id": "whk_abc123xyz",
"organization_id": "org_01HQXYZ",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"message": "This is a test webhook delivery from FeedbackEcho."
}
}
For local development, use a tunnel service like ngrok:
ngrok http 3000
Then use the ngrok URL as your webhook endpoint.
Webhooks are automatically disabled after 10 consecutive failures. To re-enable:
Need help? Contact us: