An application example that implements an Automated Survey using Twilio.
-
Clone the repository and
cd
into it. -
The application uses Gradle to manage dependencies.
-
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 toTest
if not specified.
-
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.
-
Run
./gradlew run
to run the application. -
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)
-
Call your Twilio number and answer the survey! You can check the results at
http://<your-ngrok-subdomain/
-
Run at the top-level directory.
$ ./gradle check
To run MongoDB on Mac OS in the foreground, after installing from brew:
mongod --config /opt/homebrew/etc/mongod.conf
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.