AttachmentService

PATCH /api/attachments/{attachment}

Changed on

UpdateAttachment updates an attachment. Only filename can be updated. The caller must be the uploader or an admin.

Request

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

Path parameters

attachmentstring required

The attachment id.

Query parameters

updateMaskstring field-mask

Required. The fields to update. Only filename is supported.

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