This document outlines the endpoints for user authentication and data retrieval.
Create a new user account.
- Endpoint:
/auth/sign-up
- Method:
POST
- Headers:
Content-Type: application/json
{
"email": "[email protected]",
"password": "123456789"
}
{
"data": {
"email": "[email protected]",
"id": 1719040806,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjE2NTQ0NjgsInN1YiI6MTcxOTA0MDgwNn0.2_H0ft_-cXN2vN6FJ1TORnhmAwBfwpdDbFVDy7nBUiw"
},
"message": "User created successfully"
}
Sign in existing user.
- Endpoint:
auth/sign-in
- Method:
POST
- Headers:
Content-Type: application/json
{
"email": "[email protected]",
"password": "123456789"
}
{
"data": {
"email": "[email protected]",
"id": 1719040806,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjE2NTQ5MjUsInN1YiI6MTcxOTA0MDgwNn0.NhJNYA-69lANbbRnmPRG2Wz2DsNJ5XQur1Hn1BCxhBE"
},
"message": "Signed in successfully"
}
Send otp to reset password.
- Endpoint:
auth/send-otp
- Method:
POST
- Headers:
Content-Type: application/json
{
"email": "[email protected]"
}
{
"message": "Otp sent successfully"
}
Verify otp and set new password to reset password.
- Endpoint:
auth/reset-passeord
- Method:
POST
- Headers:
Content-Type: application/json
{
"email": "[email protected]",
"otp": "1234",
"password": "123456789"
}
{
"message": "Password reset successful"
}
Fetch user data.
- Endpoint:
user/fetch-user
- Method:
GET
- Headers:
Content-Type: application/json
Authorization: Bearer {token}
{
"data": {
"email": "[email protected]",
"id": 1719040806
},
"message": "User fetched successfully"
}