An application example implementing Click to Call using Twilio. An application example that implements an Automated Survey using Twilio.
-
Clone the repository and
cd
into it. -
The application uses Gradle to manage dependencies.
-
Edit the sample configuration file
.env.example
and edit it to match your configuration.Once you have edited the
.env.example
file, if you are using a unix operating system, just use thesource
command to load the variables into your environment:$ source .env.example
If you are using a different operating system, make sure that all the variables from the .env.example file are loaded into your environment.
-
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 the application using Gradle Gretty plugin.
$ ./gradlew appRun
This will run the embedded Jetty application server that uses port 8080.
-
Expose the application to the wider Internet using ngrok.
$ ngrok http 8080
Once you have started ngrok, update your Twilio's number SMS and voice URL setting to use your ngrok hostname. It will look something like this:
http://<your-ngrok-subdomaon/automated-survey-servlets/survey
This application uses this Twilio helper library.
-
Run at the top-level directory.
$ ./gradlew test
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.