GET
/
medical
/
v1
/
document
/
download-url
curl --request GET \
  --url https://api.sandbox.metriport.com/medical/v1/document/download-url \
  --header 'x-api-key: <api-key>'
import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriportClient = new MetriportMedicalApi("YOUR_API_KEY");

const downloadableUrl = await metriportClient.getDocumentUrl("abc123-def456");

This endpoint returns a URL which you can use to download the specified document and/or convert using the file name provided from the List Documents endpoint.

The URL will only be valid for 60 seconds before you need to request a new one.

Query Params

fileName
string
required

The file name of the document.

conversionType
string

The document type to convert to. Either html or pdf.

This parameter should only be used for converting XML/CDA files.

Response

A JSON object containing the URL will be returned.

url
string

The downloadable URL.

For patients with a large volume documents, you can use the [Bulk Get Document URL](/medical-api/api-reference/document/download-url-bulk to get all download URLs, instead of doing it one at a time.