Skip to content

Latest commit

 

History

History
176 lines (157 loc) · 3.04 KB

File metadata and controls

176 lines (157 loc) · 3.04 KB

API Examples

🏥 Doctors API

📌 Create a Doctor

POST /v1/doctor
X-Username: admin
Content-Type: application/json
{
  "username": "drkovac",
  "firstName": "Milica",
  "lastName": "Kovac"
}

📌 Retrieve All Doctors

GET /v1/doctor
X-Username: admin

📌 Retrieve a Doctor by ID

GET /v1/doctor/18ed2e30-e7d2-4ed4-a4a5-60b4630dadd4
X-Username: admin

📌 Update a Doctor

PUT /v1/doctor/18ed2e30-e7d2-4ed4-a4a5-60b4630dadd4
X-Username: admin
{
  "username" : "drkovac"
  "firstName": "Marija",
  "lastName": "Isailovic"
}

📌 Delete a Doctor

DELETE /v1/doctor/18ed2e30-e7d2-4ed4-a4a5-60b4630dadd4
X-Username: admin

📌 Search for Doctors

GET /v1/doctor/search?query=Kovac
X-Username: admin

👨‍⚕️ Patients API

📌 Create a Patient

POST /v1/patient
X-Username: admin
Content-Type: application/json
{
  "firstName": "Ivana",
  "lastName": "Rakic",
  "middleName": "Ana",
  "dateOfBirth": "1992-08-15"
}

📌 Retrieve All Patients

GET /v1/patient
X-Username: admin

📌 Retrieve a Patient by ID

GET /v1/patient/de968c17-54f7-4152-af8b-f6479b962a80
X-Username: admin

📌 Update a Patient

PUT /v1/patient/de968c17-54f7-4152-af8b-f6479b962a80
X-Username: admin
{
  "firstName": "Petar",
  "lastName": "Peric",
  "middleName": "Nikola",
  "dateOfBirth": "1990-03-22"
}

📌 Delete a Patient

DELETE /v1/patient/de968c17-54f7-4152-af8b-f6479b962a80
X-Username: admin

📌 Search for Patients

POST /v1/patient/search
X-Username: admin
{
  "query": "Marija"
}

📅 Appointments API

📌 Create an Appointment

POST /v1/appointment
X-Username: drkovac
{
  "appointmentTime": "2024-03-15T10:00:00",
  "status": "Scheduled",
  "patientId": "de968c17-54f7-4152-af8b-f6479b962a80",
  "doctorIds": ["18ed2e30-e7d2-4ed4-a4a5-60b4630dadd4"]
}

📌 Retrieve All Appointments

GET /v1/appointment
X-Username: admin

📌 Retrieve an Appointment by ID

GET /v1/appointment/e54e2994-ba3e-4ad3-a990-ab4b0184f8af
X-Username: admin

📌 Update an Appointment (Change Time)

PUT /v1/appointment/e54e2994-ba3e-4ad3-a990-ab4b0184f8af
X-Username: drkovac
{
  "appointmentTime": "2024-04-15T10:00:00",
  "status": "Scheduled",
  "patientId": "de968c17-54f7-4152-af8b-f6479b962a80",
  "doctorIds": ["18ed2e30-e7d2-4ed4-a4a5-60b4630dadd4"]
}

📌 Delete an Appointment

DELETE /v1/appointment/e54e2994-ba3e-4ad3-a990-ab4b0184f8af
X-Username: drkovac

📌 Retrieve Appointments for a Doctor

GET /v1/appointment/doctor/18ed2e30-e7d2-4ed4-a4a5-60b4630dadd4
X-Username: admin

📌 Retrieve Appointments for a Patient

GET /v1/appointment/patient/de968c17-54f7-4152-af8b-f6479b962a80
X-Username: admin

📌 Cancel an Appointment

PUT /v1/appointment/cancel/e54e2994-ba3e-4ad3-a990-ab4b0184f8af
X-Username: drkovac