PUT
/Document/File
Usage Notes
When
- Replace file content for existing document
- Update document files with corrected versions
Requirements
- Document record must exist
- Supported file types: PDF, DOCX, XLSX, CSV, PNG, JPG
Notes
- Completely replaces existing file content
- Previous file version is permanently removed
- MIME type validation on upload
Description
Replaces existing file content for a document record. Validates file type and stores securely.
Required Headers - See Authentication
| Header | Value | Description |
|---|---|---|
| Content-Type | multipart/form-data | Request content type for file uploads |
| Authorization | {accessToken} | Bearer token for API access |
| Version | 2.0 | API version identifier |
Request Body (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
DocumentID |
integer | The native 7G identifier for the document record with existing file content to replace. | |
ExternalDocumentId |
string | Your external system identifier for the document record with existing file content to replace. | |
file |
binary | The binary file content to replace the existing file. Supports various formats depending on document type and system configuration. |
DocumentID
The native 7G identifier for the document record with existing file content to replace.
ExternalDocumentId
Your external system identifier for the document record with existing file content to replace.
file
The binary file content to replace the existing file. Supports various formats depending on document type and system configuration.
Example Requests
bash
# Replace file in document by native ID
curl -X PUT 'https://api.7g.com.au/Document/File' \
-H 'Authorization: {accessToken}' \
-H 'Version: 2.0' \
-F 'DocumentID=12345' \
-F 'file=@/path/to/updated_statement.pdf'
# Replace file in document by external ID
curl -X PUT 'https://api.7g.com.au/Document/File' \
-H 'Authorization: {accessToken}' \
-H 'Version: 2.0' \
-F 'ExternalDocumentId=INV-STMT-2024-001' \
-F 'file=@/path/to/corrected_document.pdf'Response Examples
json
{
"result": true,
"message": "File uploaded successfully",
"recordCount": 1,
"data": {
"documentID": 12345,
"externalDocumentId": null,
"documentTypeID": 1,
"name": "Investor Statement Q4 2024",
"code": "INV-STMT-Q4-2024",
"description": "Quarterly investment statement (corrected)",
"password": null,
"ordinal": 1,
"productID": 100,
"externalProductId": null,
"bizEntityID": 5678,
"externalBizEntityId": null,
"organisationID": null,
"externalOrganisationId": null,
"showInDocumentsInPortal": true,
"isPublic": false
}
}