Skip to content

Attachment Download



GET /api/v1/attachment/{attachment_uuid}/download

Overview

Download the original file in the current workspace by attachment ID. A successful response contains the file's binary data.

Prerequisites and Usage Steps

  1. Take the value from content.attachmentUuid in the successful response of Attachment Upload.
  2. Use a workspace API Key with read permission, and put the attachment ID in the request path.
  3. Check the HTTP status first. On 200, save the response as a file; the original file name is in Content-Disposition. If the command fails, check the status first; if you need to read the error JSON, query the same attachment path with curl -i.

Path Parameters

Parameter Type Required Description
attachment_uuid string Y Attachment ID
Allows null: False
Example: att_00000000000000000000000000000000
How to get or fill: Take the value from content.attachmentUuid in the successful response of Attachment Upload.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y AK identifier, AK uuid
Example: <DF-API-KEY>
How to get or fill: Obtain a Key with permission 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.guance.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 is 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 Responses

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 has no matching record 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.

Feedback

Is this page helpful?