-
Notifications
You must be signed in to change notification settings - Fork 0
API endpoints
Sihan Tawsik edited this page May 8, 2020
·
6 revisions
The API endpoints, how to use them and their responses.
-
content-type: application/json
usernamepasswordaccount_type
curl --header "Content-Type: application/json" \
--request POST \
--data '{"username":"username","password":"password","account_type":"1"}' \
http://localhost:5000/auth/register-
content-type: application/json
auth_tokenmessagestatus
{
"auth_token": a_token,
"message": "Successfully registered.",
"status": "success"
}If the user already exits.
-
content-type: application/json
messagestatus
{
"message": "User already exists. Please Log in.",
"status": "fail"
}Any type of errors.
-
content-type: application/json
messagestatus
{
"message": "Some error occurred. Please try again.",
"status": "fail"
}-
content-type: application/json
usernamepassword
curl --header "Content-Type: application/json" \
--request POST \
--data '{"username":"username","password":"password"}' \
http://localhost:5000/auth/login-
content-type: application/json
auth_tokenmessagestatus
{
"auth_token": a_token,
"message": "Successfully logged in.",
"status": "success"
}If the user does not exits.
-
content-type: application/json
messagestatus
{
"message": "User does not exist.",
"status": "fail"
}Any type of errors.
-
content-type: application/json
messagestatus
{
"message": "Try again",
"status": "fail"
}