How to get survey result from Twilio Studio demo

Hi all,
I am working on "Conduct a Survey with Twilio Studio" Demo
However, I couldn't figure out the last part, using HTTP REQUEST widget to the survey result.
I tried the "Automated Survey with Node.js and Express", this one will show you a JSON file in http://localhost:3000/results

But for "Conduct a Survey with Twilio Studio" I am wondering is there any way to get a JSON file like the Automated Survey

Also, I am confused what should I put in the REQUEST URL

Thank you so much!


Best Answer

  • pnash
    pnash mod
    Answer ✓

    There is! If you open your Studio Flow in the console there is a link in the sidebar to the logs. The logs show each execution of the flow and if you click in you can find the steps the user went through and the flow data. The flow data is all the responses to widgets and other variables set in the system.

    Be warned though, the execution data will only be stored for 30 days after the execution starts. So if you do need to store it long term, you will need to extract it either at the end of the flow as the original tutorial suggested, or by making calls to the Studio API to get the data.


  • In that tutorial, receiving the results of the survey is an exercise left to the reader I'm afraid. You need to build your own application that can receive the HTTP request from the Studio widget and save the answers to a database or something similar. The widget can make requests in either Form URL encoded format (application/x-www-form-urlencoded) or JSON format (application/json) so your application will need to be able to parse that and do whatever you need with the data. The URL you enter into the widget will depend on how you build and where you deploy your application.

  • @pnash Thanks for the reply! This is really helpful!
    Is there a way to get the survey result (answers, phone number) through Twilio Studio without my own application?

  • If you're looking for something simple, incoming text messages are visible in your twilio logs just like all other text messages. You won't get any context (eg, you can't tell which message from a person was a response to which question) but you can retrieve the raw messages that were sent.

If this is an emergency, please contact Twilio Support. This is not an official Support channel.
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support