Authenticate with Mobile OTP
If the user is not logged in, you must verify their identity using a one-time password (OTP). Once verified, you can authenticate the user and obtain a token.
Send OTP verification Code
POST
/api.moojo.id/send-verification-code
Headers
Content-Type
application/json
x-api-key
Your API KEY as provided by Moojo
Body
phoneNumber
string
The mobile number of the user.
Request example
Response example
After the user receives the verification code, use the OTP authentication endpoint as outlined below:
Authenticate a user with OTP
POST
/api.moojo.id/user/authenticate
If the user is already authenticated in your agent or application, you can use their JWT to authenticate them with moojoᴵᴰ as well. This ensures that the user is seamlessly connected to their universal identity, along with any previously collected data.
Headers
Content-Type
application/json
x-api-key
Your API KEY as provided by Moojo
Body
idType
string
Specifies the type of identity being used for the OTP. Currently, only mobile SMS is supported. use "smsVerificationCode"
phoneNumber
String
The mobile number of the user.
verificationCode
String
The verification code as received by the user
Request example
Response example
Upon successful authentication, a valid token is issued with a 2-hour expiration period. This token can be used for any user-related API calls.
Last updated
Was this helpful?