Download Document
The Download Document API allows you to retrieve the actual file content for a specific document. This endpoint is used to download identity documents, proof of address, certificates, and other files that have been previously uploaded to the system.
API Endpoint
GET {base_url}/ExtForm/submissions/{submissionId}/documents/{documentId}/download
Request Format
This endpoint accepts a GET request with submission ID and document ID parameters in the URL path.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
submissionId | string | Yes | The unique identifier of the submission containing the document |
documentId | string | Yes | The unique identifier of the document to download |
Request Headers
Authorization: Bearer {token}
Response Format
The response is a binary file stream with appropriate content type headers for the document being downloaded.
Response Headers
Content-Type: [MIME type of the document]
The Content-Type header will be set to the MIME type of the document (e.g., "image/jpeg", "application/pdf", "image/png"). If the content type is not available in the document metadata, it will be determined based on the file extension.
Response Body
The response body contains the binary content of the requested document.
Example Usage
cURL Example
curl -X GET \
{base_url}/ExtForm/submissions/7ac9ab5e-4123-4456-b8c3-123456789012/documents/a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6/download \
-H 'Authorization: Bearer your_token_here' \
--output downloaded_document.pdf
Error Handling
| Status Code | Description | Solution |
|---|---|---|
| 400 | Invalid submission ID or document ID | Check that the IDs are correctly formatted |
| 401 | Unauthorized | Verify your authentication token |
| 403 | Forbidden | Check that your account has permission to access this document |
| 404 | Submission or document not found | Verify that both the submission ID and document ID exist |
| 500 | Internal server error | Contact support with the error details |
Important Notes
- This API returns the actual document content as a binary stream, not just metadata.
- You should first use the Get Submission Documents API to retrieve document metadata before downloading.
- For large documents, consider implementing timeout handling and resumable downloads in your client application.
- The document is accessed within the context of its submission, enforcing proper access control.
Related Resources
- Get Submission Documents API - Retrieving document metadata
- Upload Documents API - Uploading documents to a submission
- Delete Documents API - Deleting documents
- Document Types Reference - List of document types and their descriptions