import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.documents.downloadFile('document_id');
console.log(response);
Download the actual file content for a document.
This endpoint is used for local storage when file:// URLs cannot be accessed by browsers.
GET
/
documents
/
{document_id}
/
file
JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.documents.downloadFile('document_id');
console.log(response);