Cards v2 - Google Chat - Google For Developers
Cards v2 - Google Chat - Google For Developers
Got 5 minutes? Help us improve Google Chat API documentation by taking a quick survey
(https://ows.io/tj/jy5h86v7).
Cards v2
Card
Cards support a defined layout, interactive UI elements like buttons, and rich media like
images. Use cards to present detailed information, gather information from users, and guide
users to take a next step.
As stand-alone messages.
As a dialog (https://developers.google.com/chat/how-tos/dialogs).
A header with the contact's name, job title, and avatar picture.
Buttons that users can click to share the contact, or see more or less information.
https://developers.google.com/chat/api/reference/rest/v1/cards 1/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
{
"cardsV2": [
{
"cardId": "unique-card-id",
"card": {
"header": {
"title": "Sasha",
"subtitle": "Software Engineer",
"imageUrl":
"https://developers.google.com/chat/images/quickstart-app-avatar.png",
"imageType": "CIRCLE",
"imageAltText": "Avatar for Sasha",
},
"sections": [
{
"header": "Contact Info",
"collapsible": true,
"uncollapsibleWidgetsCount": 1,
"widgets": [
{
"decoratedText": {
"startIcon": {
"knownIcon": "EMAIL",
},
"text": "[email protected]",
}
},
https://developers.google.com/chat/api/reference/rest/v1/cards 2/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
{
"decoratedText": {
"startIcon": {
"knownIcon": "PERSON",
},
"text": "<font color=\"#80e27e\">Online</font>",
},
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PHONE",
},
"text": "+1 (555) 555-1234",
}
},
{
"buttonList": {
"buttons": [
{
"text": "Share",
"onClick": {
"openLink": {
"url": "https://example.com/share",
}
}
},
{
"text": "Edit",
"onClick": {
"action": {
"function": "goToView",
"parameters": [
{
"key": "viewType",
"value": "EDIT",
}
],
}
}
},
],
}
},
],
https://developers.google.com/chat/api/reference/rest/v1/cards 3/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
},
],
},
}
],
}
JSON representation
{
"header": {
object (CardHeader (/chat/api/reference/rest/v1/cards#CardHeader_1))
},
"sections": [
{
object (Section (/chat/api/reference/rest/v1/cards#Section_1))
}
],
"cardActions": [
{
object (CardAction (/chat/api/reference/rest/v1/cards#CardAction_1))
}
],
"name": string,
"fixedFooter": {
object (CardFixedFooter (/chat/api/reference/rest/v1/cards#CardFixedFooter))
},
"displayStyle": enum (DisplayStyle (/chat/api/reference/rest/v1/cards#DisplayStyle)),
"peekCardHeader": {
object (CardHeader (/chat/api/reference/rest/v1/cards#CardHeader_1))
}
}
Fields
The header of the card. A header usually contains a leading image and a title.
Headers always appear at the top of a card.
https://developers.google.com/chat/api/reference/rest/v1/cards 4/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Contains a collection of widgets. Each section has its own, optional header.
Sections are visually separated by a line divider.
The card's actions. Actions are added to the card's toolbar menu.
For example, the following JSON constructs a card action menu with Settings
and Send Feedback options:
"cardActions": [
{
"actionLabel": "Settings",
"onClick": {
"action": {
"functionName": "goToView",
"parameters": [
{
"key": "viewType",
"value": "SETTING"
}
],
"loadIndicator": "LoadIndicator.SPINNER"
}
}
},
{
"actionLabel": "Send Feedback",
"onClick": {
"openLink": {
"url": "https://example.com/feedback"
}
}
}
]
name string
https://developers.google.com/chat/api/reference/rest/v1/cards 5/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Because Chat apps don't support card navigation, they ignore this field.
Supported by Google Workspace Add-ons and Chat apps. For Chat apps, you can
use fixed footers in dialogs
(https://developers.google.com/chat/how-tos/dialogs), but not card messages
(https://developers.google.com/chat/api/guides/message-formats/cards).
When displaying contextual content, the peek card header acts as a placeholder
so that the user can navigate forward between the homepage cards and the
contextual cards.
CardHeader
Represents a card header.
JSON representation
{
"title": string,
"subtitle": string,
"imageType": enum (ImageType (/chat/api/reference/rest/v1/cards#ImageType)),
"imageUrl": string,
https://developers.google.com/chat/api/reference/rest/v1/cards 6/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
"imageAltText": string
}
Fields
title string
Required. The title of the card header. The header has a fixed height: if both a title
and subtitle are specified, each takes up one line. If only the title is specified, it
takes up both lines.
subtitle string
The subtitle of the card header. If specified, appears on its own line below the
title.
imageUrl string
imageAltText string
ImageType
The shape used to crop the image.
Enums
SQUARE Default value. Applies a square mask to the image. For example, a 4x3 image
becomes 3x3.
CIRCLE Applies a circular mask to the image. For example, a 4x3 image becomes a circle
with a diameter of 3.
https://developers.google.com/chat/api/reference/rest/v1/cards 7/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Section
A section contains a collection of widgets that are rendered vertically in the order that they're
specified.
JSON representation
{
"header": string,
"widgets": [
{
object (Widget (/chat/api/reference/rest/v1/cards#Widget))
}
],
"collapsible": boolean,
"uncollapsibleWidgetsCount": integer
}
Fields
header string
Text that appears at the top of a section. Supports simple HTML formatted text.
For more information about formatting text, see Formatting text in Google Chat
apps
(https://developers.google.com/chat/api/guides/message-
formats/cards#card_text_formatting)
and Formatting text in Google Workspace Add-ons
(https://developers.google.com/apps-script/add-
ons/concepts/widgets#text_formatting)
.
All the widgets in the section. Must contain at least one widget.
collapsible boolean
Collapsible sections hide some or all widgets, but users can expand the section
to reveal the hidden widgets by clicking Show more. Users can hide the widgets
https://developers.google.com/chat/api/reference/rest/v1/cards 8/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
uncollapsibleWidget integer
sCount
The number of uncollapsible widgets which remain visible even when a section is
collapsed.
Widget
Each card is made up of widgets.
A widget is a composite object that can represent one of text, images, buttons, and other
object types.
JSON representation
{
"horizontalAlignment": enum (HorizontalAlignment (/chat/api/reference/rest/v1/cards#Hor
https://developers.google.com/chat/api/reference/rest/v1/cards 9/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
},
"textInput": {
object (TextInput (/chat/api/reference/rest/v1/cards#TextInput))
},
"selectionInput": {
object (SelectionInput (/chat/api/reference/rest/v1/cards#SelectionInput))
},
"dateTimePicker": {
object (DateTimePicker (/chat/api/reference/rest/v1/cards#DateTimePicker))
},
"divider": {
object (Divider (/chat/api/reference/rest/v1/cards#Divider))
},
"grid": {
object (Grid (/chat/api/reference/rest/v1/cards#Grid))
},
"columns": {
object (Columns (/chat/api/reference/rest/v1/cards#Columns))
}
// End of list of possible types for union field data.
}
Fields
Union field data. A widget can only have one of the following items. You can use multiple widget fields to
display more items. data can be only one of the following:
Displays a text paragraph. Supports simple HTML formatted text. For more
information about formatting text, see Formatting text in Google Chat apps
(https://developers.google.com/chat/api/guides/message-
formats/cards#card_text_formatting)
and Formatting text in Google Workspace Add-ons
https://developers.google.com/chat/api/reference/rest/v1/cards 10/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
(https://developers.google.com/apps-script/add-
ons/concepts/widgets#text_formatting)
.
"textParagraph": {
"text": " <b>bold text</b>"
}
Displays an image.
For example, the following JSON creates an image with alternative text:
"image": {
"imageUrl":
"https://developers.google.com/chat/images/quickstart-app-
"altText": "Chat app avatar"
}
For example, the following JSON creates a decorated text widget showing email
address:
"decoratedText": {
"icon": {
"knownIcon": "EMAIL"
},
"topLabel": "Email Address",
"text": "[email protected]",
"bottomLabel": "This is a new Email address!",
"switchControl": {
https://developers.google.com/chat/api/reference/rest/v1/cards 11/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
"name": "has_send_welcome_email_to_sasha",
"selected": false,
"controlType": "CHECKBOX"
}
}
A list of buttons.
For example, the following JSON creates two buttons. The first is a blue text
button and the second is an image button that opens a link:
"buttonList": {
"buttons": [
{
"text": "Edit",
"color": {
"red": 0,
"green": 0,
"blue": 1,
"alpha": 1
},
"disabled": true,
},
{
"icon": {
"knownIcon": "INVITE",
"altText": "check calendar"
},
"onClick": {
"openLink": {
"url": "https://example.com/calendar"
}
}
}
]
}
https://developers.google.com/chat/api/reference/rest/v1/cards 12/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
For example, the following JSON creates a text input for an email address:
"textInput": {
"name": "mailing_address",
"label": "Mailing Address"
}
As another example, the following JSON creates a text input for a programming
language with static suggestions:
"textInput": {
"name": "preferred_programing_language",
"label": "Preferred Language",
"initialSuggestions": {
"items": [
{
"text": "C++"
},
{
"text": "Java"
},
{
"text": "JavaScript"
},
{
"text": "Python"
}
]
}
}
Displays a selection control that lets users select items. Selection controls can
be checkboxes, radio buttons, switches, or dropdown menus.
https://developers.google.com/chat/api/reference/rest/v1/cards 13/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
For example, the following JSON creates a dropdown menu that lets users
choose a size:
"selectionInput": {
"name": "size",
"label": "Size"
"type": "DROPDOWN",
"items": [
{
"text": "S",
"value": "small",
"selected": false
},
{
"text": "M",
"value": "medium",
"selected": true
},
{
"text": "L",
"value": "large",
"selected": false
},
{
"text": "XL",
"value": "extra_large",
"selected": false
}
]
}
Displays a widget that lets users input a date, time, or date and time.
For example, the following JSON creates a date time picker to schedule an
appointment:
https://developers.google.com/chat/api/reference/rest/v1/cards 14/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
"divider": {
}
A grid supports any number of columns and items. The number of rows is
determined by the upper bounds of the number items divided by the number of
columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items
and 2 columns has 6 rows.
For example, the following JSON creates a 2 column grid with a single item:
"grid": {
"title": "A fine collection of items",
"columnCount": 2,
"borderStyle": {
"type": "STROKE",
"cornerRadius": 4
},
"items": [
{
"image": {
"imageUri": "https://www.example.com/image.png",
https://developers.google.com/chat/api/reference/rest/v1/cards 15/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
"cropStyle": {
"type": "SQUARE"
},
"borderStyle": {
"type": "STROKE"
}
},
"title": "An item",
"textAlignment": "CENTER"
}
],
"onClick": {
"openLink": {
"url": "https://www.example.com"
}
}
}
Displays up to 2 columns.
To include more than 2 columns, or to use rows, use the Grid widget.
For example, the following JSON creates 2 columns that each contain text
paragraphs:
"columns": {
"columnItems": [
{
"horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
"horizontalAlignment": "CENTER",
"verticalAlignment": "CENTER",
"widgets": [
{
"textParagraph": {
"text": "First column text paragraph"
}
}
]
},
https://developers.google.com/chat/api/reference/rest/v1/cards 16/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
{
"horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
"horizontalAlignment": "CENTER",
"verticalAlignment": "CENTER",
"widgets": [
{
"textParagraph": {
"text": "Second column text paragraph"
}
}
]
}
]
}
TextParagraph
A paragraph of text that supports formatting. For more information about formatting text, see
Formatting text in Google Chat apps
(https://developers.google.com/chat/api/guides/message-formats/cards#card_text_formatting) and
Formatting text in Google Workspace Add-ons
(https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
JSON representation
{
"text": string
}
Fields
text string
https://developers.google.com/chat/api/reference/rest/v1/cards 17/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Image
An image that is specified by a URL and can have an onClick action.
JSON representation
{
"imageUrl": string,
"onClick": {
object (OnClick (/chat/api/reference/rest/v1/cards#OnClick_1))
},
"altText": string
}
Fields
imageUrl string
For example:
https://developers.google.com/chat/images/quickstart-app-ava
When a user clicks the image, the click triggers this action.
altText string
OnClick
Represents how to respond when users click an interactive element on a card, such as a
button.
https://developers.google.com/chat/api/reference/rest/v1/cards 18/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
Fields
https://developers.google.com/chat/api/reference/rest/v1/cards 19/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Action
An action that describes the behavior when the form is submitted. For example, you can invoke
an Apps Script script to handle the form. If the action is triggered, the form values are sent to
the server.
JSON representation
{
"function": string,
"parameters": [
{
object (ActionParameter (/chat/api/reference/rest/v1/cards#ActionParameter_1))
}
],
"loadIndicator": enum (LoadIndicator (/chat/api/reference/rest/v1/cards#LoadIndicator)),
"persistValues": boolean,
"interaction": enum (Interaction (/chat/api/reference/rest/v1/cards#Interaction))
}
Fields
function string
https://developers.google.com/chat/api/reference/rest/v1/cards 20/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Specifies the loading indicator that the action displays while making the call to
the action.
persistValues boolean
Indicates whether form values persist after the action. The default value is
false.
If true, form values remain after the action is triggered. To let the user make
changes while the action is being processed, set LoadIndicator
(https://developers.google.com/workspace/add-
ons/reference/rpc/google.apps.card.v1#loadindicator)
to NONE. For card messages
(https://developers.google.com/chat/api/guides/message-formats/cards) in
Chat apps, you must also set the action's ResponseType
(https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#r
esponsetype)
to UPDATE_MESSAGE and use the same cardId
(https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#
CardWithId)
from the card that contained the action.
If false, the form values are cleared when the action is triggered. To prevent the
user from making changes while the action is being processed, set
LoadIndicator
(https://developers.google.com/workspace/add-
ons/reference/rpc/google.apps.card.v1#loadindicator)
to SPINNER.
https://developers.google.com/chat/api/reference/rest/v1/cards 21/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Supported by Chat apps, but not Google Workspace Add-ons. If specified for an
add-on, the entire card is stripped and nothing is shown in the client.
ActionParameter
List of string parameters to supply when the action method is invoked. For example, consider
three snooze buttons: snooze now, snooze one day, or snooze next week. You might use
action method = snooze(), passing the snooze type and snooze time in the list of string
parameters.
JSON representation
{
"key": string,
"value": string
}
Fields
key string
value string
LoadIndicator
Specifies the loading indicator that the action displays while making the call to the action.
https://developers.google.com/chat/api/reference/rest/v1/cards 22/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Enums
Interaction
Optional. Required when opening a dialog (https://developers.google.com/chat/how-tos/dialogs).
What to do in response to an interaction with a user, such as a user clicking a button in a card
message.
If unspecified, the app responds by executing an action —like opening a link or running a
function—as normal.
By specifying an interaction, the app can respond in special interactive ways. For example,
by setting interaction to OPEN_DIALOG, the app can open a dialog
(https://developers.google.com/chat/how-tos/dialogs).
Supported by Chat apps, but not Google Workspace Add-ons. If specified for an add-on, the
entire card is stripped and nothing is shown in the client.
Enums
https://developers.google.com/chat/api/reference/rest/v1/cards 23/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
OpenLink
Represents an onClick event that opens a hyperlink.
JSON representation
{
"url": string,
"openAs": enum (OpenAs (/chat/api/reference/rest/v1/cards#OpenAs)),
"onClose": enum (OnClose (/chat/api/reference/rest/v1/cards#OnClose))
}
Fields
url string
Whether the client forgets about a link after opening it, or observes it until the
window closes. Not supported by Chat apps.
OpenAs
When an OnClick action opens a link, then the client can either open it as a full-size window (if
that's the frame used by the client), or an overlay (such as a pop-up). The implementation
depends on the client platform capabilities, and the value selected might be ignored if the
client doesn't support it. FULL_SIZE is supported by all clients.
https://developers.google.com/chat/api/reference/rest/v1/cards 24/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Enums
FULL_SIZE The link opens as a full-size window (if that's the frame used by the client).
OnClose
What the client does when a link opened by an OnClick action is closed.
Implementation depends on client platform capabilities. For example, a web browser might
open a link in a pop-up window with an OnClose handler.
If both OnOpen and OnClose handlers are set, and the client platform can't support both values,
OnClose takes precedence.
Enums
DecoratedText
A widget that displays text with optional decorations such as a label above or below the text,
an icon in front of the text, a selection widget, or a button after the text.
https://developers.google.com/chat/api/reference/rest/v1/cards 25/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"icon": {
object (Icon (/chat/api/reference/rest/v1/cards#Icon_1))
},
"startIcon": {
object (Icon (/chat/api/reference/rest/v1/cards#Icon_1))
},
"topLabel": string,
"text": string,
"wrapText": boolean,
"bottomLabel": string,
"onClick": {
object (OnClick (/chat/api/reference/rest/v1/cards#OnClick_1))
},
Fields
topLabel string
https://developers.google.com/chat/api/reference/rest/v1/cards 26/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
text string
Supports simple formatting. For more information about formatting text, see
Formatting text in Google Chat apps
(https://developers.google.com/chat/api/guides/message-
formats/cards#card_text_formatting)
and Formatting text in Google Workspace Add-ons
(https://developers.google.com/apps-script/add-
ons/concepts/widgets#text_formatting)
.
wrapText boolean
The wrap text setting. If true, the text wraps and displays on multiple lines.
Otherwise, the text is truncated.
bottomLabel string
Union field control. A button, switch, checkbox, or image that appears to the right-hand side of text in the
decoratedText widget. control can be only one of the following:
A switch widget that a user can click to change its state and trigger an action.
https://developers.google.com/chat/api/reference/rest/v1/cards 27/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Supports built-in
(https://developers.google.com/chat/api/guides/message-
formats/cards#builtinicons)
and custom
(https://developers.google.com/chat/api/guides/message-
formats/cards#customicons)
icons.
Icon
An icon displayed in a widget on a card.
Supports built-in (https://developers.google.com/chat/api/guides/message-formats/cards#builtinicons)
and custom (https://developers.google.com/chat/api/guides/message-formats/cards#customicons)
icons.
JSON representation
{
"altText": string,
"imageType": enum (ImageType (/chat/api/reference/rest/v1/cards#ImageType)),
Fields
altText string
https://developers.google.com/chat/api/reference/rest/v1/cards 28/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
The crop style applied to the image. In some cases, applying a CIRCLE crop
causes the image to be drawn larger than a built-in icon.
Union field icons. The icon displayed in the widget on the card. icons can be only one of the following:
knownIcon string
For example, to display an airplane icon, specify AIRPLANE. For a bus, specify
BUS.
iconUrl string
For example:
"iconUrl":
"https://developers.google.com/chat/images/quickstart-app-av
Button
A text, icon, or text and icon button that users can click.
https://developers.google.com/chat/api/reference/rest/v1/cards 29/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"text": string,
"icon": {
object (Icon (/chat/api/reference/rest/v1/cards#Icon_1))
},
"color": {
object (Color (/chat/api/reference/rest/v1/cards#Color))
},
"onClick": {
object (OnClick (/chat/api/reference/rest/v1/cards#OnClick_1))
},
"disabled": boolean,
"altText": string
}
Fields
text string
The icon image. If both icon and text are set, then the icon appears before the
text.
If set, the button is filled with a solid background color and the font color
changes to maintain contrast with the background color. For example, setting a
blue background likely results in white text.
If unset, the image background is white and the font color is blue.
For red, green, and blue, the value of each field is a float number that you can
express in either of two ways: as a number between 0 and 255 divided by 255
(153/255), or as a value between 0 and 1 (0.6). 0 represents the absence of a
color and 1 or 255/255 represent the full presence of that color on the RGB scale.
https://developers.google.com/chat/api/reference/rest/v1/cards 30/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Optionally set alpha, which sets a level of transparency using this equation:
"color": {
"red": 1,
"green": 0,
"blue": 0,
"alpha": 0.5
}
Required. The action to perform when a user clicks the button, such as opening a
hyperlink or running a custom function.
disabled boolean
If true, the button is displayed in an inactive state and doesn't respond to user
actions.
altText string
Set descriptive text that lets users know what the button does. For example, if a
button opens a hyperlink, you might write: "Opens a new browser tab and
navigates to the Google Chat developer documentation at
https://developers.google.com/chat" (https://developers.google.com/chat).
Color
https://developers.google.com/chat/api/reference/rest/v1/cards 31/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Represents a color in the RGBA color space. This representation is designed for simplicity of
conversion to and from color representations in various languages over compactness. For
example, the fields of this representation can be trivially provided to the constructor of
java.awt.Color in Java; it can also be trivially provided to UIColor's
+colorWithRed:green:blue:alpha method in iOS; and, with just a little work, it can be easily
formatted into a CSS rgba() string in JavaScript.
This reference page doesn't have information about the absolute color space that should be
used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By
default, applications should assume the sRGB color space.
Example (Java):
import com.google.type.Color;
// ...
public static java.awt.Color fromProto(Color protocolor) {
float alpha = protocolor.hasAlpha()
? protocolor.getAlpha().getValue()
: 1.0;
https://developers.google.com/chat/api/reference/rest/v1/cards 32/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
.setGreen(green / denominator)
.setBlue(blue / denominator);
int alpha = color.getAlpha();
if (alpha != 255) {
result.setAlpha(
FloatValue
.newBuilder()
.setValue(((float) alpha) / denominator)
.build());
}
return resultBuilder.build();
}
// ...
// ...
static UIColor* fromProto(Color* protocolor) {
float red = [protocolor red];
float green = [protocolor green];
float blue = [protocolor blue];
FloatValue* alpha_wrapper = [protocolor alpha];
float alpha = 1.0;
if (alpha_wrapper != nil) {
alpha = [alpha_wrapper value];
}
return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}
https://developers.google.com/chat/api/reference/rest/v1/cards 33/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
}
// ...
Example (JavaScript):
// ...
if (!('alpha' in rgb_color)) {
return rgbToCssColor(red, green, blue);
}
// ...
https://developers.google.com/chat/api/reference/rest/v1/cards 34/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"red": number,
"green": number,
"blue": number,
"alpha": number
}
Fields
red number
The amount of red in the color as a value in the interval [0, 1].
green number
The amount of green in the color as a value in the interval [0, 1].
blue number
The amount of blue in the color as a value in the interval [0, 1].
alpha number
The fraction of this color that should be applied to the pixel. That is, the final pixel
color is defined by the equation:
This means that a value of 1.0 corresponds to a solid color, whereas a value of
0.0 corresponds to a completely transparent color. This uses a wrapper message
rather than a simple float scalar so that it is possible to distinguish between a
default value and the value being unset. If omitted, this color object is rendered
as a solid color (as if the alpha value had been explicitly given a value of 1.0).
SwitchControl
Either a toggle-style switch or a checkbox inside a decoratedText widget.
https://developers.google.com/chat/api/reference/rest/v1/cards 35/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"name": string,
"value": string,
"selected": boolean,
"onChangeAction": {
object (Action (/chat/api/reference/rest/v1/cards#Action))
},
"controlType": enum (ControlType (/chat/api/reference/rest/v1/cards#ControlType))
}
Fields
name string
The name by which the switch widget is identified in a form input event.
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
value string
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
selected boolean
The action to perform when the switch state is changed, such as what function
to run.
https://developers.google.com/chat/api/reference/rest/v1/cards 36/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
ControlType
How the switch appears in the user interface.
Enums
CHECK_BOX A checkbox.
ButtonList
A list of buttons layed out horizontally.
JSON representation
{
"buttons": [
{
object (Button (/chat/api/reference/rest/v1/cards#Button_1))
}
]
}
Fields
An array of buttons.
TextInput
A field in which users can enter text. Supports suggestions and on-change actions.
https://developers.google.com/chat/api/reference/rest/v1/cards 37/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Chat apps receive and can process the value of entered text during form input events. For
details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs).
When you need to collect undefined or abstract data from users, use a text input. To collect
defined or enumerated data from users, use the SelectionInput
(/chat/api/reference/rest/v1/cards#SelectionInput) widget.
JSON representation
{
"name": string,
"label": string,
"hintText": string,
"value": string,
"type": enum (Type (/chat/api/reference/rest/v1/cards#Type)),
"onChangeAction": {
object (Action (/chat/api/reference/rest/v1/cards#Action))
},
"initialSuggestions": {
object (Suggestions (/chat/api/reference/rest/v1/cards#Suggestions))
},
"autoCompleteAction": {
object (Action (/chat/api/reference/rest/v1/cards#Action))
}
}
Fields
name string
The name by which the text input is identified in a form input event.
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
label string
The text that appears above the text input field in the user interface.
Specify text that helps the user enter the information your app needs. For
example, if you are asking someone's name, but specifically need their surname,
https://developers.google.com/chat/api/reference/rest/v1/cards 38/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
hintText string
Text that appears below the text input field meant to assist users by prompting
them to enter a certain value. This text is always visible.
value string
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
How a text input field appears in the user interface. For example, whether the
field is single or multi-line.
What to do when a change occurs in the text input field. For example, a user
adding to the field or deleting text.
Suggested values that users can enter. These values appear when users click
inside the text input field. As users type, the suggested values dynamically filter
to match what the users have typed.
For example, a text input field for programming language might suggest Java,
JavaScript, Python, and C++. When users start typing Jav, the list of suggestions
filters to show just Java and JavaScript.
Suggested values help guide users to enter values that your app can make sense
of. When referring to JavaScript, some users might enter javascript and
https://developers.google.com/chat/api/reference/rest/v1/cards 39/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Optional. Specify what action to take when the text input field provides
suggestions to users who interact with it.
If specified, the app takes the action specified here, such as running a custom
function.
Type
How a text input field appears in the user interface. For example, whether it's a single line input
field, or a multi-line input.
Enums
SINGLE_LINE The text input field has a fixed height of one line.
MULTIPLE_LINE The text input field has a fixed height of multiple lines.
Suggestions
Suggested values that users can enter. These values appear when users click inside the text
input field. As users type, the suggested values dynamically filter to match what the users have
https://developers.google.com/chat/api/reference/rest/v1/cards 40/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
typed.
For example, a text input field for programming language might suggest Java, JavaScript,
Python, and C++. When users start typing Jav, the list of suggestions filters to show Java and
JavaScript.
Suggested values help guide users to enter values that your app can make sense of. When
referring to JavaScript, some users might enter javascript and others java script.
Suggesting JavaScript can standardize how users interact with your app.
JSON representation
{
"items": [
{
object (SuggestionItem (/chat/api/reference/rest/v1/cards#SuggestionItem))
}
]
}
Fields
SuggestionItem
One suggested value that users can enter in a text input field.
JSON representation
https://developers.google.com/chat/api/reference/rest/v1/cards 41/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
Fields
text string
The value of a suggested input to a text input field. This is equivalent to what
users enter themselves.
SelectionInput
A widget that creates one or more UI items that users can select. For example, a dropdown
menu or checkboxes. You can use this widget to collect data that can be predicted or
enumerated.
Chat apps can process the value of items that users select or input. For details about working
with form inputs, see Receive form data
(https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs).
JSON representation
{
"name": string,
"label": string,
"type": enum (SelectionType (/chat/api/reference/rest/v1/cards#SelectionType)),
"items": [
{
object (SelectionItem (/chat/api/reference/rest/v1/cards#SelectionItem))
}
],
https://developers.google.com/chat/api/reference/rest/v1/cards 42/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
"onChangeAction": {
object (Action (/chat/api/reference/rest/v1/cards#Action))
}
}
Fields
name string
The name that identifies the selection input in a form input event.
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
label string
The text that appears above the selection input field in the user interface.
Specify text that helps the user enter the information your app needs. For
example, if users are selecting the urgency of a work ticket from a drop-down
menu, the label might be "Urgency" or "Select urgency".
If specified, the form is submitted when the selection changes. If not specified,
you must specify a separate button that submits the form.
https://developers.google.com/chat/api/reference/rest/v1/cards 43/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
SelectionType
The format for the items that users can select. Different options support different types of
interactions. For example, users can select multiple checkboxes, but can only select one item
from a dropdown menu.
Each selection input supports one type of selection. Mixing checkboxes and switches, for
example, isn't supported.
Enums
RADIO_BUTTON A set of radio buttons. Users can select one radio button.
DROPDOWN A dropdown menu. Users can select one item from the menu.
SelectionItem
An item that users can select in a selection input, such as a checkbox or switch.
JSON representation
{
"text": string,
"value": string,
"selected": boolean
}
https://developers.google.com/chat/api/reference/rest/v1/cards 44/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
text string
value string
The value associated with this item. The client should use this as a form input
value.
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
selected boolean
Whether the item is selected by default. If the selection input only accepts one
value (such as for radio buttons or a dropdown menu), only set this field for one
item.
DateTimePicker
Lets users input a date, a time, or both a date and a time.
Users can input text or use the picker to select dates and times. If users input an invalid date or
time, the picker shows an error that prompts users to input the information correctly.
JSON representation
{
"name": string,
"label": string,
"type": enum (DateTimePickerType (/chat/api/reference/rest/v1/cards#DateTimePickerType)),
"valueMsEpoch": string,
"timezoneOffsetDate": integer,
"onChangeAction": {
object (Action (/chat/api/reference/rest/v1/cards#Action))
}
}
https://developers.google.com/chat/api/reference/rest/v1/cards 45/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
name string
For details about working with form inputs, see Receive form data
(https://developers.google.com/chat/how-
tos/dialogs#receive_form_data_from_dialogs)
.
label string
The text that prompts users to input a date, a time, or a date and time. For
example, if users are scheduling an appointment, use a label such as
Appointment date or Appointment date and time.
Whether the widget supports inputting a date, a time, or the date and time.
The default value displayed in the widget, in milliseconds since Unix epoch time
(https://en.wikipedia.org/wiki/Unix_time).
timezoneOffsetDate integer
The number representing the time zone offset from UTC, in minutes. If set, the
valueMsEpoch is displayed in the specified time zone. If unset, the value
defaults to the user's time zone setting.
https://developers.google.com/chat/api/reference/rest/v1/cards 46/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
Triggered when the user clicks Save or Clear from the DateTimePicker
interface.
DateTimePickerType
The format for the date and time in the DateTimePicker widget. Determines whether users
can input a date, a time, or both a date and time.
Enums
Divider
Displays a divider between widgets as a horizontal line.
"divider": {}
Grid
Displays a grid with a collection of items. Items can only include text or images.
A grid supports any number of columns and items. The number of rows is determined by items
divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2
columns has 6 rows.
https://developers.google.com/chat/api/reference/rest/v1/cards 47/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
For responsive columns, or to include more than text or images, use Columns
(/chat/api/reference/rest/v1/cards#Columns).
For example, the following JSON creates a 2 column grid with a single item:
"grid": {
"title": "A fine collection of items",
"columnCount": 2,
"borderStyle": {
"type": "STROKE",
"cornerRadius": 4
},
"items": [
{
"image": {
"imageUri": "https://www.example.com/image.png",
"cropStyle": {
"type": "SQUARE"
},
"borderStyle": {
"type": "STROKE"
}
},
"title": "An item",
"textAlignment": "CENTER"
}
],
"onClick": {
"openLink": {
"url": "https://www.example.com"
}
}
}
JSON representation
{
"title": string,
"items": [
{
object (GridItem (/chat/api/reference/rest/v1/cards#GridItem))
}
https://developers.google.com/chat/api/reference/rest/v1/cards 48/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
],
"borderStyle": {
object (BorderStyle (/chat/api/reference/rest/v1/cards#BorderStyle))
},
"columnCount": integer,
"onClick": {
object (OnClick (/chat/api/reference/rest/v1/cards#OnClick_1))
}
}
Fields
title string
columnCount integer
The number of columns to display in the grid. A default value is used if this field
isn't specified, and that default value is different depending on where the grid is
shown (dialog versus companion).
This callback is reused by each individual grid item, but with the item's identifier
and index in the items list added to the callback's parameters.
GridItem
Represents an item in a grid layout. Items can contain text, an image, or both text and an
image.
https://developers.google.com/chat/api/reference/rest/v1/cards 49/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"id": string,
"image": {
object (ImageComponent (/chat/api/reference/rest/v1/cards#ImageComponent))
},
"title": string,
"subtitle": string,
"layout": enum (GridItemLayout (/chat/api/reference/rest/v1/cards#GridItemLayout))
}
Fields
id string
A user-specified identifier for this grid item. This identifier is returned in the
parent grid's onClick callback parameters.
title string
subtitle string
ImageComponent
Represents an image.
https://developers.google.com/chat/api/reference/rest/v1/cards 50/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"imageUri": string,
"altText": string,
"cropStyle": {
object (ImageCropStyle (/chat/api/reference/rest/v1/cards#ImageCropStyle))
},
"borderStyle": {
object (BorderStyle (/chat/api/reference/rest/v1/cards#BorderStyle))
}
}
Fields
imageUri string
altText string
ImageCropStyle
Represents the crop style applied to an image.
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
https://developers.google.com/chat/api/reference/rest/v1/cards 51/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
{
"type": enum (ImageCropType (/chat/api/reference/rest/v1/cards#ImageCropType)),
"aspectRatio": number
}
Fields
aspectRatio number
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
}
ImageCropType
Represents the crop style applied to an image.
Enums
https://developers.google.com/chat/api/reference/rest/v1/cards 52/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Enums
RECTANGLE_CUSTOM Applies a rectangular crop with a custom aspect ratio. Set the custom aspect
ratio with aspectRatio.
BorderStyle
The style options for the border of a card or widget, including the border type and color.
JSON representation
{
"type": enum (BorderType (/chat/api/reference/rest/v1/cards#BorderType)),
"strokeColor": {
object (Color (/chat/api/reference/rest/v1/cards#Color))
},
"cornerRadius": integer
}
Fields
cornerRadius integer
BorderType
Represents the border types applied to widgets.
https://developers.google.com/chat/api/reference/rest/v1/cards 53/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Enums
STROKE Outline.
GridItemLayout
Represents the various layout options available for a grid item.
Enums
TEXT_BELOW The title and subtitle are shown below the grid item's image.
TEXT_ABOVE The title and subtitle are shown above the grid item's image.
Columns
The Columns widget displays up to 2 columns in a card message or dialog. You can add
widgets to each column; the widgets appear in the order that they are specified.
The height of each column is determined by the taller column. For example, if the first column
is taller than the second column, both columns have the height of the first column. Because
each column can contain a different number of widgets, you can't define rows or align widgets
between the columns.
Columns are displayed side-by-side. You can customize the width of each column using the
HorizontalSizeStyle field. If the user's screen width is too narrow, the second column wraps
below the first:
On web, the second column wraps if the screen width is less than or equal to 480 pixels.
https://developers.google.com/chat/api/reference/rest/v1/cards 54/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
On iOS devices, the second column wraps if the screen width is less than or equal to 300
pt.
On Android devices, the second column wraps if the screen width is less than or equal to
320 dp.
JSON representation
{
"columnItems": [
{
object (Column (/chat/api/reference/rest/v1/cards#Column))
}
]
}
Fields
Column
A column.
JSON representation
{
"horizontalSizeStyle": enum (HorizontalSizeStyle (/chat/api/reference/rest/v1/cards#Hor
"horizontalAlignment": enum (HorizontalAlignment (/chat/api/reference/rest/v1/cards#Hor
"verticalAlignment": enum (VerticalAlignment (/chat/api/reference/rest/v1/cards#VerticalA
"widgets": [
{
object (Widgets (/chat/api/reference/rest/v1/cards#Widgets))
}
https://developers.google.com/chat/api/reference/rest/v1/cards 55/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
]
}
Fields
An array of widgets included in a column. Widgets appear in the order that they
are specified.
HorizontalSizeStyle
Specifies how a column fills the width of the card. The width of each column depends on both
the HorizontalSizeStyle and the width of the widgets within the column.
Enums
FILL_AVAILABLE_ Default value. Column fills the available space, up to 70% of the card's width. If
SPACE both columns are set to FILL_AVAILABLE_SPACE, each column fills 50% of the
space.
https://developers.google.com/chat/api/reference/rest/v1/cards 56/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Enums
FILL_MINIMUM_SPACE Column fills the least amount of space possible and no more than 30% of the
card's width.
HorizontalAlignment
Specifies whether widgets align to the left, right, or center of a column.
Enums
START Default value. Aligns widgets to the start position of the column. For left-to-right
layouts, aligns to the left. For right-to-left layouts, aligns to the right.
END Aligns widgets to the end position of the column. For left-to-right layouts, aligns
widgets to the right. For right-to-left layouts, aligns widgets to the left.
VerticalAlignment
Specifies whether widgets align to the top, bottom, or center of a column.
Enums
https://developers.google.com/chat/api/reference/rest/v1/cards 57/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Widgets
The supported widgets that you can include in a column.
JSON representation
Fields
https://developers.google.com/chat/api/reference/rest/v1/cards 58/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
TextParagraph (/chat/api/reference/rest/v1/cards#TextParagraph_1) widget.
Image (/chat/api/reference/rest/v1/cards#Image_1) widget.
DecoratedText (/chat/api/reference/rest/v1/cards#DecoratedText) widget.
ButtonList (/chat/api/reference/rest/v1/cards#ButtonList) widget.
TextInput (/chat/api/reference/rest/v1/cards#TextInput) widget.
SelectionInput (/chat/api/reference/rest/v1/cards#SelectionInput) widget.
DateTimePicker (/chat/api/reference/rest/v1/cards#DateTimePicker) widget.
CardAction
A card action is the action associated with the card. For example, an invoice card might
include actions such as delete invoice, email invoice, or open the invoice in a browser.
JSON representation
{
"actionLabel": string,
"onClick": {
object (OnClick (/chat/api/reference/rest/v1/cards#OnClick_1))
https://developers.google.com/chat/api/reference/rest/v1/cards 59/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
JSON representation
}
}
Fields
actionLabel string
CardFixedFooter
A persistent (sticky) footer that that appears at the bottom of the card.
Supported by Google Workspace Add-ons and Chat apps. For Chat apps, you can use fixed
footers in dialogs (https://developers.google.com/chat/how-tos/dialogs), but not card messages
(https://developers.google.com/chat/api/guides/message-formats/cards).
JSON representation
{
"primaryButton": {
object (Button (/chat/api/reference/rest/v1/cards#Button_1))
},
"secondaryButton": {
object (Button (/chat/api/reference/rest/v1/cards#Button_1))
}
}
Fields
https://developers.google.com/chat/api/reference/rest/v1/cards 60/61
7/4/23, 5:03 PM Cards v2 | Google Chat | Google for Developers
Fields
The primary button of the fixed footer. The button must be a text button with text
and color set.
The secondary button of the fixed footer. The button must be a text button with
text and color set. If secondaryButton is set, you must also set
primaryButton.
DisplayStyle
In Google Workspace Add-ons, determines how a card is displayed.
Enums
PEEK The header of the card appears at the bottom of the sidebar, partially covering
the current top card of the stack. Clicking the header pops the card into the card
stack. If the card has no header, a generated header is used instead.
REPLACE Default value. The card is shown by replacing the view of the top card in the card
stack.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
(https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License
(https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies
(https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.
https://developers.google.com/chat/api/reference/rest/v1/cards 61/61