Method: media.upload

Stay organized with collections Save and categorize content based on your preferences.

Uploads an attachment. Requires user authentication.

HTTP request

  • Upload URI, for media upload requests:
    POST https://chat.googleapis.com/upload/v1/{parent=spaces/*}/attachments:upload

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}".

Request body

The request body contains data with the following structure:

JSON representation
{
  "filename": string
}
Fields
filename

string

Required. The filename of the attachment, including the file extension.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "attachmentDataRef": {
    object (AttachmentDataRef)
  }
}
Fields
attachmentDataRef

object (AttachmentDataRef)

Reference to the uploaded attachment.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/chat.messages.create
  • https://www.googleapis.com/auth/chat.messages

For more information, see the Authorization guide.