0

I'm using Twilio Studio. Within I'm using the Make HTTP Request widget to hit an api endpoint.

After that I'm using a Say/Play widget to say one of the variables from Make HTTP Request. {{widgets.http_1.body}} works fine with api response:

{ "message": "Hello World", "completed": true }

However, if I want to return {{widgets.http_1.parsed.message}} the say text portion for this will be empty.

What might be wrong here? I can see the endpoint I hit with the Make HTTP Request step returns a 200 & the json is valid.

Flow - Make HTTP Request - Say Widget

  • Nginx was also sending a default header of application/octet-stream. Once this was removed and application/json was substituted everything worked great. – superlow burn Feb 09 '22 at 13:38
  • You can find more details about how you can parse the HTTP json response here https://www.twilio.com/docs/studio/widget-library/http-request#how-to-access-variables-from-your-http-response – Popa Andrei Mar 06 '23 at 15:31

1 Answers1

2

Twilio developer evangelist here.

Your screenshot of the Say widget shows that you are using {{ widgets.http_1.body.parsed.message }}. When using the parsed data, you don't need the body in there, so it should just be:

{{ widgets.http_1.parsed.message }}
philnash
  • 70,667
  • 10
  • 60
  • 88