Authentication
The description here
The Authentication steps are in the following formart:
User Acquisition
The user acquisition process is designed to be seamless and user-friendly. It typically involves the following steps:
route: /auth/initiate-registration
Method: POST
Request:
{
"phone_number": "string"
}Response 400 Bad Request:
{
"message": "string"
}Response 200 OK:
{
"message": "string",
"token": "string"
}Resend code
route: /auth/initiate-registration/resend-otp
Method: POST
Authorized: YES
Request:
{
"phone_number": "string"
}Response 400 Bad Request:
{
"message": "string"
}Response 200 OK:
{
"message": "string",
"token": "string"
}Verification Code
After the user initiates the registration process by providing their phone number, they will receive a verification otp code via SMS. The user must then enter this code to verify their phone number and complete the registration process.
route: /auth/initiate-registration/verify-otp
Method: POST
Authorized: YES
Request:
{
"otp": "string",
}Response 200 OK:
{
"message": "string",
"token": "string"
}Response 400 Bad Request:
{
"error": "string"
}Complete Registration
Complete the initiated user's details for actual registration
route: /auth/complete-registration
Method: POST
Authorized: YES
Request:
{
"first_name": "string",
"last_name": "string",
"username": "string",
"email": "string",
"phone_number": "string",
"password": "string"
}Response:
{
"message": "string",
"user": User,
"access_token": "string",
"refresh_token": "string"
}Login
Start Login
route: /auth/login
Method: POST
Authorized: No
Request:
{
"phone_number":"string",
"password": "string"
}Response 200 OK:
{
"message": "string",
"token": "string"
}Resend Login OTP
route: /auth/login/resend-otp
Method: POST
Authorized: YES
Request:
{
"phone_number": "string"
}Response 400 Bad Request:
{
"message": "string"
}Response 200 OK:
{
"message": "string",
"token": "string"
}Verify login otp
route: /auth/verify-login-otp
Method: POST
Authorized: YES
Request:
{
"otp": "string"
}Response 400 Bad Request:
{
"message": "string"
}Response 200 OK:
{
"message": "string",
"user": User,
"access_token": "string",
"refresh_token": "string"
}