curl --request GET \
--url https://api.example.com/api/users/:id/appointments{
"appointments": [
{
"id": 123,
"date": "<string>",
"timeBlockId": 123,
"patientId": 123,
"doctorId": 123,
"status": "<string>",
"notes": "<string>",
"reason": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"error": "<string>"
}Retrieve all appointments for a specific user
curl --request GET \
--url https://api.example.com/api/users/:id/appointments{
"appointments": [
{
"id": 123,
"date": "<string>",
"timeBlockId": 123,
"patientId": 123,
"doctorId": 123,
"status": "<string>",
"notes": "<string>",
"reason": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"error": "<string>"
}Authorization: Bearer <token>
Show Appointment Object
| Status Code | Error Message | Description |
|---|---|---|
| 401 | Access Denied, no token provided | No JWT token was provided |
| 403 | Invalid token | The JWT token is invalid or expired |
| 500 | Error al obtener las citas del usuario | Internal server error while fetching appointments |
curl -X GET https://api.example.com/api/users/42/appointments \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
[
{
"id": 101,
"date": "2024-03-15T10:00:00.000Z",
"timeBlockId": 501,
"patientId": 42,
"doctorId": 7,
"status": "CONFIRMED",
"notes": "Follow-up appointment",
"reason": "Annual checkup",
"createdAt": "2024-03-01T09:30:00.000Z",
"updatedAt": "2024-03-02T11:15:00.000Z"
},
{
"id": 102,
"date": "2024-03-22T14:30:00.000Z",
"timeBlockId": 502,
"patientId": 42,
"doctorId": 7,
"status": "PENDING",
"notes": null,
"reason": "Consultation",
"createdAt": "2024-03-03T10:00:00.000Z",
"updatedAt": "2024-03-03T10:00:00.000Z"
}
]