ApiKey that has access to your entire App on MoonKey.
1 - Implement OTP UI
Implement 2 UI screens to enable OTP- Screen to enter phone number

- Screen to submit OTP

2 - Create or Update an existing user
Each user must be stored on MoonKey Auth, so we recommend ensuring that you store our auto generated User ID from the response into your database/backend in a column or field against that user (as long as you can associate your user with the auto generated ID returned by MoonKey). We will ensure that each mobile number or email is ONLY attached to a single user at any time. If this is an existing user, we will be using the CreateUser endpoint to create a user, otherwise, you should use the UpdateUser endpoint to attach the phone number to the user by sending in the user’s MoonKey user ID.Create user
cURL
Update user
cURL
3 - Send OTP by SMS
Once we have a user associated with the phone number. We can initiate a SMS OTP request to the phone number using CreateSmsOTP endpoint.cURL
4 - Verify OTP (One-time passcode)
In the previous step, MoonKey Auth will return a response like the following,JSON
phone_number_id will be used as the method_id in the VerifyOTP endpoint.
cURL
session_token or session_expires_in parameters, a new session will then be created or extended for the given user and the session token returned.
JSON
JSON