Generate OTP and Integrate SMS API
1. Overview This document talks about how to generate OTP & Integration of SMS. 2. Technologies and Tools Used The following technologies has been used to Integrating SMS & generating SMS. Ø MS SQL Server Ø DotNet & Angular 3. Use Case Assume that there is a requirement to generate OTP & Send SMS to Respective Person. 4. Architecture Following steps explains in detail, Step 1: It validates and generate OTP , It allows to generate New OTP Maximum 3 times and resend OTP Maximum 5 Times. It is not allowed Maximum of OTP. This Query for generating OTP. SELECT CAST(1000000-CEILING(RAND()*899003)+DATEPART(MS, GETDATE()) AS INT) Step 2: Generating OTP and insert OTP into table. BEGIN SET NOCOUNT ON; DECLARE @EmployeeReferralID int; DECLARE @OTP varchar(6); DECLARE @CurrentDatetimeIST datetime=(SELECT (GETDATE() as TIME ZONE ‘Eastern Standard Time’) AT TIME ZONE ‘India Standard Time’); SELECT @OTP= CAST(1000000-CEILING(RAND()*899003)+DATEPART(MS, GETDATE()) AS INT) END Step 3: Verify OTP for respective Mobile Number. BEGIN DECLARE @OTPInput varchar(6); DECLARE @OTP varchar(6); SELECT @OTP=top 1 otp from tblemployeeOTP where mobileno=@mobileno order by desc; if(@OTPInput=@OTP)…
Read More