- Clone this repository:
git clone https://github.com/hendisantika/spring-boot-twilio-otp.git
- Navigate to the folder:
cd spring-boot-twilio-otp
- Replace Twilio Credentials with your own
- Run the application:
mvn clean spring-boot:run
- Import the POSTMAN Collection file
Send OTP
curl --location --request POST 'localhost:8080/api/otp' \
--header 'Content-Type: application/json' \
--data-raw '{
"to": "+6281321411881"
}'
Verify OTP
curl --location --request POST 'localhost:8080/otp' \
--header 'Content-Type: application/json' \
--data-raw '{
"otp": "789444"
}'