HomeGuidesRecipesAPI ReferenceChangelog
Log In

How to sign-in a user with OTP

πŸ“˜

This feature is not active by default for all Merchants

To activate the feature, please get in touch with Unblock.

The OTP sign-in process consists of only four steps:

1. Merchant is to create a user

2. Trigger the email OTP

This can be done by calling the endpoint /login and the Option 2

πŸ“˜

The template email will be sent by default

Unblock provides a template email to send the OTP to the user, this can be customized to match the Merchant's branding, colors, etc. Please get in touch with Unblock to set this up in your Private sandbox and your Production environements.

curl --request POST \
     --url https://api.getunblock.com/auth/login \
     --header 'Authorization: API-Key Rw6S6geZDASAjf/lOnf86PlzlzZ6VEYTiQzzVuN8fmhYdxaGhaWmgyqus5B3eFaC' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "user_uuid": "b13deca4-7051-485c-9f6d-6b99d3a46043"
}
'

3. Copy OTP from the received email

The Individual can then go to his email client and will receive an email branded in the colours, style and theme of the Merchant (this can be set up with Unblock when the feature is turned on)

4. Exchange OTP for session_id

The Individual can then come back to the UI of the Merchant and paste the OTP from his email in an input field; this can then be sent to Unblock using this endpoint

curl --request POST \
     --url https://api.getunblock.com/auth/otp/ \
     --header 'Authorization: API-Key Rw6S6geZDASAjf/lOnf86PlzlzZ6VEYTiQzzVuN8fmhYdxaGhaWmgyqus5B3eFaC' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "one_time_password": "2435",
  "user_uuid": "b13deca4-7051-485c-9f6d-6b99d3a46043"
}
'