Hi,
Need an urgent help.
I want to verify user’s mobile number so I have found an API which helps me to send OTP to verify user. I have searched many videos and blogs to how to set this API yet I’m unable to set this up. Please help.
I’v installed “bubble API connector” and enterd my API key.
I’v created an Input for mobile number
Now, i dont know how to invoke Autogen Endpoint API…
following is the document shared by API provider.
Sending OTP:
- Display an input box ( so end user can provide his phone number )
- User clicks on Signup / Login button
- Your application invokes 2Factor’s AUTOGEN API Endpoint
https://2factor.in/API/V1/{api_key}/SMS/+91{user's_phone_no}/AUTOGEN
Sample response:
{ "Status": "Success", "Details": "5D6EBEE6-EC04-4776-846D"}
Details value in above response corresponds to unique OTP session id.
Verifying OTP:
- Ask user to input OTP received
- Invoke 2Factor’s VERIFY Endpoint to verify OTP entered by user
https://2factor.in/API/V1/{api_key}/SMS/VERIFY/{session_id}/{otp_entered_by_user}
Here session_id = Details value returned in SendOTP step
Sample Response:
{ "Status": "Success", "Details": "OTP Matched" }
If the response received from our API says ‘OTP Matched’, then you can mark the user as verified in your database Else ask user to Retry.