Upload Image API (Optional)
This API is supported starting from v9, currently used for uploading images during Markdown document editing.
| Method | API | Description |
|---|---|---|
| POST | /{context}/{docId}/file/image | Upload image to business system |
Description:
When a user inserts an image in the Markdown editor, zOffice Server sends the image file to the business system via this API. The business system must store the image and return an accessible image URL for the deployment environment, which will be written into the Markdown content (e.g.,  format).
Request
| Parameter | Required | Location | Description | Type | Default |
|---|---|---|---|---|---|
| docId | Yes | Path | The ID of the document being edited | string | |
| Content-Type | Yes | Header | Must be multipart/form-data | string | |
| file | Yes | Body (form data) | The image file itself. MIME type must start with image/ (e.g. image/png, image/jpeg) | multipartfile |
Request Example:
POST http://172.16.52.223/v2/context/484/file/image
Content-Type: multipart/form-data
------boundary
Content-Disposition: form-data; name="file"; filename="screenshot.png"
Content-Type: image/png
<image binary data>
------boundary--
Response
Success Response (200):
The business system must return a JSON containing the accessible image URL.
{
"url": "https://your-domain.com/images/screenshot.png"
}
Image Deletion Policy
When a user deletes an image reference () in the Markdown editor, zOffice Server will NOT send a delete request to the business system. Only the corresponding Markdown image syntax is removed from the document content. The lifecycle of the image file is managed by the business system.
Limitations
This API currently supports standard and frontend integration modes.
The frontend SDK integration mode is not supported and will return HTTP 501.
Configuration
Before integration, enable the MD image upload feature in the zOffice Server Admin Console:
- Navigate to Admin Console → Third-party App Configuration
- Edit the target third-party app and check "Enable MD Image Upload"
- Save the configuration
This option is disabled by default. When not enabled, image upload requests from the frontend will return HTTP 403.