Login OTP Send for Email
Sends a one-time login code to a user's email address. Then call "Get API Key with Login OTP" with the code to get an API key. Use it for password-less sign-in on your website or app.
POST
/login/otpLogin OTP Send for Email
curl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/login/otp' \
--form 'JSONString={"institution_id":<institutionId>,"user":"hemal@edmingle.com"}'{
"code": 200,
"message": "Success"
}Access: Public, no API key.
Request body: form-data with one field, JSONString, containing this JSON:
Body
JSONStringThe user's email address or contact number (digits only). Usernames are not accepted.
institution_idinteger
Institute to look the user up in. Defaults to the institute of the API host you call.
is_resend_otpinteger
1 sends the OTP to both the user's email and phone (when the value matches exactly one user). Default 0.Notes:
- The OTP is 6 digits and valid for 30 minutes. Sending a new one cancels earlier ones.
- An email address gets the OTP by email. A contact number gets it by SMS if it's an Indian number and SMS login OTP is enabled for your institute; otherwise it goes to the user's email.
- Errors: "Invalid Email or Contact Number" (no such user), "Try Logging With Email or Phone Number" (a username was sent), "Ops! send otp currently disabled." (SMS OTP turned off), "OTP NOT SEND PLEASE CONTACT ADMIN" (no way to reach the user).
- Rate limit: 30 requests per minute; going over locks you out for 30 minutes.