Skip to main content
GET
https://app.medisync.me
/
api
/
recordings
/
get
/
{appointmentId}
Download Recording File
curl --request GET \
  --url https://app.medisync.me/api/recordings/get/{appointmentId} \
  --header 'Authorization: <authorization>'
{
  "success": true,
  "error": "<string>",
  "message": "<string>"
}

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

Authorization
string
required
Bearer JWT token for authentication
Authorization: Bearer your_jwt_token_here

Path Parameters

appointmentId
string
required
The appointment ID whose recording file should be downloaded (MongoDB ObjectId)
65f8a1b2c3d4e5f6789012f3

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)

success
boolean
Always false for error responses
error
string
Error message describing the issue
message
string
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

  1. Audio Playback: Stream audio directly to media players in web applications
  2. File Download: Download recording files for offline access or backup
  3. Audio Processing: Retrieve files for further audio processing or analysis
  4. 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>
<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.