> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取附件

> 通过草稿 ID 和附件 ID 下载或检查草稿中的附件。



## OpenAPI

````yaml openapi/zh/agentmail.json GET /agentmail/drafts/{draft_id}/attachments/{attachment_id}
openapi: 3.1.0
info:
  title: AgentMail API
  version: 1.0.0
  description: 通过 AIsa 统一网关公开的 AgentMail 电子邮件 API 端点。改编自上游 docs.agentmail.to OpenAPI 规范。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - Bearer: []
paths:
  /agentmail/drafts/{draft_id}/attachments/{attachment_id}:
    get:
      tags:
        - subpackage_drafts
      summary: 获取附件
      description: >-
        **CLI：**

        ```bash

        agentmail drafts get-attachment --draft-id <draft_id> --attachment-id
        <attachment_id>

        ```
      operationId: get_agentmail_drafts_draft_id_attachments_attachment_id
      parameters:
        - name: draft_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_drafts_DraftId'
        - name: attachment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_attachments_AttachmentId'
        - name: Authorization
          in: header
          description: Bearer 身份验证
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 状态码为 200 的响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_attachments_AttachmentResponse'
        '404':
          description: 状态码为 404 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_drafts_DraftId:
      type: string
      description: 草稿 ID。
      title: DraftId
    type_attachments_AttachmentId:
      type: string
      description: 附件 ID。
      title: AttachmentId
    type_attachments_AttachmentResponse:
      type: object
      properties:
        attachment_id:
          $ref: '#/components/schemas/type_attachments_AttachmentId'
        filename:
          $ref: '#/components/schemas/type_attachments_AttachmentFilename'
        size:
          $ref: '#/components/schemas/type_attachments_AttachmentSize'
        content_type:
          $ref: '#/components/schemas/type_attachments_AttachmentContentType'
        content_disposition:
          $ref: '#/components/schemas/type_attachments_AttachmentContentDisposition'
        content_id:
          $ref: '#/components/schemas/type_attachments_AttachmentContentId'
        download_url:
          type: string
          description: 用于下载附件的 URL。
        expires_at:
          type: string
          format: date-time
          description: 下载 URL 的过期时间。
      required:
        - attachment_id
        - size
        - download_url
        - expires_at
      title: AttachmentResponse
    type__ErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        message:
          $ref: '#/components/schemas/type__ErrorMessage'
      required:
        - name
        - message
      title: ErrorResponse
    type_attachments_AttachmentFilename:
      type: string
      description: 附件文件名。
      title: AttachmentFilename
    type_attachments_AttachmentSize:
      type: integer
      description: 附件大小（字节）。
      title: AttachmentSize
    type_attachments_AttachmentContentType:
      type: string
      description: 附件的内容类型。
      title: AttachmentContentType
    type_attachments_AttachmentContentDisposition:
      type: string
      enum:
        - inline
        - attachment
      description: 附件的内容处置方式。
      title: AttachmentContentDisposition
    type_attachments_AttachmentContentId:
      type: string
      description: 附件的内容 ID。
      title: AttachmentContentId
    type__ErrorName:
      type: string
      description: 错误名称。
      title: ErrorName
    type__ErrorMessage:
      type: string
      description: 错误消息。
      title: ErrorMessage
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````