Professional Documents
Culture Documents
-Waset -
APIs
Date: 7/11/2021
Let us start…
Login API:
Link: /api/login .
This Api to verify the user and make him login. This function takes an email,
password and remember me as parameter and try to log the user in.
If the data is right this api would return the all user’s information with the
addition of `access_token` which is very important to authenticate the user in
other APIs, If the data not right the API will return Unauthorized.
Method: POST
Params: email, password, remember (true or false).
Request:
Response:
Logout API:
Link: /api/logout .
API to logout
Take in the header `auth-token` which contain the access token returned from
login apis to log the user out.
If it false will return unauthorized user. Else will return Logged out Successfully.
Method: POST
Request:
Response:
Username and suit API:
Link: /api/usernameAndSuit .
Api to return username and suit
(make sure to add auth-token in the header).
Method: POST
Request:
Response:
Update Name API:
Link: /api/updateName .
Api to update the name of the user.
(make sure to add auth-token in the header).
Method:POST
Params: name, name2
Request:
Response:
Update Email API:
Link: /api/updateEmail .
Api to update the email of the user.
(make sure to add auth-token in the header).
Params: email, confirmEmail
Method: POST
Request:
Response:
Response:
Add Phone API:
Link: /api/AddPhone .
Api to add phone of the user.
(make sure to add auth-token in the header).
Params: phone1, phone2
Method:POST
Request:
Response:
Request:
Response:
Response:
Number of Packages for each package status API
Link: /api/ Packages_status_numbers.
Api to retrieve Number of Packages for each package status.
(make sure to add auth-token in the header).
Method:GET
Param: to
Request:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Response:
Repsonse:
Pay Debt API
Link: /api/ PayRequired
Api to Pay Debt.
(make sure to add auth-token in the header).
Method: POST
Request:
Response:
Response:
Response:
POST: /api/register