Send OTP to user's email or phone number.
POST /otp
POST
/otp
The OTP will be used to verify user before doing some activities like: sign up, sign in, change phone, reset password, etc.
Flow:
- Validate request.
- otpType and identifier are required.
- otpType should be a valid one(login, change_phone, reset_password, sign_up).
- identifier should be a valid email or phone number. - Validate based on otpType
- login, reset_password: query user by identifier, user should exists and have valid user status(not blocked/paused).
- change_phone, sign_up: query user by identifier, user should not exists. if exist error phone already registered. - Set OTP code to cache.
- Send OTP code to user’s email or phone number(based on identifier).
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”SendOTPRequest
object
identifier
Email or phone number
string
+6282243350992 otpType
Login | change_phone | reset_password | sign_up
string
loginResponses
Section titled “ Responses ”No Content
Bad request
object
error
string
some meaningful error messageInternal server error
object
error
string
some meaningful error message