- Resource: Message
- Card
- CardHeader
- ImageStyle
- Section
- WidgetMarkup
- TextParagraph
- Image
- OnClick
- FormAction
- ActionParameter
- OpenLink
- KeyValue
- Icon
- Button
- TextButton
- ImageButton
- CardAction
- Annotation
- AnnotationType
- UserMentionMetadata
- Type
- SlashCommandMetadata
- Type
- Thread
- ActionResponse
- ResponseType
- SlashCommand
- Methods
Resource: Message
A message in Hangouts Chat.
JSON representation | |
---|---|
{ "name": string, "sender": { object ( |
Fields | |
---|---|
name |
Resource name, in the form "spaces/*/messages/*". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 |
sender |
The user who created the message. |
createTime |
Output only. The time at which the message was created in Hangouts Chat server. |
text |
Plain-text body of the message. |
cards[] |
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. |
previewText |
Text for generating preview chips. This text will not be displayed to the user, but any links to images, web pages, videos, etc. included here will generate preview chips. |
annotations[] |
Output only. Annotations associated with the text in this message. |
thread |
The thread the message belongs to. |
space |
The space the message belongs to. |
fallbackText |
A plain-text description of the message's cards, used when the actual cards cannot be displayed (e.g. mobile notifications). |
actionResponse |
Input only. Parameters that a bot can use to configure how its response is posted. |
argumentText |
Plain-text body of the message with all bot mentions stripped out. |
attachment[] |
User uploaded attachment. |
slashCommand |
Slash command information, if applicable. |
Annotation
Annotations associated with the plain-text body of the message.
Example plain-text message body:
Hello @FooBot how are you!"
The corresponding annotations metadata:
"annotations":[{
"type":"USER_MENTION",
"startIndex":6,
"length":7,
"userMention": {
"user": {
"name":"users/107946847022116401880",
"displayName":"FooBot",
"avatarUrl":"https://goo.gl/aeDtrS",
"type":"BOT"
},
"type":"MENTION"
}
}]
JSON representation | |
---|---|
{ "type": enum ( |
Fields | ||
---|---|---|
type |
The type of this annotation. |
|
startIndex |
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to. |
|
length |
Length of the substring in the plain-text message body this annotation corresponds to. |
|
Union field metadata . Additional metadata about the annotation. metadata can be only one of the following: |
||
userMention |
The metadata of user mention. |
|
slashCommand |
The metadata for a slash command. |
AnnotationType
Type of the annotation.
Enums | |
---|---|
ANNOTATION_TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
USER_MENTION |
A user is mentioned. |
SLASH_COMMAND |
A slash command is invoked. |
UserMentionMetadata
Annotation metadata for user mentions (@).
JSON representation | |
---|---|
{ "user": { object ( |
Fields | |
---|---|
user |
The user mentioned. |
type |
The type of user mention. |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
ADD |
Add user to space. |
MENTION |
Mention user in space. |
SlashCommandMetadata
Annotation metadata for slash commands (/).
JSON representation | |
---|---|
{ "bot": { object ( |
Fields | |
---|---|
bot |
The bot whose command was invoked. |
type |
The type of slash command. |
commandName |
The name of the invoked slash command. |
commandId |
The command id of the invoked slash command. |
triggersDialog |
Indicating whether the slash command is for a dialog. |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
ADD |
Add bot to space. |
INVOKE |
Invoke slash command in space. |
Thread
A thread in Hangouts Chat.
JSON representation | |
---|---|
{ "name": string } |
Fields | |
---|---|
name |
Resource name, in the form "spaces/*/threads/*". Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 |
ActionResponse
Parameters that a bot can use to configure how it's response is posted.
JSON representation | |
---|---|
{
"type": enum ( |
Fields | |
---|---|
type |
The type of bot response. |
url |
URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
ResponseType
The type of bot response.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default type; will be handled as NEW_MESSAGE. |
NEW_MESSAGE |
Post as a new message in the topic. |
UPDATE_MESSAGE |
Update the bot's own message. (Only after CARD_CLICKED events.) |
REQUEST_CONFIG |
Privately ask the user for additional auth or config. |
SlashCommand
A Slash Command in Hangouts Chat.
JSON representation | |
---|---|
{ "commandId": string } |
Fields | |
---|---|
commandId |
The id of the slash command invoked. |
Methods |
|
---|---|
|
Creates a message. |
|
Deletes a message. |
|
Returns a message. |
|
Updates a message. |