跳到主要内容

aiAttachmentsGet

AiAttachment aiAttachmentsGet(AiAttachmentsGetRequest)

POST /api/2.0/ai/attachments/get

Get one attachment

Returns one attachment by its ID, whether it is still a draft or already bound to a message. The ID is required and has to be a non-empty string. An ID that no longer exists is not reported as 404: the answer is a null body with status 200, so treat a missing payload as no such attachment. Use POST api/2.0/ai/attachments/get-many to read several at once.

Parameters​

NameInTypeDescriptionNotes
AiAttachmentsGetRequestbodyStringThe ID of the attachment to read, as a bare JSON string.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The attachment, or a null body when no attachment has that ID.AiAttachment-
400The attachment ID is missing.AiErrorResponse-
401Missing asc_auth_key cookie or Authorization header.AiErrorResponse-
403AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API.AiErrorResponse-
413The request body is larger than 100 KB, the JSON parser's limit on this route.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

AiAttachment

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json