# Code Samples Use the code samples below to integrate your applications with the API. ## Node ### Get aligned transcript using a webhook This example requires the [Express framework](https://expressjs.com/). The following example demonstrates how to implement a webhook handler that receives and parses the HTTP POST message from the Rev AI API and sends an email notification using Express and the Twilio SendGrid API client. To use this example, you must first replace three placeholders: - `` and `` for the sender and recipient email addresses; and - `` for the Twilio SendGrid API key. ```javascript const bodyParser = require('body-parser'); const express = require('express'); const sendgrid = require('@sendgrid/mail'); // Twilio SendGrid API key const sendgridKey = ''; // sender email address const senderEmail = ''; // recipient email address const receiverEmail = ''; // set API key for SendGrid sendgrid.setApiKey(sendgridKey); // create Express application const app = express(); app.use(bodyParser.json()); // handle requests to webhook endpoint app.post('/hook', async req => { const job = req.body.job; console.log(`Received status for job id ${job.id}: ${job.status}`); const message = { from: senderEmail, to: receiverEmail, subject: `Job ${job.id} is COMPLETE`, text: job.status === 'completed' ? `Forced alignment job is completed` : `An error occurred` }; try { await sendgrid.send(message); console.log('Email successfully sent'); } catch (e) { console.error(e); } }); // start application on port 3000 app.listen(3000, () => { console.log('Webhook listening'); }) ```