Attachment Download¶
GET /api/v1/attachment/{attachment_uuid}/download
Overview¶
Download the original file in the current workspace using the attachment ID. A successful response contains the file's binary data.
Prerequisites and Usage Steps¶
- Get the value from content.attachmentUuid in the successful response of Attachment Upload.
- Use a workspace API Key with read permission, and place the attachment ID in the request path.
- Check the HTTP status first. If the status is 200, save the response as a file; see Content-Disposition for the original file name. If the command fails, check the status first; if you need to read the error JSON, use
curl -ito query the same attachment path.
Route Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| attachment_uuid | string | Y | Attachment ID Null allowed: False Example: att_00000000000000000000000000000000How to obtain or enter: Take the value from content.attachmentUuid in the successful response of Attachment Upload. |
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | AK identifier, AK UUID Example: <DF-API-KEY>How to obtain or enter: Obtain a Key with permissions for this API from API Key Management in the target workspace. |
Request Example¶
curl --fail --dump-header response-headers.txt --output downloaded.bin 'https://openapi.truewatch.com/api/v1/attachment/att_00000000000000000000000000000000/download' \
-H 'DF-API-KEY: <DF-API-KEY>'
Response¶
HTTP 200, application/octet-stream; charset=UTF-8. The body contains the raw file bytes.
| Response Header | Type | Description |
|---|---|---|
| Content-Type | string | application/octet-stream; charset=UTF-8. |
| Content-Disposition | string | attachment; filename=<URL-encoded original file name>. |
HTTP/1.1 200 OK
Content-Type: application/octet-stream; charset=UTF-8
Content-Disposition: attachment; filename=report.pdf
<file bytes>
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 404 | ft.NotFoundAttachment | The attachment does not exist, has been deleted, or no matching record exists in the current workspace | The corresponding attachment resource information was not found. | Verify the attachment ID and the workspace of the API Key, and re-upload if necessary. |