Webhooks
Interactive webhook endpoint builder
Learn how to set up and deploy a webhook to listen to events from Awell!
Select the webhooks you would like to listen to and copy/paste the corresponding code.
01const express = require('express');02const app = express();0304// If you are using Express v4 - v4.16 you need to use body-parser, not express, to retrieve the request body05app.post('/awell-webhooks', express.json({type: 'application/json'}), (request, response) => {06 const event = request.body;0708 // Handle the event09 switch (event.event_type) {10 default:11 console.log(`Unhandled event type ${event.event_type}`);12 }1314 // Return a response to acknowledge receipt of the event15 response.json({received: true});16});1718app.listen(8000, () => console.log('Running on port 8000'));