spaces

GET /v1/spaces/{spacesId}/messages/{messagesId}

Changed on

Returns details about a message. For an example, see Get details about a message. Supports the following types of authentication: - App authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.bot: When using this authorization scope, this method returns details about a message the Chat app has access to, like direct messages and slash commands that invoke the Chat app. - https://www.googleapis.com/auth/chat.app.messages.readonly with administrator approval. When using this authentication scope, this method returns details about a public message in a space. - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.readonly - https://www.googleapis.com/auth/chat.messages Note: Might return a message from a blocked member or space.

Request

  • Base URL
    https://chat.googleapis.com
  • URL
    https://chat.googleapis.com/v1/spaces/{spacesId}/messages/{messagesId}
  • Auth
    • OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/chat.app.messages.readonly
      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.app.messages.readonly
    • or 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.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.readonly
      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.readonly

Path parameters

spacesIdstring required
messagesIdstring required

Query parameters

markupSyntax'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN'

Optional. Specifies the desired output syntax for the Chat message formatted_text field.

Response

Successful response

argumentTextstring

Output only. Plain-text body of the message with all Chat app mentions stripped out.

clientAssignedMessageIdstring

Optional. A custom ID for the message. You can use field to identify a message, or to get, delete, or update a message. To set a custom ID, specify the messageId field when you create the message. For details, see Name a message.

createTimestring google-datetime

Optional. Immutable. For spaces created in Chat, the time at which the message was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the message was created in the source in order to preserve the original creation time.

deleteTimestring google-datetime

Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty.

fallbackTextstring

Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications.

formattedTextstring

Output only. Contains the message text with markups added to communicate formatting. This field might not capture all formatting visible in the UI, but includes the following: * Markup syntax for bold, italic, strikethrough, monospace, monospace block, bulleted list, and block quote. * User mentions using the format . * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the first string is the URL and the second is the rendered text—for example, . * Custom emoji using the format :{emoji_name}:—for example, :smile:. This doesn't apply to Unicode emoji, such as U+1F600 for a grinning face emoji. * Bullet list items using asterisks (*)—for example, * item. For more information, see View text formatting sent in a message

lastUpdateTimestring google-datetime

Output only. The time at which the message was last edited by a user. If the message has never been edited, this field is empty.

markupSyntax'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN'

Optional. Specifies how the server interprets the message text field content when creating a message or updating the text field of a message. When calling UpdateMessage, set markup_syntax and text on the Message resource and include text (not markup_syntax) in update_mask.

namestring

Identifier. Resource name of the message. Format: spaces/{space}/messages/{message} Where {space} is the ID of the space where the message is posted and {message} is a system-assigned ID for the message. For example, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing {message} with the value from the clientAssignedMessageId field. For example, spaces/AAAAAAAAAAA/messages/client-custom-name. For details, see Name a message.

silentboolean

Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.

textstring

Optional. Plain-text body of the message. The first link to an image, video, or web page generates a preview chip. You can also @mention a Google Chat user, or everyone in the space. To learn about creating text messages, see Send a message.

threadReplyboolean

Output only. When true, the message is a response in a reply thread. When false, the message is visible in the space's top-level conversation as either the first message of a thread or a message with no threaded replies. If the space doesn't support reply in threads, this field is always false.

Changes

    • info

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

    • info

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

    • info

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

    • info

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