Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

TwilioDevEd/automated-survey-spark

Repository files navigation

Twilio

Automated Survey Spark

Build Status

An application example that implements an Automated Survey using Twilio.

Run the application

  1. Clone the repository and cd into it.

  2. The application uses Gradle to manage dependencies.

  3. Use the following variables to configure this application when running it locally.

    • PORT: the application's port number (defaults to port 4567).
    • MONGODB_URI: the address of a MongoDB instance to use (defaults to a MongoDB instance listening on the localhost). Defaults to Test if not specified.
  4. Configure Twilio to call your webhooks.

    You will need to configure Twilio to call your application when SMSs and calls are received.

    You will need to provision at least one Twilio number with SMS and voice capabilities so the application's users can trigger the survey. You can buy a number right here. Once you have a number you need to configure it to work with your application. Open the number management page and open a number's configuration by clicking on it.

    Configure Voice

  5. Run ./gradlew run to run the application.

  6. Expose the application to the wider Internet using ngrok.

    $ ngrok http 4567

    Once you have started ngrok, update your Twilio's number voice URL setting to use your ngrok hostname. It should look something like this:

    http://<your-ngrok-subdomain/interview (POST)
    
  7. Call your Twilio number and answer the survey! You can check the results at http://<your-ngrok-subdomain/

Run the tests

  1. Run at the top-level directory.

    $ ./gradle check

Running MongoDB on Mac OS

To run MongoDB on Mac OS in the foreground, after installing from brew:

mongod --config /opt/homebrew/etc/mongod.conf

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

About

Sample application demonstrating automated voice surveys with Twilio and Java Spark

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published