import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const documents = await client.batch.retrieveDocuments({ body: { foo: 'bar' } });
console.log(documents);
[
{
"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>"
}
]
Retrieve multiple documents by their IDs in a single batch operation.
Args: batch_request: Dictionary containing:
Returns: List[Document]: List of documents matching the IDs
import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const documents = await client.batch.retrieveDocuments({ body: { foo: 'bar' } });
console.log(documents);
[
{
"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
The response is of type Document · object[]
.
Was this page helpful?