AttachmentService

POST /api/attachments:upload

Changed on

UploadAttachment uploads a file in bounded chunks. The first call carries the spec and returns an upload_id; later calls carry that upload_id. Uploads are bound to the authenticated user, expire after 30 minutes of inactivity, and do not survive a server restart.

Request

  • The document declares no server URL.
  • Auth
    none declared

Request body

uploadIdstring

Continues the upload identified by a previous response.

writeOffsetstring required

Required. Zero-based byte offset at which data is written. Must equal the committed size, except when retrying the most recently accepted chunk with identical bytes and offset, which is accepted without writing again.

datastring bytes

Optional. File bytes, at most max_chunk_size long. With no data and finish_write false, the call reports progress without writing, and write_offset is ignored.

finishWriteboolean

Optional. Finalize the upload after writing data. The committed size must then equal total_size. Any later call for the same upload_id returns the created attachment.

Response

OK

uploadIdstring

Opaque ID for subsequent calls. This is not a resource name.

committedSizestring

Number of file bytes committed so far.

maxChunkSizeinteger

Maximum number of data bytes accepted in one call.

Changes