Skip to content

Latest commit

 

History

History
215 lines (167 loc) · 5.23 KB

File metadata and controls

215 lines (167 loc) · 5.23 KB

@baseUrl = http://localhost:5000/api @token = your_access_token_here @refreshTokenStr = your_refresh_token_here @doctorId = doctor_id_here @appointmentId = appointment_id_here @specializationId = specialization_id_here @userId = user_id_here

### ========================================================================= ### BASE URL & HEALTH CHECK ### =========================================================================

### Get API Health/Status GET http://localhost:5000/

### ========================================================================= ### USER & AUTHENTICATION ROUTES (/api/users) ### =========================================================================

### Register a new Patient POST {{baseUrl}}/users/register/patient Content-Type: application/json

{
"userName": "John Doe", "email": "patient@example.com", "password": "Password123!", "phone": "+1234567890"

}

### Register a new Doctor POST {{baseUrl}}/users/register/doctor Content-Type: application/json

{
"userName": "Dr. Sarah Smith", "email": "doctor@example.com", "password": "Password123!", "phone": "+1987654321"

}

# @name login POST {{baseUrl}}/users/login Content-Type: application/json

{
"email": "admin@test.com", "password": "Admin1234"

}

###

@token = {{login.response.body.data.accessToken}}

# { # "email": "patient@example.com", # "password": "Password123!" # }

### Refresh Token POST {{baseUrl}}/users/refresh Content-Type: application/json

{
"refreshToken": "{{refreshTokenStr}}"

}

### Logout POST {{baseUrl}}/users/logout Content-Type: application/json

### Get Logged In User Profile GET {{baseUrl}}/users/profile Authorization: Bearer {{token}}

### ========================================================================= ### DOCTOR ROUTES (/api/doctors) ### =========================================================================

### Get All Specializations (Public) GET {{baseUrl}}/doctors/specializations

### Create new Specialization (Admin) POST {{baseUrl}}/doctors/specializations Authorization: Bearer {{token}} Content-Type: application/json

{
"name": "Eye Specialist", "description": "Specialists in eye care and vision correction"

}

### Update Specialization (Admin) PUT {{baseUrl}}/doctors/specializations/{{specializationId}} Authorization: Bearer {{token}} Content-Type: application/json

{
"name": "Cardiology Updated", "description": "Updated description"

}

### Delete/Deactivate Specialization (Admin) DELETE {{baseUrl}}/doctors/specializations/{{specializationId}} Authorization: Bearer {{token}}

### Get Doctor's Own Profile (Doctor) GET {{baseUrl}}/doctors/profile Authorization: Bearer {{token}}

### Create Doctor Profile (Doctor) ### Note: This endpoint accepts multipart/form-data for image uploads. ### In VSCode REST Client, a JSON body is shown here for the text fields logic. POST {{baseUrl}}/doctors/profile Authorization: Bearer {{token}} Content-Type: application/json

{

"specialization": "{{specializationId}}", "bio": "Experienced cardiologist with 10 years of practice.", "experience": 10, "consultationFee": 150, "workingHours": [

{

"day": "Monday", "slots": [

{ "startTime": "09:00", "endTime": "13:00" }, { "startTime": "14:00", "endTime": "17:00" }

], "isActive": true

}

]

}

### Update Doctor Profile (Doctor) PUT {{baseUrl}}/doctors/profile Authorization: Bearer {{token}} Content-Type: application/json

{
"consultationFee": 200, "bio": "Updated bio information."

}

### Get All Doctors (Public - with Pagination and Filters) GET {{baseUrl}}/doctors?page=1&limit=10&sort=rating

### Get Specific Doctor by ID (Public) GET {{baseUrl}}/doctors/{{doctorId}}

### ========================================================================= ### APPOINTMENT ROUTES (/api/appointments) ### =========================================================================

### Book an Appointment (Patient) POST {{baseUrl}}/appointments Authorization: Bearer {{token}} Content-Type: application/json

{

"doctorId": "{{doctorId}}", "appointmentDate": "2026-03-01", "timeSlot": {

"startTime": "09:00", "endTime": "13:00"

}, "reason": "Routine checkup and occasional chest pain."

}

### Get Appointments ### (Patient: Gets their own, Doctor: Gets their patients, Admin: Gets all) GET {{baseUrl}}/appointments Authorization: Bearer {{token}}

### Update Appointment Status (Doctor / Admin) PUT {{baseUrl}}/appointments/{{appointmentId}}/status Authorization: Bearer {{token}} Content-Type: application/json

{
"status": "Confirmed", "notes": "Please bring your previous medical records."

}

### Cancel Appointment (Patient / Admin) PUT {{baseUrl}}/appointments/{{appointmentId}}/cancel Authorization: Bearer {{token}}

### ========================================================================= ### ADMIN ROUTES (/api/admin) ### =========================================================================

### Get All Users (Admin) GET {{baseUrl}}/admin/users Authorization: Bearer {{token}}

### Update User Status (Admin) PUT {{baseUrl}}/admin/users/{{userId}}/status Authorization: Bearer {{token}} Content-Type: application/json

{
"status": "Blocked"

}

### Get All Appointments for Admin Dashboard (Admin) GET {{baseUrl}}/admin/appointments Authorization: Bearer {{token}}