media

POST /v1/spaces/{spacesId}/attachments:upload

Changed on

Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.create - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.

Request

  • Base URL
    https://chat.googleapis.com
  • URL
    https://chat.googleapis.com/v1/spaces/{spacesId}/attachments:upload
  • Auth
    • OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/chat.bot
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.bot
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/chat.import
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.import
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/chat.messages
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.messages
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/chat.messages.create
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.messages.create

Path parameters

spacesIdstring required

Request body

filenamestring

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

Response

Successful response

Changes

    • info

      the security scope https://www.googleapis.com/auth/chat.bot was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/chat.bot was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/chat.messages.create was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/chat.messages.create was removed from the endpoint's security scheme Oauth2c