Skip to main content

messages

Overview

Namemessages
TypeResource
Idgoogleworkspace.chat.messages

Fields

NameDatatypeDescription
namestringResource name in the form spaces/*/messages/*. Example: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB
createTimestringOutput only. The time at which the message was created in Google Chat server.
argumentTextstringPlain-text body of the message with all Chat app mentions stripped out.
actionResponseobjectParameters that a Chat app can use to configure how it's response is posted.
threadReplybooleanOutput 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.
cardsarrayDeprecated: Use cards_v2 instead. Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message.
slashCommandobjectA slash command in Google Chat.
matchedUrlobjectA matched url in a Chat message. Chat apps can preview matched URLs. For more information, refer to Preview links.
cardsV2arrayRichly formatted and interactive cards that display UI elements and editable widgets, such as: - Formatted text - Buttons - Clickable images - Checkboxes - Radio buttons - Input widgets. Cards are usually displayed below the text-body of a Chat message, but can situationally appear other places, such as dialogs. The cardId is a unique identifier among cards in the same message and for identifying user input values. Currently supported widgets include: - TextParagraph - DecoratedText - Image - ButtonList - Divider
annotationsarrayOutput only. Annotations associated with the text in this message.
clientAssignedMessageIdstringA custom name for a Chat message assigned at creation. Must start with client- and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see Name a created message.
lastUpdateTimestringOutput only. The time at which the message was last edited by a user. If the message has never been edited, this field is empty.
spaceobjectA space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
threadobjectA thread in Google Chat.
textstringPlain-text body of the message. The first link to an image, video, web page, or other preview-able item generates a preview chip.
attachmentarrayUser uploaded attachment.
senderobjectA user in Google Chat.
fallbackTextstringA plain-text description of the message's cards, used when the actual cards cannot be displayed (e.g. mobile notifications).

Methods

NameAccessible byRequired ParamsDescription
spaces_messages_getSELECTmessagesId, spacesIdReturns a message. For example usage, see Read a message. Requires authentication. Fully supports Service account authentication. Supports user authentication as part of the Google Workspace Developer Preview Program, which grants early access to certain features. User authentication requires the chat.messages or chat.messages.readonly authorization scope. Note: Might return a message from a blocked member or space.
spaces_messages_createINSERTspacesIdCreates a message. For example usage, see Create a message. Requires authentication. Fully supports service account authentication. Supports user authentication as part of the Google Workspace Developer Preview Program, which grants early access to certain features. User authentication requires the chat.messages or chat.messages.create authorization scope. Because Chat provides authentication for webhooks as part of the URL that's generated when a webhook is registered, webhooks can create messages without a service account or user authentication.
spaces_messages_deleteDELETEmessagesId, spacesIdDeletes a message. For example usage, see Delete a message. Requires authentication. Fully supports service account authentication. Supports user authentication as part of the Google Workspace Developer Preview Program, which grants early access to certain features. User authentication requires the chat.messages authorization scope.
spaces_messages_patchEXECmessagesId, spacesIdUpdates a message. For example usage, see Update a message. Requires authentication. Fully supports service account authentication. Supports user authentication as part of the Google Workspace Developer Preview Program, which grants early access to certain features. User authentication requires the chat.messages authorization scope.
spaces_messages_updateEXECmessagesId, spacesIdUpdates a message. For example usage, see Update a message. Requires authentication. Fully supports service account authentication. Supports user authentication as part of the Google Workspace Developer Preview Program, which grants early access to certain features. User authentication requires the chat.messages authorization scope.