Event

Stay organized with collections Save and categorize content based on your preferences.

Google Chat events.

JSON representation
{
  "type": enum (EventType),
  "eventTime": string,
  "token": string,
  "threadKey": string,
  "message": {
    object (Message)
  },
  "user": {
    object (User)
  },
  "space": {
    object (Space)
  },
  "action": {
    object (FormAction)
  },
  "configCompleteRedirectUrl": string,
  "isDialogEvent": boolean,
  "dialogEventType": enum (DialogEventType),
  "common": {
    object (CommonEventObject)
  }
}
Fields
type

enum (EventType)

The type of the event.

eventTime

string (Timestamp format)

The timestamp indicating when the event occurred.

token

string

A secret value that legacy Chat apps can use to verify if a request is from Google. Google randomly generates the token, and its value remains static. You can obtain, revoke, or regenerate the token from the Chat API configuration page in the Google Cloud Console.

Modern Chat apps don't use this field. It is absent from API responses and the Chat API configuration page.

threadKey

string

The Chat app-defined key for the thread related to the event. See the threadKey field of the spaces.message.create request for more information.

message

object (Message)

The message that triggered the event, if applicable.

user

object (User)

The user that triggered the event.

space

object (Space)

The space in which the event occurred.

action

object (FormAction)

The form action data associated with an interactive card that was clicked. Only populated for CARD_CLICKED events. See the Interactive Cards guide for more information.

configCompleteRedirectUrl

string

The URL the Chat app should redirect the user to after they have completed an authorization or configuration flow outside of Google Chat. See the Authorizing access to 3p services guide for more information.

isDialogEvent

boolean

True when the event is related to dialogs.

dialogEventType

enum (DialogEventType)

The type of dialog event received.

common

object (CommonEventObject)

Represents information about the user's client, such as locale, host app, and platform. For Chat apps, CommonEventObject includes information submitted by users interacting with dialogs, like data entered on a card.

CommonEventObject

Represents information about the user's client, such as locale, host app, and platform. For Chat apps, CommonEventObject includes data submitted by users interacting with cards, like data entered in dialogs.

JSON representation
{
  "userLocale": string,
  "hostApp": enum (HostApp),
  "platform": enum (Platform),
  "timeZone": {
    object (TimeZone)
  },
  "formInputs": {
    string: {
      object (Inputs)
    },
    ...
  },
  "parameters": {
    string: string,
    ...
  },
  "invokedFunction": string
}
Fields
userLocale

string

The full locale.displayName in the format of [ISO 639 language code]-[ISO 3166 country/region code] such as "en-US". Not supported by Chat apps.

hostApp

enum (HostApp)

The hostApp enum which indicates the app the add-on is invoked from. Always CHAT for Chat apps.

platform

enum (Platform)

The platform enum which indicates the platform where the event originates (WEB, IOS, or ANDROID). Not supported by Chat apps.

timeZone

object (TimeZone)

The timezone ID and offset from Coordinated Universal Time (UTC).

formInputs

map (key: string, value: object (Inputs))

A map containing the current values of the widgets in a card. The map keys are the string IDs assigned to each widget, and the values represent inputs to the widget. Depending on the input data type, a different object represents each input: For single-value widgets, StringInput. For multi-value widgets, an array of StringInput objects. For a date-time picker, a DateTimeInput. For a date-only picker, a DateInput. For a time-only picker, a TimeInput. Corresponds with the data entered by a user on a card in a dialog.

parameters

map (key: string, value: string)

Custom parameters passed to the invoked function. Both keys and values must be strings.

invokedFunction

string

Name of the invoked function associated with the widget. Only set for Chat apps.

TimeZone

The timezone ID and offset from Coordinated Universal Time (UTC). Not supported by Chat apps.

JSON representation
{
  "id": string,
  "offset": integer
}
Fields
id

string

The IANA TZ time zone database code, such as "America/Toronto".

offset

integer

The user timezone offset, in milliseconds, from Coordinated Universal Time (UTC).

Inputs

Types of data inputs for widgets. Users enter data with these inputs.

JSON representation
{

  // Union field inputs can be only one of the following:
  "stringInputs": {
    object (StringInputs)
  },
  "dateTimeInput": {
    object (DateTimeInput)
  },
  "dateInput": {
    object (DateInput)
  },
  "timeInput": {
    object (TimeInput)
  }
  // End of list of possible types for union field inputs.
}
Fields

Union field inputs.

inputs can be only one of the following:

stringInputs

object (StringInputs)

Input parameter for regular widgets. For single-valued widgets, it is a single value list. For multi-valued widgets, such as checkbox, all the values are presented.

dateTimeInput

object (DateTimeInput)

Date and time input values. Not supported by Chat apps.

dateInput

object (DateInput)

Date input values. Not supported by Chat apps.

timeInput

object (TimeInput)

Time input values. Not supported by Chat apps.

StringInputs

Input parameter for regular widgets. For single-valued widgets, it is a single value list. For multi-valued widgets, such as checkbox, all the values are presented.

JSON representation
{
  "value": [
    string
  ]
}
Fields
value[]

string

An array of strings entered by the user.

DateTimeInput

Date and time input values. Not supported by Chat apps.

JSON representation
{
  "msSinceEpoch": string,
  "hasDate": boolean,
  "hasTime": boolean
}
Fields
msSinceEpoch

string (int64 format)

Time since epoch time, in milliseconds.

hasDate

boolean

Whether the datetime input includes a calendar date.

hasTime

boolean

Whether the datetime input includes a timestamp.

DateInput

Date input values. Not supported by Chat apps.

JSON representation
{
  "msSinceEpoch": string
}
Fields
msSinceEpoch

string (int64 format)

Time since epoch time, in milliseconds.

TimeInput

Time input values. Not supported by Chat apps.

JSON representation
{
  "hours": integer,
  "minutes": integer
}
Fields
hours

integer

The hour on a 24-hour clock.

minutes

integer

The number of minutes past the hour. Valid values are 0 to 59.