Show / Hide Table of Contents

Class GoogleAppsCardV1Card

A card interface displayed in a Google Chat message or Google Workspace add-on. 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. Card builder To learn how to build cards, see the following documentation: * For Google Chat apps, see Design the components of a card or dialog. * For Google Workspace add-ons, see Card-based interfaces. Note: You can add up to 100 widgets per card. Any widgets beyond this limit are ignored. This limit applies to both card messages and dialogs in Google Chat apps, and to cards in Google Workspace add-ons. Example: Card message for a Google Chat app Example contact
card To create the sample card message in Google Chat, use the following JSON:

{ "cardsV2": [ { "cardId": "unique-card-id", "card": {
"header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl":
"https://developers.google.com/workspace/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":
"sasha@example.com" } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON" }, "text": "Online" } }, {
"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" }
] } } } ] } } ] } ] } } ] }
Inheritance
object
GoogleAppsCardV1Card
Implements
IDirectResponseSchema
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.HangoutsChat.v1.Data
Assembly: Google.Apis.HangoutsChat.v1.dll
Syntax
public class GoogleAppsCardV1Card : IDirectResponseSchema

Properties

CardActions

The card's actions. Actions are added to the card's toolbar menu. Google Workspace add-ons: For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

"card_actions": [ { "actionLabel": "Settings",
"onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING"
} ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": {
"openLink": { "url": "https://example.com/feedback" } } } ]
Declaration
[JsonProperty("cardActions")]
public virtual IList<GoogleAppsCardV1CardAction> CardActions { get; set; }
Property Value
Type Description
IList<GoogleAppsCardV1CardAction>

DisplayStyle

In Google Workspace add-ons, sets the display properties of the peekCardHeader. Google Workspace add-ons:

Declaration
[JsonProperty("displayStyle")]
public virtual string DisplayStyle { get; set; }
Property Value
Type Description
string

ETag

The ETag of the item.

Declaration
public virtual string ETag { get; set; }
Property Value
Type Description
string

FixedFooter

The fixed footer shown at the bottom of this card. Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages. Google Workspace add-ons and Chat apps:

Declaration
[JsonProperty("fixedFooter")]
public virtual GoogleAppsCardV1CardFixedFooter FixedFooter { get; set; }
Property Value
Type Description
GoogleAppsCardV1CardFixedFooter

Header

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

Declaration
[JsonProperty("header")]
public virtual GoogleAppsCardV1CardHeader Header { get; set; }
Property Value
Type Description
GoogleAppsCardV1CardHeader

Name

Name of the card. Used as a card identifier in card navigation. Google Workspace add-ons:

Declaration
[JsonProperty("name")]
public virtual string Name { get; set; }
Property Value
Type Description
string

PeekCardHeader

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. Google Workspace add-ons:

Declaration
[JsonProperty("peekCardHeader")]
public virtual GoogleAppsCardV1CardHeader PeekCardHeader { get; set; }
Property Value
Type Description
GoogleAppsCardV1CardHeader

SectionDividerStyle

The divider style between the header, sections and footer.

Declaration
[JsonProperty("sectionDividerStyle")]
public virtual string SectionDividerStyle { get; set; }
Property Value
Type Description
string

Sections

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Define a section of a card.

Declaration
[JsonProperty("sections")]
public virtual IList<GoogleAppsCardV1Section> Sections { get; set; }
Property Value
Type Description
IList<GoogleAppsCardV1Section>

Implements

IDirectResponseSchema
In this article
Back to top Generated by DocFX