Twilio Voice - Can't Get req.body In WebApp.handlers.use()? [SOLVED]

I’m working on getting Twilio Voice working with my app. Code on the client pings their server, which then sends a POST request to your server endpoint, including the ‘to’ phone number or customer id in the body.

My endpoint is hit, but req.body is “undefined”:

WebApp.handlers.use('/voice', async (req, res, next) => {
    //this code executes:
    console.log('req?.body: ', req?.body) //logs "req?.body:  undefined"
    [.....]
});

How can I capture the POST request parameters?

Fixed:

import bodyParser from "body-parser";

WebApp.handlers.use(bodyParser.urlencoded({ extended: true }));
WebApp.handlers.use(bodyParser.json());
1 Like