* denotes required fields. ? denotes maybe undefined.
Every Request should have Content-Type: application/json
Index | Key | Value |
1. | METHOD | POST |
ROUTE | /auth/register | |
REQ BODY |
json
{
"phone*": "string",
"password*": "string",
"email": "string",
"name": "string",
} |
|
RES BODY |
json
{
"prettyMessage": "string",
"status": "number",
"data": {
"accessToken": "string",
"userId": "string",
"refreshToken": "string",
},
"success": "boolean",
} |
|
STATUS CODES |
{
"409": "Already Registered",
"201": "User registered successfully",
"501": "Internal Server Error"
} |
|
2. | METHOD | POST |
ROUTE | /auth/login | |
REQ BODY |
json
{
"phone*": "string",
"password*": "string",
} |
|
RES BODY |
json
{
"prettyMessage": "string",
"status": "number",
"data?": {
"accessToken": "string",
"userId": "string",
"refreshToken": "string",
},
"success": "boolean",
} |
|
STATUS CODES |
{
"200": "User Authorised",
"401": ["User not registered", "User not Authorised"],
"501": "Internal Server Error"
} |
|
3. | METHOD | POST |
ROUTE | /auth/refresh-token | |
REQ HEADERS |
"access-token*": "string",
"user-id*": "string", |
|
REQ BODY |
json
{
"refreshToken*": "string",
} |
|
RES BODY |
json
{
"prettyMessage": "string",
"status": "number",
"data": {
"accessToken": "string",
"userId": "string",
"refreshToken": "string",
},
"success": "boolean",
} |
|
STATUS CODES |
{
"205": "OK",
"400": "Invalid",
"405": "Refresh Token Expire",
"501": "Internal Server Error"
} |
|
4. | METHOD | POST |
ROUTE | /auth/logout | |
REQ HEADERS |
"access-token*": "string",
"user-id*": "string", |
|
REQ BODY |
json
{} |
|
RES BODY |
json
{
"prettyMessage": "string",
"status": "number",
"success": "boolean",
} |
|
STATUS CODES |
{
"200": "Logged Out",
"501": "Internal Server Error"
} |
|
5. | METHOD | GET |
ROUTE | /user/get | |
REQ BODY |
json
{
"phone*": "string"
} |
|
RES BODY |
json
{
"prettyMessage": "string",
"status": "number",
"success": "boolean",
"phone*": "string",
"data": {
"email": "string",
"links": {
"github": "string",
"linkedin": "string",
"codeforces": "string",
"codechef": "string"
},
"name": "string",
"phone": "string",
"status": "string",
"updatedAt": "number",
"userId": "string"
}
} |
|
STATUS CODES |
{
"200": "Found",
"404": "User Not Found",
"501": "Internal Server Error"
} |
|
4. | METHOD | POST |
ROUTE | /user/update | |
REQ HEADERS |
"access-token*": "string",
"user-id*": "string", |
|
REQ BODY |
json
{
"phone*": "string", // Except phone, any key send will be updated
"email": "string",
"links": {
"github": "string",
"linkedin": "string",
"codeforces": "string",
"codechef": "string"
},
"name": "string",
"status": "string",
} |
|
RES BODY |
json
{
"prettyMessage": "string",
"status": "number",
"success": "boolean",
} |
|
STATUS CODES |
{
"200": "Updated",
"404": "User Not Found",
"501": "Internal Server Error"
} |