Pass query parameter while making POST request from twilio webhook

609 Views Asked by At

When the call ends, I want to send data to Microsoft teams. For that purpose, I am making a POST request using the Twilio webhook. I have added the link for HTTP request in CALL STATUS CHANGES. But I also want to send data collected during calls. Is there any way to do that?

Article here(https://www.twilio.com/docs/usage/webhooks/voice-webhooks) doesn't mention anything about passing data.

My POST request URI looks something like this:- https://xyz?Name=Himanshu&Phone=1234567890

I want Name and Phone data to be collected from Memory.

1

There are 1 best solutions below

6
On

Twilio developer evangelist here.

When Twilio sends a webhook request about a voice call it will send a whole bunch of parameters including CallSid, To, From (the number user called from), AccountSid, CallStatus and more all of which are listed here.

I would not recommend making the Twilio webhook directly to Microsoft Teams as Twilio expects there to be a response to the request. Also, Twilio cannot know the name of your caller either.

Instead, I would recommend setting up the webhook request to go to your own application where you can parse out the data you need from the request, collect other data like name, and then make the request to Teams to complete your interaction.