Quick Help

The knowledgebase is a categorized collection of answers to frequently asked questions (FAQ) and articles. You can read articles in this category or select a subcategory that you are interested in.



 Steps For Implementing Phone Verification in India

Solution

Below article would provide a high level overview of the integration steps for performing phone verification in India using 2Factor SMS OTP solution,

Here are 2 ways to implement it.


  • Implementing OTP logic with 2Factor API - Auto Generate OTP


    Brief steps would be as below,

    1. Your application displays in input box, so end user can provide his phone number

    2. Once user clicks on Signup / Verify button, you would call our API Endpoint, to trigger an OTP to the end user

      API Endpoint: ( Reference Here )
      https://2factor.in/API/V1/{api_key}/SMS/{user's_phone_no}/AUTOGEN

      Sample response:
      { "Status": "Success", "Details": "5D6EBEE6-EC04-4776-846D-3600422BD9EF" }

    3. Above step would send an OTP to the end user

    4. Now you would display another page / modal window / division, asking user to input the OTP value received

    5. Once user enters the OTP value and clicks on process / verify button, you would call below API Endpoint ( passing session id generated in Step 2 + Otp value entered by user in Step 4 )

      API Endpoint: ( Reference Here )
      https://2factor.in/API/V1/{api_key}/SMS/VERIFY/{session_id}/{otp_entered_by_user}

      Sample Response:
      { "Status": "Success", "Details": "OTP Matched" }

    6. 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.


  • Implementing OTP logic with 2Factor API - Manually Generate OTP

    Brief steps would be as below,

    1. Your application displays in input box, so end user can provide his phone number

    2. Once user clicks on Signup / Verify button,
      your program would generate a 4-6 digit random code and pass it to our API endpoint ( along with user's phone number ) to trigger an OTP to the end user

      API Endpoint: ( Reference Here )
      https://2factor.in/API/V1/{api_key}/SMS/{user's_phone_no}/{generated_otp}

      Sample response:
      { "Status": "Success", "Details": "5D6EBEE6-EC04-4776-846D-3600422BD9EF" }

    3. Above step would send an OTP to the end user

    4. Now you would display another page / modal window / division, asking user to input the OTP value received

    5. Once user enters the OTP value and clicks on process / verify button, you would call below API Endpoint ( passing session id generated in Step 2 + Otp value entered by user in Step 4 )

      API Endpoint: ( Reference Here )
      https://2factor.in/API/V1/{api_key}/SMS/VERIFY/{session_id}/{otp_entered_by_user}

      Sample Response:
      { "Status": "Success", "Details": "OTP Matched" }

    6. 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.

 

Article details

Article ID: 19

Category: Voice and SMS OTP

 
Powered by Help Desk Software HESK - brought to you by Help Desk Software SysAid