AttachmentService

POST /api/attachments

Changed on

CreateAttachment creates an attachment from inline content.

Request

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

Query parameters

attachmentIdstring

Optional. The ID to use for the attachment. If empty, a unique ID is generated. Format: ^a-zA-Z0-9?$

Request body

namestring

Identifier. The resource name of the attachment. Format: attachments/{attachment}

creatorstring

Output only. The user who uploaded the attachment, which may differ from the creator of the linked memo. Format: users/{user}

filenamestring required

Required. The filename of the attachment.

typestring required

Required. The MIME type of the attachment. If empty on create, the service detects it from the filename and content.

contentstring bytes

Input only. The content of the attachment.

externalLinkstring

Optional. The external link of the attachment. Set only for externally stored attachments; ignored on create.

memostring

Optional. The memo the attachment is linked to. On create, the caller must be able to manage the memo. Format: memos/{memo}

sizestring

Output only. The size of the stored content in bytes.

createTimestring date-time

Output only. The creation time.

Response

OK

namestring

Identifier. The resource name of the attachment. Format: attachments/{attachment}

creatorstring

Output only. The user who uploaded the attachment, which may differ from the creator of the linked memo. Format: users/{user}

filenamestring required

Required. The filename of the attachment.

typestring required

Required. The MIME type of the attachment. If empty on create, the service detects it from the filename and content.

contentstring bytes

Input only. The content of the attachment.

externalLinkstring

Optional. The external link of the attachment. Set only for externally stored attachments; ignored on create.

memostring

Optional. The memo the attachment is linked to. On create, the caller must be able to manage the memo. Format: memos/{memo}

sizestring

Output only. The size of the stored content in bytes.

createTimestring date-time

Output only. The creation time.

Changes