Overview
Download the medical document file associated with a specific appointment in MediSync. This endpoint retrieves the actual PDF file content and returns it with appropriate headers for download or viewing.File Download: This endpoint returns the actual PDF file content, not just document metadata. Use the list endpoint to get document information first.
Authentication
Path Parameters
The appointment ID to download the document for
Response
Successful Download
Returns the PDF file as binary data with appropriate headers:Set to
application/pdf for PDF file downloadsAttachment header with the original filename (without appointment ID prefix)
Error Response (JSON)
When the document is not found or an error occurs:Whether the request was successful (always false for errors)
Error message describing what went wrong
Response Examples
Successful Download Headers
Document Not Found Error
Storage Error
Business Logic
- Appointment-Based Access: Documents are accessed using the appointment ID, not the document ID directly.
- File Streaming: Large PDF files are streamed efficiently to handle documents of various sizes.
- Original Filename: The downloaded file uses the original filename without the appointment ID prefix.
- Secure Storage: Files are retrieved from Telekom’s secure cloud storage with proper access controls.
Error Handling
- 404 Not Found: Document does not exist for the specified appointment ID
- 401 Unauthorized: Invalid or missing authentication token
- 500 Internal Server Error: Storage retrieval error or empty file content
Notes
- Only returns PDF files as stored in the system
- Filename in Content-Disposition header is cleaned of the appointment ID prefix
- Large files are handled efficiently through streaming
- Document access is logged for audit purposes
- Empty or corrupted files from storage will result in a 500 error