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, DOC, DOCX, XLSX, PNG, JPG, JPEG
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. | |
ProductID |
integer | The product identifier for document validation. Used to verify document exists within the specified product scope before file replacement. | |
ExternalProductId |
string | Your external product identifier. Alternative to ProductID for product-scoped document validation. | |
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.
ProductID
The product identifier for document validation. Used to verify document exists within the specified product scope before file replacement.
ExternalProductId
Your external product identifier. Alternative to ProductID for product-scoped document validation.
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
}
}