- Spring Boot
- Data JPA
- Web MVC
- REST API
- WhatsAPP Business Account (WATI)
-
Create WATI account (7 days free trial available)
-
Create Template in wati to send a otp msg like below
Greetings for the day..!!
Your OTP is *{{otp}}*
Thanks,
Ashok IT.
Note: WATI will review our template and they will approve it. Once template got approved then only we can send a msg using that template.
-
Configure WATI API Token & WATI Endpoint in our application
-
Use RestTemplate/Webclient to make WATI api call
-
Customer will fill registration form and will click on submit
-
Capture form data given by the customer
-
Generate OTP using java method
-
Set Generated OTP and Account Status as "Not_verified" to customer object and Insert customer record in database table
-
Send OTP msg to customer given whatsapp number using wati api call - prepare api request object - use wati api token as Authorization Header - send post request with token + request object
-
After sending whatsapp msg, redirect customer to validate_OTP page and ask customer to enter OTP
-
Customer will enter OTP and will submit the form for validation
-
Take form data and verify customer record presence our database table with customer given email and otp.
-
With given details if record available in DB that means it is valid otp then update account status as 'verified' and display success msg
-
with given details if record is not available in DB that means it is invalid otp so display error msg
-