Skip to content

This is a Twilio client demo project built up with Spring Boot Java

Notifications You must be signed in to change notification settings

nuwanthafernando95/twilio_client_spring_java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Twilio Client Quickstart for Java

This web application is built up using Spring boot.

enter image description here

Setup

Requirements

  1. Java - 11
  2. Ngrok
  3. A Twilio account signed up

Twilio Account Settings

This is an completed Twilio client spring boot project. Before run the project you should have to gather following properties.

Config Value Description
twilio.account_sid Your primary Twilio account identifier - find this in the console here.
twilio.twiml.app.sid The TwiML application with a voice URL configured to access your server running this app - create one in the console here. Also, you will need to configure the Voice "REQUEST URL" on the TwiML app once you've got your server up and running.
twilio.trial_number A Twilio phone number in E.164 format - you can get one here
twilio.api.key / twilio.api.secret Your REST API Key information needed to create an Access Token - create one here.

Local development

  1. When after you gather above details, you should have to update application.properties file with gatherd keys.
  2. Then open the cmd or terminal and go to root directry (where the application.properties file available) then run mvn spring-boot:run command.
  3. Then navigate to http://localhost:8080 - Here you can see the application is working fine.
  4. You should have to run it with ngork to locally check it. So to that open the terminal and run ngrok http 8080 command. So the terminal will display ngrok forwarded URL. Copy it and navigate to it from the browser.
  5. This is the final step. All the application side changes are alomost over. Now you should have to setup the twilio configurations. Go to the TWIML application and click on the application you created. And update the voice URL with ngrok forwaded URL + /call/voice and keep the method type as default (HTTP Post). Ex: https://71da93bcb0b9.ngrok.io/call/voice And finally update the phone voice URL so you are ok to test the application. To update the phone voice URL navigate to the phone numbers . Click on a phone number and then update the voice URL with ngrok forwaded URL + /call/direct-client and keep the method type as default (HTTP Post). Ex: https://71da93bcb0b9.ngrok.io/call/direct-client

Hopefully, Now your application is running without issue. If you faced any issue post those in issues section.

About

This is a Twilio client demo project built up with Spring Boot Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published