curl -X GET \
'https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-o downloaded_file.pdf
const response = await fetch(
'https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
// Get the file as a blob
const blob = await response.blob();
// Create download link
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'document.pdf';
document.body.appendChild(a);
a.click();
a.remove();
import requests
url = "https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download"
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.get(url, headers=headers)
# Save to file
with open('downloaded_document.pdf', 'wb') as f:
f.write(response.content)
Binary file content is returned with appropriate headers.
Example headers:
Content-Disposition: attachment; filename="contract_signed.pdf"
Content-Type: application/pdf
Content-Length: 245678
{
"success": false,
"message": "Document not found"
}
Documents
Download Document
Download the actual document file
GET
/
openapi
/
documents
/
{id}
/
download
curl -X GET \
'https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-o downloaded_file.pdf
const response = await fetch(
'https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
// Get the file as a blob
const blob = await response.blob();
// Create download link
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'document.pdf';
document.body.appendChild(a);
a.click();
a.remove();
import requests
url = "https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download"
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.get(url, headers=headers)
# Save to file
with open('downloaded_document.pdf', 'wb') as f:
f.write(response.content)
Binary file content is returned with appropriate headers.
Example headers:
Content-Disposition: attachment; filename="contract_signed.pdf"
Content-Type: application/pdf
Content-Length: 245678
{
"success": false,
"message": "Document not found"
}
Overview
Download the binary file content of a document. Returns the actual file with appropriate content-type headers.Authentication
Requires API Token authentication via Bearer token.Request
string
required
UUID of the document to download
Response
Returns the binary file content with headers:Content-Disposition: attachment; filename="original_filename.pdf"Content-Type: Appropriate MIME type (e.g.,application/pdf,image/png, etc.)
curl -X GET \
'https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-o downloaded_file.pdf
const response = await fetch(
'https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
// Get the file as a blob
const blob = await response.blob();
// Create download link
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'document.pdf';
document.body.appendChild(a);
a.click();
a.remove();
import requests
url = "https://service.incaseof.law/openapi/documents/550e8400-e29b-41d4-a716-446655440000/download"
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.get(url, headers=headers)
# Save to file
with open('downloaded_document.pdf', 'wb') as f:
f.write(response.content)
Binary file content is returned with appropriate headers.
Example headers:
Content-Disposition: attachment; filename="contract_signed.pdf"
Content-Type: application/pdf
Content-Length: 245678
{
"success": false,
"message": "Document not found"
}
Notes
- The response is binary file content, not JSON
- The
Content-Dispositionheader contains the original filename - Use the
Content-Typeheader to determine how to handle the file - Files are served directly from secure storage