2
votes

I am designing an IVR with Twilio studio, so it remains modular and flexible. At some point I have to use the widget "http request" to an external application. When I complete the widget, if I select content type "Application/JSON" instead of "Form URL Encoded" (this is needed by my external application), then the field of the hearders dissapears and it is not possible annymore to specify a Authorization/Bearer like a normal POST request. If I switch back to "From URL encoded", then the field appears again.

Is this a bug ? is this a feature ? do I do something wrong ?

I have been through all the doc I found (Twilio, stack overflow; google), and I tried to switch from Chrome and Firefox, but it remains the same.

Anybody an idea please ?

NB I think I can solve this by creating a backend app like a Twilio function that can be called by a post without authorization bearer and it will do the POST of my JSON to the external app (with authorization and bearer, hardcoded inside the function). But then I could better stop using twilio studio and code everything in the function ... what I wanted to avoid. Thx in advance

1

1 Answers

4
votes

Twilio developer evangelist here.

The parameters that you can add to the HTTP request widget are body parameters, not headers. So you can't achieve this with either style of HTTP request.

Instead, I would recommend using the Twilio Function widget to make the request to your external application. You don't need to use an HTTP widget in the middle there, you can do it straight in the Function. The Function can then handle your custom HTTP request and pass the details back to the Studio flow as long as it responds with JSON.