-
URL
/doctors
-
Method:
GET
-
URL Params
Required:
There are no required URL params
Optional:
There are no optional URL params
-
Success Response:
- Code: 200
Content:
- Code: 200
{
"message": "Successfully found doctors.",
"data": [
{
"id": 1,
"last_name": "Login"
},
{
"id": 2,
"last_name": "Input"
},
{
"id": 3,
"last_name": "Jones"
},
{
"id": 4,
"last_name": "Domain"
},
{
"id": 5,
"last_name": "Component"
}
]
}
-
Error Response:
- Code: 500 SERVER ERROR
Content:{"message": "Unexpected error"}
- Code: 500 SERVER ERROR
-
URL
/patient
-
Method:
POST
-
URL Params
Required:
There are no required URL params
Optional:
There are no optional URL params
-
Body Data
Must be sent as JSON with the correct headers
Required:
{ "email" : "string" }
-
Success Response:
- Code: 200
Content:
- Code: 200
{
"message": "Successfully found patient.",
"data": 1
}
-
Error Response:
-
Code: 400
Content:{ "message": "This patient does not exist", "data": 0 }
-
Code: 500 SERVER ERROR
Content:{"message": "Unexpected error"}
-
-
URL
/appointment
-
Method:
POST
-
URL Params
Required:
There are no required URL params
Optional:
There are no optional URL params
-
Body Data
Must be sent as JSON with the correct headers
Required:
{ "patientId": "int", "doctorId": "int", "time": "int", "date": "YYYY-MM-DD", "reason": "string" }
-
Success Response:
- Code: 200
Content:
- Code: 200
{
"success" = "true"
}
-
Error Response:
- Code: 500 SERVER ERROR
Content:{"message": "Failed to add appointment."}
- Code: 500 SERVER ERROR
-
URL
/getAppointments/:date/:doctorId
-
Method:
GET
-
URL Params
Required:
There are no required URL params
Optional:
There are no optional URL params
Example:
/getAppointments/2023-06-23/3
-
Success Response:
- Message: "Successfully found appointments
Data:
- Message: "Successfully found appointments
{
"message": "Successfully found appointments.",
"data": [
{
"patientId": 46,
"time": 15,
"reason": "implement one-to-one infomediaries"
}
]
}
-
Error Response:
- Code: 500 SERVER ERROR
Content:{"message": "Unexpected error"}
- Code: 500 SERVER ERROR
-
URL
/login
-
Method:
POST
-
URL Params
Required:
There are no required URL params
Optional:
There are no optional URL params
-
Body Data
Must be sent as JSON with the correct headers
Required:
{ "email": "String", "password": "String" }
-
Success Response: Session created using Express Session
{"success": "true"}
-
Error Response:
-
Code: 400 BAD REQUEST
Content:{"message": "Invalid song data", "data": []}
-
Code: 500 SERVER ERROR
Content:{"message": "Unexpected error", "data": []}
-
-
URL
/logout
-
Method:
POST
-
URL Params
Required:
There are no required URL params
Optional:
There are no optional URL params
-
Success Response:
Destroys session
- Error Response: