Mail messages

Открыть сессию загрузки файла для письма

Changed on

Файл кладётся прямо в хранилище кабинета по подписанному адресу, мимо API: так его загружают агент по MCP и клиенты с крупными файлами. Ответ называет путь байтов: post — один multipart POST на upload.url с полями upload.fields и файлом последним полем upload.file_field; parts — PUT каждой части на upload.direct_urls; api — хранилище подписывать не умеет, байты идут PUT на upload.url этого API с авторизацией. Затем mailFinishUploadSession проверяет размер, контрольную сумму и антивирус и заводит загрузку письма для upload_ids. Потолок файла — 25 МБ.

post/api/v1/mail/accounts/{id}/upload-sessions

Request

  • Base URL
    https://erp.akeda.ru
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://erp.akeda.ru/oauth2/authorize
      Token URLhttps://erp.akeda.ru/oauth2/token
      Scopesakeda:delegate

Path parameters

id, string uuid required

Headers

X-Tenant, string required

Slug выбранного кабинета; кабинет не является юрлицом

Request body

TransferUploadRequest required

Заявка на сессию загрузки файла по подписанному адресу.

name, string required

Имя файла с расширением

mime_type, string

Тип содержимого; по умолчанию application/octet-stream

size_bytes, integer required

Точный размер файла в байтах

sha256, string

Необязательная контрольная сумма SHA-256 строчными шестнадцатеричными знаками

Response

Сессия и адрес для байтов

TransferSession required

Сессия загрузки файла по подписанному адресу хранилища. Ключи хранилища наружу не отдаются.

id, string uuid required
owner_type, string required
owner_id, string
name, string required
mime_type, string required
size_bytes, integer required
sha256, string
attributes, object
status, 'pending' | 'processing' | 'attached' | 'failed' | 'expired' required
failure, 'infected' | 'size' | 'checksum' | 'storage' | 'owner' | 'aborted' | 'expired'
failure_detail, string
scan_status, 'pending' | 'clean' | 'infected' | 'skipped'
scan_verdict, string
published_ref, string

Номер строки, заведённой по файлу; у почты — id загрузки для upload_ids

expires_at, string date-time required
created_at, string date-time required
completed_at, string date-time
upload, TransferInstructions

Как передать байты. Выдаётся один раз, при открытии сессии.

Changes

    • info

      added the optional property field to the response with the status

    • info

      added the optional property field to the response with the status

    • info

      added the optional property field to the response with the status

    9 more changes in this revision