Overview
Downloads or streams the actual recording file associated with a specific appointment ID. This endpoint returns the binary audio file data rather than JSON metadata.
This endpoint returns the actual audio file content, not JSON data. The response will be streamed directly to the client with appropriate audio content headers.
Authentication
Bearer JWT token for authenticationAuthorization: Bearer your_jwt_token_here
Path Parameters
The appointment ID whose recording file should be downloaded (MongoDB ObjectId)
Response
Success Response (200)
- Content-Type:
audio/wav
- Body: Binary audio file stream
- The response will be the actual audio file content that can be played or saved
Error Response (400/500)
Always false for error responses
Error message describing the issue
Additional error details (for 500 errors)
Example Request
curl -X GET \
'https://app.medisync.me/api/recordings/get/65f8a1b2c3d4e5f6789012f3' \
-H 'Authorization: Bearer your_jwt_token_here' \
--output recording.wav
Example Response
Success Response
Content-Type: audio/wav
Content-Length: [file_size_in_bytes]
[Binary audio file data stream]
Error Responses
400 Bad Request - Recording Not Found
{
"success": false,
"error": "Recording not found"
}
500 Internal Server Error
{
"success": false,
"message": "Internal server error"
}
Behavior Notes
- File Streaming: The response streams the actual audio file content
- Search by Appointment: Uses appointment ID to find the associated recording file
- Content Type: Always returns
audio/wav content type for successful requests
- Binary Response: Returns binary file data, not JSON (except for errors)
- Streaming Support: Supports HTTP streaming for efficient file download
- Error Handling: Returns JSON error messages for failed requests
Use Cases
- Audio Playback: Stream audio directly to media players in web applications
- File Download: Download recording files for offline access or backup
- Audio Processing: Retrieve files for further audio processing or analysis
- Patient Access: Allow patients to download their consultation recordings
Integration Examples
HTML5 Audio Element
<audio controls>
<source src="https://app.medisync.me/api/recordings/get/65f8a1b2c3d4e5f6789012f3" type="audio/wav">
Your browser does not support the audio element.
</audio>
Download Link
<a href="https://app.medisync.me/api/recordings/get/65f8a1b2c3d4e5f6789012f3"
download="consultation_recording.wav"
target="_blank">
Download Recording
</a>
Make sure to handle authentication properly when embedding audio sources or download links. The Authorization header must be included in the request.