import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const document = await client.documents.getByFilename('filename');
console.log(document.app_id);
{
"external_id": "<string>",
"content_type": "<string>",
"filename": "<string>",
"metadata": {},
"storage_info": {},
"storage_files": [
{
"bucket": "<string>",
"key": "<string>",
"version": 1,
"filename": "<string>",
"content_type": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"system_metadata": {},
"additional_metadata": {},
"chunk_ids": [
"<string>"
],
"folder_name": "<string>",
"end_user_id": "<string>",
"app_id": "<string>"
}
Get document by filename.
Args: filename: Filename of the document to retrieve auth: Authentication context folder_name: Optional folder to scope the operation to end_user_id: Optional end-user ID to scope the operation to
Returns: Document: Document metadata if found and accessible
import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const document = await client.documents.getByFilename('filename');
console.log(document.app_id);
{
"external_id": "<string>",
"content_type": "<string>",
"filename": "<string>",
"metadata": {},
"storage_info": {},
"storage_files": [
{
"bucket": "<string>",
"key": "<string>",
"version": 1,
"filename": "<string>",
"content_type": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"system_metadata": {},
"additional_metadata": {},
"chunk_ids": [
"<string>"
],
"folder_name": "<string>",
"end_user_id": "<string>",
"app_id": "<string>"
}
Successful Response
Represents a document stored in the database documents collection
Was this page helpful?