The BalanceBowl project contract assigned to NESA by Makers
#APIS
Where full URLs are provided in responses they will be rendered as if service is running on 'http://testserver/'.
Open endpoints require no Authentication.
- Login :
POST /api/login/
- SignUp :
POST /api/Register/
- Forgotpassword :
POST /api/forgotpassword/
- requestVerification :
POST /api/requestVerification/
- confirmVerification :
POST /api/confirmVerification/
- completeReg :
POST /api/completeReg/
Closed endpoints require no Authentication.
- userstate :
get /api/userstate/
Used to collect a Token for a registered User.
URL : /api/login/
Method : POST
Auth required : NO
Data constraints
{
"email": "[valid email address]",
"password": "[password in plain text]"
}
Data example
{
"email": "[email protected]",
"password": "abcd1234"
}
Code : 200 OK
Content example
{
"status":true,
"data":{
"token": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d",
"user":"full name"
}
}
Code : 400 BAD REQUEST
Content :
{
"status": false,
"error": "error message"
}
Used to Register a new user
URL : /api/register/
Method : POST
Auth required : NO
Data constraints
{
"username": "[username]",
"email": "[valid email address]",
"password": "[password in plain text]"
}
Data example
{
"email": "[email protected]",
"username": "somt123",
"password": "abcd1234"
}
Code : 200 OK
Content example
{
"status":true,
}
Code : 400 BAD REQUEST
Content :
{
"status": false,
"error": "error message"
}
used to help a user request for a new password, it collects the mail and send an email to the user containing change password link token
URL : /api/Forgotpassword /
Method : POST
Auth required : NO
Data constraints
{
"email": "[valid email address]"
}
Data example
{
"email": "[email protected]",
}
Code : 200 OK
Content example
{}
Code : 400 BAD REQUEST
Content :
{
"status": false,
}
used to request a verification token sent to mobile phone
URL : /api/requestVerification/
Method : POST
Auth required : NO
Data constraints
{
"phoneNumber": "[validphone number]"
}
Data example
{
"phoneNumber": "090909099090",
}
Code : 200 OK
Content example
{}
Code : 400 BAD REQUEST
Content :
{
"status": false,
}
Confirms the verification token sent to the user via text confimsd the user as verified
URL : /api/confirmVerification/
Method : POST
Auth required : NO
Data constraints
{ "code":"[4 digit code]",
"phoneNumber": "[validphone number]"
}
Data example
{ "code":"0990",
"phoneNumber": "090909099090",
}
Code : 200 OK
Content example
{
"status":true,
"data":{
"token": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d",
"user":"full name"
}
}
Code : 400 BAD REQUEST
Content :
{
"status": false,
"nessage":"error message"
}
Request contains remaining user profile details
URL : /api/completeReg/
Method : POST
Auth required : NO
Data constraints
{
"phoneNumber": "[validphone number]",
"gender":"[boolean]",
"years":"[user year]",
"UserID":"[userID]",
"code":"[placeholder this could be empty]"
}
Data example
{ "code":"0990",
"phoneNumber": "090909099090",
}
Code : 200 OK
Content example
{
"status":true,
"data":{
"token": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d",
"user":"full name"
}
}
Code : 400 BAD REQUEST
Content :
{
"status": false,
"nessage":"error message"
}
Request contains remaining user profile details
URL : /api/userstate/
Method : GET
Auth required : YES
Data constraints
{
** None
}
Data example
{
** None
}
Code : 200 OK
Content example
{
"premium": true,
}
Code : 400 BAD REQUEST
Content :
{
"status": false,
"nessage":"error message"
}