Package google.chat.v1

Индекс

ЧатСервис

Позволяет разработчикам создавать чат-приложения и интегрировать их на платформе Google Chat.

CompleteImportSpace

rpc CompleteImportSpace( CompleteImportSpaceRequest ) returns ( CompleteImportSpaceResponse )

Завершает процесс импорта указанного пространства и делает его видимым для пользователей.

Требуется аутентификация пользователя и делегирование полномочий на уровне всего домена с областью авторизации :

  • https://www.googleapis.com/auth/chat.import

Дополнительную информацию см. в статье Разрешение приложениям Google Chat импортировать данные .

Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.import

Более подробную информацию смотрите в Руководстве по авторизации .

CreateCustomEmoji

rpc CreateCustomEmoji( CreateCustomEmojiRequest ) returns ( CustomEmoji )

Создает пользовательский эмодзи.

Пользовательские эмодзи доступны только для учётных записей Google Workspace, и администратор должен включить их для организации. Подробнее см. в статьях «Подробнее о пользовательских эмодзи в Google Chat» и «Управление разрешениями на использование пользовательских эмодзи» .

Требуется аутентификация пользователя с областью авторизации :

  • https://www.googleapis.com/auth/chat.customemojis
Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.customemojis

Более подробную информацию смотрите в Руководстве по авторизации .

Создать членство

rpc CreateMembership( CreateMembershipRequest ) returns ( Membership )

Создаёт членство для вызывающего приложения Chat, пользователя или группы Google. Создание членств для других приложений Chat не поддерживается. При создании членства, если у указанного участника отключена политика автоматического принятия, он получает приглашение и должен принять его перед присоединением. В противном случае создание членства добавляет участника непосредственно в указанное пространство.

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одобрением администратора и областью авторизации:

    • https://www.googleapis.com/auth/chat.app.memberships
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.memberships.app (чтобы добавить приложение для совершения звонков в пространство)
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
    • Аутентификация пользователя предоставляет права администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется следующая область авторизации:
      • https://www.googleapis.com/auth/chat.admin.memberships

Аутентификация приложения не поддерживается в следующих случаях использования:

  • Приглашение пользователей за пределами организации Workspace, которой принадлежит это пространство.
  • Добавление Google Группы в пространство.
  • Добавление приложения чата в пространство.

Пример использования см.:

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.app

Более подробную информацию смотрите в Руководстве по авторизации .

Создать сообщение

rpc CreateMessage( CreateMessageRequest ) returns ( Message )

Создаёт сообщение в чате Google. Пример см. в разделе «Отправить сообщение» .

Поддерживает следующие типы аутентификации :

Чат по-разному атрибутирует отправителя сообщения в зависимости от типа аутентификации, который вы используете в своем запросе.

На следующем изображении показано, как Chat атрибутирует сообщение при использовании аутентификации приложения. Chat отображает приложение Chat в качестве отправителя сообщения. Содержимое сообщения может содержать текст ( text ), карточки ( cardsV2 ) и дополнительные виджеты ( accessoryWidgets ).

Сообщение отправлено с аутентификацией приложения

На следующем изображении показано, как Chat атрибутирует сообщение при использовании аутентификации пользователя. Chat отображает пользователя как отправителя сообщения и атрибутирует приложение Chat, отображая его имя. Содержимое сообщения может содержать только текст ( text ).

Сообщение отправлено с аутентификацией пользователя

Максимальный размер сообщения, включая содержимое сообщения, составляет 32 000 байт.

В ответе на запросы вебхуков не содержится полное сообщение. В дополнение к информации, содержащейся в запросе, в ответе заполняются только поля name и thread.name .

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.create

Более подробную информацию смотрите в Руководстве по авторизации .

CreateReaction

rpc CreateReaction( CreateReactionRequest ) returns ( Reaction )

Создаёт реакцию и добавляет её к сообщению. Пример см. в разделе Добавление реакции к сообщению .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.messages.reactions.create
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.create

Более подробную информацию смотрите в Руководстве по авторизации .

CreateSpace

rpc CreateSpace( CreateSpaceRequest ) returns ( Space )

Создаёт пространство. Может использоваться для создания именованного пространства или группового чата в Import mode . Пример см. в разделе Создание пространства .

Поддерживает следующие типы аутентификации :

При аутентификации в качестве приложения в запросе необходимо указать поле space.customer .

При аутентификации в качестве приложения приложение Chat добавляется в качестве участника пространства. Однако, в отличие от аутентификации пользователя, приложение Chat не добавляется в качестве менеджера пространства. По умолчанию все участники пространства могут удалить приложение Chat из пространства. Чтобы разрешить удалять приложение из пространства только менеджерам пространства, установите для space.permission_settings.manage_apps значение managers_allowed .

Членство в пространстве при его создании зависит от того, создано ли пространство в Import mode :

  • Режим импорта: участники не создаются.
  • Все остальные режимы: вызывающий пользователь добавляется в качестве участника. Это:
    • Само приложение при использовании аутентификации приложения.
    • Пользователь-человек при использовании аутентификации пользователя.

Если при создании пространства появляется сообщение об ошибке ALREADY_EXISTS , попробуйте использовать другое displayName . Возможно, существующее пространство в организации Google Workspace уже использует это отображаемое имя.

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.spaces.create
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.create

Более подробную информацию смотрите в Руководстве по авторизации .

DeleteCustomEmoji

rpc DeleteCustomEmoji( DeleteCustomEmojiRequest ) returns ( Empty )

Удаляет пользовательский эмодзи. По умолчанию пользователи могут удалять только созданные ими пользовательские эмодзи. Менеджеры эмодзи, назначенные администратором, могут удалять любые пользовательские эмодзи в организации. Подробнее о пользовательских эмодзи в Google Chat .

Пользовательские эмодзи доступны только для учётных записей Google Workspace, и администратор должен включить их для организации. Подробнее см. в статьях «Подробнее о пользовательских эмодзи в Google Chat» и «Управление разрешениями на использование пользовательских эмодзи» .

Требуется аутентификация пользователя с областью авторизации :

  • https://www.googleapis.com/auth/chat.customemojis
Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.customemojis

Более подробную информацию смотрите в Руководстве по авторизации .

Удалить членство

rpc DeleteMembership( DeleteMembershipRequest ) returns ( Membership )

Удаляет членство. Пример см. в разделе Удаление пользователя или приложения Google Chat из чат-группы .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одобрением администратора и областью авторизации:

    • https://www.googleapis.com/auth/chat.app.memberships
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.memberships.app (чтобы удалить вызывающее приложение из пространства)
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
    • Аутентификация пользователя предоставляет права администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется следующая область авторизации:
      • https://www.googleapis.com/auth/chat.admin.memberships

Аутентификация приложения не поддерживается в следующих случаях использования:

  • Удаление Google группы из пространства.
  • Удаление приложения чата из пространства.

Чтобы удалить членство менеджеров пространства, отправитель запроса должен быть менеджером пространства. Если вы используете аутентификацию через приложение, приложение Chat должно быть создателем пространства.

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.app

Более подробную информацию смотрите в Руководстве по авторизации .

Удалить сообщение

rpc DeleteMessage( DeleteMessageRequest ) returns ( Empty )

Удаляет сообщение. Пример см. в разделе Удаление сообщения .

Поддерживает следующие типы аутентификации :

При использовании аутентификации приложения запросы могут удалять только сообщения, созданные вызывающим приложением Chat.

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages

Более подробную информацию смотрите в Руководстве по авторизации .

УдалитьРеакцию

rpc DeleteReaction( DeleteReactionRequest ) returns ( Empty )

Удаляет реакцию на сообщение. Пример см. в разделе Удаление реакции .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.reactions

Более подробную информацию смотрите в Руководстве по авторизации .

DeleteSpace

rpc DeleteSpace( DeleteSpaceRequest ) returns ( Empty )

Удаляет именованное пространство. Всегда выполняет каскадное удаление, то есть дочерние ресурсы пространства, такие как опубликованные в нём сообщения и данные о членстве в нём, также удаляются. Пример см. в разделе Удаление пространства .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одобрением администратора и областью авторизации:

    • https://www.googleapis.com/auth/chat.app.delete (только в пространствах, созданных приложением)
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.delete
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
    • Аутентификация пользователя предоставляет права администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется следующая область авторизации:
      • https://www.googleapis.com/auth/chat.admin.delete
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.delete
  • https://www.googleapis.com/auth/chat.admin.delete
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.delete

Более подробную информацию смотрите в Руководстве по авторизации .

FindDirectMessage

rpc FindDirectMessage( FindDirectMessageRequest ) returns ( Space )

Возвращает существующую прямую переписку с указанным пользователем. Если место для прямой переписки не найдено, возвращается ошибка 404 NOT_FOUND . Пример см. в разделе Поиск прямой переписки .

При аутентификации приложения возвращает пространство для прямого сообщения между указанным пользователем и вызывающим приложением Chat.

При аутентификации пользователя возвращает пространство для прямых сообщений между указанным пользователем и аутентифицированным пользователем.

Поддерживает следующие типы аутентификации :

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot

Более подробную информацию смотрите в Руководстве по авторизации .

GetAttachment

rpc GetAttachment( GetAttachmentRequest ) returns ( Attachment )

Получает метаданные вложения к сообщению. Данные вложения извлекаются с помощью API медиа . Пример см. в разделе Получение метаданных о вложении к сообщению .

Требуется аутентификация приложения с областью авторизации :

  • https://www.googleapis.com/auth/chat.bot
Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.bot

Более подробную информацию смотрите в Руководстве по авторизации .

GetCustomEmoji

rpc GetCustomEmoji( GetCustomEmojiRequest ) returns ( CustomEmoji )

Возвращает сведения о пользовательском эмодзи.

Пользовательские эмодзи доступны только для учётных записей Google Workspace, и администратор должен включить их для организации. Подробнее см. в статьях «Подробнее о пользовательских эмодзи в Google Chat» и «Управление разрешениями на использование пользовательских эмодзи» .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.customemojis.readonly
  • https://www.googleapis.com/auth/chat.customemojis
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.customemojis
  • https://www.googleapis.com/auth/chat.customemojis.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

Получить членство

rpc GetMembership( GetMembershipRequest ) returns ( Membership )

Возвращает информацию о членстве. Пример см. в разделе Получение информации о членстве пользователя или приложения Google Chat .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одной из следующих областей авторизации:

  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.memberships.readonly
    • https://www.googleapis.com/auth/chat.memberships
    • Аутентификация пользователя предоставляет привилегии администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется одна из следующих областей авторизации:
      • https://www.googleapis.com/auth/chat.admin.memberships.readonly
      • https://www.googleapis.com/auth/chat.admin.memberships
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

GetMessage

rpc GetMessage( GetMessageRequest ) returns ( Message )

Возвращает сведения о сообщении. Пример см. в разделе Получить сведения о сообщении .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.bot : при использовании этой области авторизации этот метод возвращает сведения о сообщении, к которому приложение Chat имеет доступ, например, прямые сообщения и команды с косой чертой , которые вызывают приложение Chat.
    • https://www.googleapis.com/auth/chat.app.messages.readonly с одобрения администратора (доступно в Developer Preview ). При использовании этой области аутентификации этот метод возвращает сведения о публичном сообщении в чат-группе.
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.messages.readonly
    • https://www.googleapis.com/auth/chat.messages

Примечание: может вернуться сообщение от заблокированного участника или пространства.

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.app.messages.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

GetSpace

rpc GetSpace( GetSpaceRequest ) returns ( Space )

Возвращает информацию о пространстве. Пример см. в разделе Получить информацию о пространстве .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одной из следующих областей авторизации:

  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.spaces.readonly
    • https://www.googleapis.com/auth/chat.spaces
    • Аутентификация пользователя предоставляет привилегии администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется одна из следующих областей авторизации:
      • https://www.googleapis.com/auth/chat.admin.spaces.readonly
      • https://www.googleapis.com/auth/chat.admin.spaces

Аутентификация приложения имеет следующие ограничения:

  • space.access_settings заполняется только при использовании области chat.app.spaces .
  • space.predefind_permission_settings и space.permission_settings заполняются только при использовании области chat.app.spaces и только для пространств, созданных приложением.
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces.readonly
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.app.spaces

Более подробную информацию смотрите в Руководстве по авторизации .

GetSpaceEvent

rpc GetSpaceEvent( GetSpaceEventRequest ) returns ( SpaceEvent )

Возвращает событие из чат-группы Google. Событие содержит последнюю версию ресурса, который изменился. Например, если вы запрашиваете событие о новом сообщении, но сообщение было позже обновлено, сервер возвращает обновлённый ресурс Message в событии.

Примечание: Поле permissionSettings не возвращается в объекте Space данных события Space для этого запроса.

Поддерживает следующие типы аутентификации с областью авторизации, подходящей для чтения запрашиваемых данных:

  • Аутентификация приложения с одобрением администратора в Developer Preview с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.app.spaces
    • https://www.googleapis.com/auth/chat.app.messages.readonly
    • https://www.googleapis.com/auth/chat.app.memberships
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.spaces.readonly
    • https://www.googleapis.com/auth/chat.spaces
    • https://www.googleapis.com/auth/chat.messages.readonly
    • https://www.googleapis.com/auth/chat.messages
    • https://www.googleapis.com/auth/chat.messages.reactions.readonly
    • https://www.googleapis.com/auth/chat.messages.reactions
    • https://www.googleapis.com/auth/chat.memberships.readonly
    • https://www.googleapis.com/auth/chat.memberships

Чтобы получить событие, аутентифицированный абонент должен быть участником пространства.

Например, см. раздел Получение сведений о событии из чат-пространства Google .

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.app.messages.readonly
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

GetSpaceNotificationSetting

rpc GetSpaceNotificationSetting( GetSpaceNotificationSettingRequest ) returns ( SpaceNotificationSetting )

Получает настройки уведомлений о наличии свободного пространства. Пример см. в разделе Получение настроек уведомлений о наличии свободного пространства у вызывающего абонента .

Требуется аутентификация пользователя с областью авторизации :

  • https://www.googleapis.com/auth/chat.users.spacesettings
Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.users.spacesettings

Более подробную информацию смотрите в Руководстве по авторизации .

GetSpaceReadState

rpc GetSpaceReadState( GetSpaceReadStateRequest ) returns ( SpaceReadState )

Возвращает сведения о состоянии чтения пользователя в спейсе, используемые для идентификации прочитанных и непрочитанных сообщений. Пример см. в разделе Получение сведений о состоянии чтения пользователя в спейсе .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.users.readstate.readonly
  • https://www.googleapis.com/auth/chat.users.readstate
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.users.readstate
  • https://www.googleapis.com/auth/chat.users.readstate.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

GetThreadReadState

rpc GetThreadReadState( GetThreadReadStateRequest ) returns ( ThreadReadState )

Возвращает сведения о состоянии чтения пользователя в потоке, используемые для идентификации прочитанных и непрочитанных сообщений. Пример см. в разделе Получение сведений о состоянии чтения потока пользователя .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.users.readstate.readonly
  • https://www.googleapis.com/auth/chat.users.readstate
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.users.readstate
  • https://www.googleapis.com/auth/chat.users.readstate.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

Список пользовательских эмодзи

rpc ListCustomEmojis( ListCustomEmojisRequest ) returns ( ListCustomEmojisResponse )

Список пользовательских эмодзи, которые видны аутентифицированному пользователю.

Пользовательские эмодзи доступны только для учётных записей Google Workspace, и администратор должен включить их для организации. Подробнее см. в статьях «Подробнее о пользовательских эмодзи в Google Chat» и «Управление разрешениями на использование пользовательских эмодзи» .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.customemojis.readonly
  • https://www.googleapis.com/auth/chat.customemojis
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.customemojis
  • https://www.googleapis.com/auth/chat.customemojis.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

Списокчленств

rpc ListMemberships( ListMembershipsRequest ) returns ( ListMembershipsResponse )

Список участников в пространстве. Пример см. в разделе Список пользователей и приложений Google Chat в пространстве . Список участников с аутентификацией приложения содержит список участников в пространствах, к которым приложение Chat имеет доступ, но не содержит участников в самом приложении Chat, включая его собственное. Список участников с аутентификацией пользователя содержит список участников в пространствах, к которым имеет доступ аутентифицированный пользователь.

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одной из следующих областей авторизации:

  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.memberships.readonly
    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
    • Аутентификация пользователя предоставляет привилегии администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется одна из следующих областей авторизации:
      • https://www.googleapis.com/auth/chat.admin.memberships.readonly
      • https://www.googleapis.com/auth/chat.admin.memberships
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

Список сообщений

rpc ListMessages( ListMessagesRequest ) returns ( ListMessagesResponse )

Выводит список сообщений в спейсе, участником которого является вызывающий, включая сообщения от заблокированных участников и спейсов. Системные сообщения, например, о новых участниках спейса, не включаются. Если вывести список сообщений из спейса, в котором нет сообщений, ответ будет пустым. При использовании интерфейса REST/HTTP ответ содержит пустой JSON-объект {} . Пример см. в разделе Список сообщений .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одобрением администратора в Developer Preview с областью авторизации:

    • https://www.googleapis.com/auth/chat.app.messages.readonly . При использовании этой области аутентификации этот метод возвращает только публичные сообщения в чат-группе. Он не включает личные сообщения.
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.messages.readonly
    • https://www.googleapis.com/auth/chat.messages
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.app.messages.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

СписокРеакций

rpc ListReactions( ListReactionsRequest ) returns ( ListReactionsResponse )

Выводит список реакций на сообщение. Пример см. в разделе Список реакций на сообщение .

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.messages.reactions.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

ListSpaceEvents

rpc ListSpaceEvents( ListSpaceEventsRequest ) returns ( ListSpaceEventsResponse )

Перечисляет события из чат-группы Google. Для каждого события полезная нагрузка содержит самую последнюю версию ресурса Chat. Например, если вы перечисляете события о новых участниках чат-группы, сервер возвращает ресурсы Membership , содержащие последние сведения о членстве. Если новые участники были удалены в течение запрошенного периода, полезная нагрузка события содержит пустой ресурс Membership .

Поддерживает следующие типы аутентификации с областью авторизации, подходящей для чтения запрашиваемых данных:

  • Аутентификация приложения с одобрением администратора в Developer Preview с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.app.spaces
    • https://www.googleapis.com/auth/chat.app.messages.readonly
    • https://www.googleapis.com/auth/chat.app.memberships
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.spaces.readonly
    • https://www.googleapis.com/auth/chat.spaces
    • https://www.googleapis.com/auth/chat.messages.readonly
    • https://www.googleapis.com/auth/chat.messages
    • https://www.googleapis.com/auth/chat.messages.reactions.readonly
    • https://www.googleapis.com/auth/chat.messages.reactions
    • https://www.googleapis.com/auth/chat.memberships.readonly
    • https://www.googleapis.com/auth/chat.memberships

Для просмотра списка событий аутентифицированный пользователь должен быть участником пространства.

Пример см. в разделе Список событий из пространства Google Chat .

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.app.messages.readonly
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

ListSpaces

rpc ListSpaces( ListSpacesRequest ) returns ( ListSpacesResponse )

Список чатов, в которых состоит звонящий. Групповые чаты и личные сообщения отображаются только после отправки первого сообщения. Пример см. в разделе Список чатов .

Поддерживает следующие типы аутентификации :

Чтобы составить список всех именованных пространств по организации Google Workspace, используйте метод spaces.search() используя привилегии администратора Workspace.

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot

Более подробную информацию смотрите в Руководстве по авторизации .

SearchSpaces

rpc SearchSpaces( SearchSpacesRequest ) returns ( SearchSpacesResponse )

Возвращает список пространств в организации Google Workspace на основе поиска администратора. В запросе установите use_admin_access в true . Пример см. в разделе Поиск и управление пространствами .

Требуется аутентификация пользователя с правами администратора и одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.admin.spaces.readonly
  • https://www.googleapis.com/auth/chat.admin.spaces
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces.readonly

Более подробную информацию смотрите в Руководстве по авторизации .

SetUpSpace

rpc SetUpSpace( SetUpSpaceRequest ) returns ( Space )

Создаёт чат-группу и добавляет в неё указанных пользователей. Вызывающий пользователь автоматически добавляется в чат-группу и не должен быть указан в качестве участника в запросе. Пример см. в разделе Настройка чат-группы с начальными участниками .

Чтобы указать участников-людей, которых нужно добавить, добавьте memberships с соответствующим membership.member.name . Чтобы добавить пользователя-человека, используйте users/{user} , где {user} может быть адресом электронной почты пользователя. Для пользователей в той же организации Workspace {user} также может быть id пользователя из People API или id пользователя в Directory API. Например, если идентификатор профиля пользователя People API для user@example.com равен 123456789 , вы можете добавить пользователя в пространство, установив membership.member.name в значение users/user@example.com или users/123456789 .

Чтобы указать группы Google для добавления, добавьте членства с соответствующим membership.group_member.name . Чтобы добавить или пригласить группу Google, используйте groups/{group} , где {group} — это id группы из API Cloud Identity Groups. Например, вы можете использовать API поиска Cloud Identity Groups для получения идентификатора 123456789 для адреса электронной почты группы group@example.com , а затем добавить группу в пространство, установив membership.group_member.name в значение groups/123456789 . Адрес электронной почты группы не поддерживается, и группы Google можно добавлять только в качестве участников в именованные пространства.

В именованном пространстве или групповом чате, если вызывающий абонент блокирует или заблокирован некоторыми участниками, или не имеет разрешения на добавление некоторых участников, то эти участники не добавляются в созданное пространство.

Чтобы создать прямое сообщение (DM) между вызывающим пользователем и другим пользователем-человеком, укажите ровно одно членство, представляющее этого пользователя-человека. Если один пользователь заблокирует другого, запрос не будет выполнен, и DM не будет создан.

Чтобы создать DM между вызывающим пользователем и вызывающим приложением, установите для Space.singleUserBotDm значение true и не указывайте никаких членств. Этот метод можно использовать только для создания DM с вызывающим приложением. Чтобы добавить вызывающее приложение в качестве участника пространства или существующего DM между двумя пользователями, см. статью Пригласить или добавить пользователя или приложение в пространство .

Если DM между двумя пользователями уже существует, даже если один пользователь блокирует другого во время отправки запроса, то возвращается существующее DM.

Пространства с цепочками ответов не поддерживаются. Если при настройке пространства появляется сообщение об ошибке ALREADY_EXISTS , попробуйте использовать другое displayName . Возможно, существующее пространство в организации Google Workspace уже использует это отображаемое имя.

Требуется аутентификация пользователя с одной из следующих областей авторизации :

  • https://www.googleapis.com/auth/chat.spaces.create
  • https://www.googleapis.com/auth/chat.spaces
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.create

Более подробную информацию смотрите в Руководстве по авторизации .

Обновление членства

rpc UpdateMembership( UpdateMembershipRequest ) returns ( Membership )

Обновляет членство. Пример см. в разделе Обновление членства пользователя в пространстве .

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одобрением администратора и областью авторизации:

    • https://www.googleapis.com/auth/chat.app.memberships (только в созданных приложением пространствах)
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
    • Аутентификация пользователя предоставляет права администратора, когда учетная запись администратора проходит аутентификацию, use_admin_access имеет true и используется следующая область авторизации:
      • https://www.googleapis.com/auth/chat.admin.memberships
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships

Более подробную информацию смотрите в Руководстве по авторизации .

Обновление сообщения

rpc UpdateMessage( UpdateMessageRequest ) returns ( Message )

Обновляет сообщение. Существует разница между методами patch и update . Метод patch использует запрос patch , а метод update — запрос put . Мы рекомендуем использовать метод patch . Пример см. в разделе Обновление сообщения .

Поддерживает следующие типы аутентификации :

При использовании аутентификации приложения запросы могут обновлять только сообщения, созданные вызывающим приложением Chat.

Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages

Более подробную информацию смотрите в Руководстве по авторизации .

UpdateSpace

rpc UpdateSpace( UpdateSpaceRequest ) returns ( Space )

Обновляет пространство. Пример см. в разделе Обновление пространства .

Если вы обновляете поле displayName и получаете сообщение об ошибке ALREADY_EXISTS , попробуйте использовать другое отображаемое имя. Возможно, существующее пространство в организации Google Workspace уже использует это отображаемое имя.

Поддерживает следующие типы аутентификации :

  • Аутентификация приложения с одобрением администратора и одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.app.spaces
  • Аутентификация пользователя с одной из следующих областей авторизации:

    • https://www.googleapis.com/auth/chat.spaces
    • https://www.googleapis.com/auth/chat.import (только пространство в режиме импорта)
    • Аутентификация пользователя предоставляет привилегии администратора, когда выполняется аутентификация учетной записи администратора, use_admin_access имеет true и используются следующие области авторизации:
      • https://www.googleapis.com/auth/chat.admin.spaces

Аутентификация приложения имеет следующие ограничения:

  • Чтобы обновить space.predefined_permission_settings или space.permission_settings , приложение должно быть создателем пространства.
  • Обновление space.access_settings.audience не поддерживается для аутентификации приложения.
Области авторизации

Требуется одна из следующих областей OAuth:

  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.spaces

Более подробную информацию смотрите в Руководстве по авторизации .

ОбновлениеПространстваУведомленияНастройки

rpc UpdateSpaceNotificationSetting( UpdateSpaceNotificationSettingRequest ) returns ( SpaceNotificationSetting )

Обновляет настройки уведомлений о спейсе. Пример см. в разделе Обновление настроек уведомлений о спейсе для вызывающего абонента .

Требуется аутентификация пользователя с областью авторизации :

  • https://www.googleapis.com/auth/chat.users.spacesettings
Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.users.spacesettings

Более подробную информацию смотрите в Руководстве по авторизации .

UpdateSpaceReadState

rpc UpdateSpaceReadState( UpdateSpaceReadStateRequest ) returns ( SpaceReadState )

Обновляет состояние чтения пользователя в спейсе, используемое для определения прочитанных и непрочитанных сообщений. Пример см. в разделе Обновление состояния чтения в спейсе пользователя .

Требуется аутентификация пользователя с областью авторизации :

  • https://www.googleapis.com/auth/chat.users.readstate
Области авторизации

Требуется следующая область OAuth:

  • https://www.googleapis.com/auth/chat.users.readstate

Более подробную информацию смотрите в Руководстве по авторизации .

AccessoryWidget

Один или несколько интерактивных виджетов, которые отображаются внизу сообщения. Подробнее см. в разделе Добавление интерактивных виджетов внизу сообщения .

Поля
action поля Союза. Тип действия. action может быть только одним из следующих:
button_list

ButtonList

Список кнопок.

ActionResponse

Параметры, которые приложение чата может использовать для настройки способа публикации своего ответа.

Поля
type

ResponseType

Только ввод. Тип ответа чат-приложения.

url

string

Только ввод. URL-адрес для аутентификации или настройки пользователей. (Только для типов ответов REQUEST_CONFIG .)

dialog_action

DialogAction

Только ввод. Ответ на событие взаимодействия, связанное с диалогом . Должен сопровождаться ResponseType.Dialog .

updated_widget

UpdatedWidget

Только ввод. Ответ обновлённого виджета.

ТипОтвета

Тип ответа приложения чата.

Перечисления
TYPE_UNSPECIFIED Тип по умолчанию, который обрабатывается как NEW_MESSAGE .
NEW_MESSAGE Опубликовать как новое сообщение в теме.
UPDATE_MESSAGE Обновить сообщение в приложении чата. Это разрешено только для события CARD_CLICKED , если тип отправителя сообщения — BOT .
UPDATE_USER_MESSAGE_CARDS Обновлять карточки в сообщении пользователя. Это разрешено только в ответ на событие MESSAGE с соответствующим URL-адресом или событие CARD_CLICKED , если тип отправителя сообщения — HUMAN . Текст игнорируется.
REQUEST_CONFIG В частном порядке попросите пользователя провести дополнительную аутентификацию или настройку.
DIALOG Представляет собой диалог .
UPDATE_WIDGET Запрос параметров автозаполнения текста виджета.

SelectionItems

Список результатов автозаполнения виджета.

Поля
items[]

SelectionItem

Массив объектов SelectionItem.

UpdatedWidget

Для виджетов selectionInput возвращает предложения автозаполнения для меню с множественным выбором.

Поля
widget

string

Идентификатор обновлённого виджета. Идентификатор должен совпадать с идентификатором виджета, который инициировал запрос на обновление.

Поле объединения updated_widget . Виджет обновляется в ответ на действие пользователя. updated_widget может быть только одним из следующих:
suggestions

SelectionItems

Список результатов автозаполнения виджета

ActionStatus

Представляет статус запроса на вызов или отправку диалога .

Поля
status_code

Code

Код статуса.

user_facing_message

string

Сообщение, отправляемое пользователям о статусе их запроса. Если не установлено, отправляется общее сообщение на основе status_code .

Аннотация

Только вывод. Аннотации можно связывать с текстом сообщения или с чипами, ссылающимися на ресурсы Google Workspace, такие как Google Docs или Google Sheets, с start_index и length 0. Чтобы добавить базовое форматирование к текстовому сообщению, см. раздел Форматирование текстовых сообщений .

Пример текста сообщения:

Hello @FooBot how are you!"

Соответствующие метаданные аннотаций:

"annotations":[{
  "type":"USER_MENTION",
  "startIndex":6,
  "length":7,
  "userMention": {
    "user": {
      "name":"users/{user}",
      "displayName":"FooBot",
      "avatarUrl":"https://goo.gl/aeDtrS",
      "type":"BOT"
    },
    "type":"MENTION"
   }
}]
Поля
type

AnnotationType

Тип этой аннотации.

length

int32

Длина подстроки в текстовом сообщении, которой соответствует эта аннотация. Если отсутствует, указывает на нулевую длину.

start_index

int32

Начальный индекс (начиная с 0 включительно) в теле текстового сообщения, которому соответствует эта аннотация.

metadata поля объединения. Дополнительные метаданные об аннотации. metadata могут быть только одним из следующих:
user_mention

UserMentionMetadata

Метаданные упоминания пользователя.

slash_command

SlashCommandMetadata

Метаданные для команды «косая черта».

custom_emoji_metadata

CustomEmojiMetadata

Метаданные для пользовательского эмодзи.

Тип аннотации

Тип аннотации.

Перечисления
ANNOTATION_TYPE_UNSPECIFIED Значение по умолчанию для перечисления. Не использовать.
USER_MENTION Упоминается пользователь.
SLASH_COMMAND Вызывается команда с косой чертой.
CUSTOM_EMOJI Пользовательская аннотация с эмодзи.

AppCommandMetadata

Метаданные о команде приложения чата .

Поля
app_command_id

int32

Идентификатор команды, указанный в конфигурации API чата.

app_command_type

AppCommandType

Тип команды приложения чата.

AppCommandType

Тип команды приложения «Чат». Подробнее см. в разделе «Типы команд приложения «Чат»» .

Перечисления
APP_COMMAND_TYPE_UNSPECIFIED Значение по умолчанию. Не указано.
SLASH_COMMAND Команда со слэшем. Пользователь отправляет команду в сообщении чата.
QUICK_COMMAND Быстрая команда. Пользователь выбирает команду из меню «Чат» в области ответа на сообщение.

ПрикрепленныйGif

GIF-изображение, указанное URL-адресом.

Поля
uri

string

Только вывод. URL-адрес, на котором размещено GIF-изображение.

Вложение

Вложение в Google Chat.

Поля
name

string

Необязательно. Имя ресурса вложения в формате spaces/{space}/messages/{message}/attachments/{attachment} .

content_name

string

Только вывод. Исходное имя файла с содержимым, а не полный путь.

content_type

string

Только вывод. Тип содержимого (MIME-тип) файла.

thumbnail_uri

string

Только вывод. URL-адрес миниатюры, который следует использовать для предварительного просмотра вложения пользователем. Приложения чата не должны использовать этот URL-адрес для загрузки содержимого вложения.

download_uri

string

Только вывод. URL-адрес для загрузки, который должен использоваться для загрузки вложения пользователем. Приложения чата не должны использовать этот URL для загрузки содержимого вложения.

source

Source

Только вывод. Источник вложения.

Поле объединения data_ref . Ссылка на данные вложения. data_ref может быть только одним из следующих:
attachment_data_ref

AttachmentDataRef

Необязательно. Ссылка на данные вложения. Это поле используется для создания или обновления сообщений с вложениями, а также для загрузки данных вложений через API медиа.

drive_data_ref

DriveDataRef

Только вывод. Ссылка на вложение Google Диска. Это поле используется с API Google Диска.

Источник

Источник вложения.

Перечисления
SOURCE_UNSPECIFIED Сдержанный.
DRIVE_FILE Файл находится на Google Диске.
UPLOADED_CONTENT Файл загружен в чат.

AttachmentDataRef

Ссылка на данные вложения.

Поля
resource_name

string

Необязательно. Имя ресурса данных вложения. Это поле используется API мультимедиа для загрузки данных вложения.

attachment_upload_token

string

Необязательный. Непрозрачный токен, содержащий ссылку на загруженное вложение. Обрабатывается клиентами как непрозрачная строка и используется для создания или обновления сообщений чата с вложениями.

CalendarEventLinkData

Данные для ссылок на события календаря.

Поля
calendar_id

string

Идентификатор связанного календаря.

event_id

string

Идентификатор события связанного события календаря.

CardWithId

Карточка в сообщении Google Chat.

Создавать карточки можно только в приложениях Chat. Если ваше приложение Chat аутентифицируется как пользователь , сообщение не может содержать карточки.

Создавайте и просматривайте открытки с помощью Card Builder.

Откройте конструктор карт

Поля
card_id

string

Обязательно, если сообщение содержит несколько карт. Уникальный идентификатор карты в сообщении.

card

Card

Карта. Максимальный размер — 32 КБ.

ChatSpaceLinkData

Данные для ссылок в чат-пространстве.

Поля
space

string

Пространство связанного ресурса пространства чата.

Формат: spaces/{space}

thread

string

Ветка связанного ресурса чат-пространства.

Формат: spaces/{space}/threads/{thread}

message

string

Сообщение связанного ресурса чат-пространства.

Формат: spaces/{space}/messages/{message}

CompleteImportSpaceRequest

Запрос на завершение процесса импорта пространства.

Поля
name

string

Обязательно. Имя ресурса пространства режима импорта.

Формат: spaces/{space}

CompleteImportSpaceResponse

Ответное сообщение о завершении процесса импорта пространства.

Поля
space

Space

Пространство режима импорта.

ContextualAddOnMarkup

Этот тип не имеет полей.

Разметка для разработчиков, позволяющая указать содержимое контекстного дополнения.

Карта

Карточка — это элемент пользовательского интерфейса, который может содержать виджеты пользовательского интерфейса, такие как текст и изображения.

Поля
header

CardHeader

Заголовок карточки. Заголовок обычно содержит название и изображение.

sections[]

Section

Разделы разделены линией-разделителем.

card_actions[]

CardAction

Действия этой карты.

name

string

Название карты.

CardAction

Действие с картой — это действие, связанное с картой. Для карты счёта типичным действием будет: удалить счёт, отправить счёт по электронной почте или открыть счёт в браузере.

Не поддерживается приложениями Google Chat.

Поля
action_label

string

Метка раньше отображалась в пункте меню действий.

on_click

OnClick

Действие onclick для этого элемента действия.

CardHeader

Поля
title

string

Заголовок должен быть указан. Заголовок имеет фиксированную высоту: если указаны и заголовок, и подзаголовок, каждый занимает одну строку. Если указан только заголовок, он занимает обе строки.

subtitle

string

Подзаголовок заголовка карточки.

image_style

ImageStyle

Тип изображения (например, квадратная рамка или круглая рамка).

image_url

string

URL-адрес изображения в заголовке карточки.

ImageStyle

Перечисления
IMAGE_STYLE_UNSPECIFIED
IMAGE Квадратная граница.
AVATAR Круглая граница.

Раздел

Раздел содержит набор виджетов, которые отображаются (вертикально) в порядке их указания. На всех платформах карточки имеют узкую фиксированную ширину, поэтому в настоящее время нет необходимости в свойствах макета (например, float).

Поля
header

string

Заголовок раздела. Поддерживается форматированный текст. Подробнее о форматировании текста см. в разделах Форматирование текста в приложениях Google Chat и Форматирование текста в дополнениях Google Workspace .

widgets[]

WidgetMarkup

Раздел должен содержать хотя бы один виджет.

CreateCustomEmojiRequest

Запрос на создание собственного эмодзи.

Поля
custom_emoji

CustomEmoji

Обязательно. Пользовательский эмодзи для создания.

CreateMembershipRequest

Запрос сообщения на создание членства.

Поля
parent

string

Обязательно. Имя ресурса пространства, для которого необходимо создать членство.

Формат: пробелы/{пробел}

membership

Membership

Обязательно. Отношение членства, которое необходимо создать.

Поле memberType должно содержать пользователя с заполненными полями user.name и user.type . Сервер назначит имя ресурса и перезапишет все указанные данные.

Когда приложение чата создает отношение членства для пользователя-человека, оно должно использовать определенные области авторизации и задавать конкретные значения для определенных полей:

  • При аутентификации в качестве пользователя требуется область авторизации chat.memberships .

  • При аутентификации в качестве приложения требуется область авторизации chat.app.memberships .

  • Set user.type to HUMAN , and set user.name with format users/{user} , where {user} can be the email address for the user. For users in the same Workspace organization {user} can also be the id of the person from the People API, or the id for the user in the Directory API. For example, if the People API Person profile ID for user@example.com is 123456789 , you can add the user to the space by setting the membership.member.name to users/user@example.com or users/123456789 .

Inviting users external to the Workspace organization that owns the space requires user authentication .

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT , and set user.name to users/app .

use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.memberships OAuth 2.0 scope .

Creating app memberships or creating memberships for users outside the administrator's Google Workspace organization isn't supported using admin access.

CreateMessageRequest

Creates a message.

Поля
parent

string

Required. The resource name of the space in which to create a message.

Формат: spaces/{space}

message

Message

Required. Message body.

thread_key
(deprecated)

string

Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a threadKey or the thread.name . For example usage, see Start or reply to a message thread .

request_id

string

Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

message_reply_option

MessageReplyOption

Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces.

When responding to user interactions , this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread.

message_id

string

Optional. A custom ID for a message. Lets Chat apps get, update, or delete a message without needing to store the system-assigned ID in the message's resource name (represented in the message name field).

The value for this field must meet the following requirements:

  • Begins with client- . For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message .

MessageReplyOption

Specifies how to reply to a message. More states might be added in the future.

Перечисления
MESSAGE_REPLY_OPTION_UNSPECIFIED Default. Starts a new thread. Using this option ignores any thread ID or thread_key that's included.
REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD Creates the message as a reply to the thread specified by thread ID or thread_key . If it fails, the message starts a new thread instead.
REPLY_MESSAGE_OR_FAIL Creates the message as a reply to the thread specified by thread ID or thread_key . If a new thread_key is used, a new thread is created. If the message creation fails, a NOT_FOUND error is returned instead.

CreateReactionRequest

Creates a reaction to a message.

Поля
parent

string

Required. The message where the reaction is created.

Формат: spaces/{space}/messages/{message}

reaction

Reaction

Required. The reaction to create.

CreateSpaceRequest

A request to create a named space with no members.

Поля
space

Space

Required. The displayName and spaceType fields must be populated. Only SpaceType.SPACE and SpaceType.GROUP_CHAT are supported. SpaceType.GROUP_CHAT can only be used if importMode is set to true.

If you receive the error message ALREADY_EXISTS , try a different displayName . An existing space within the Google Workspace organization might already use this display name.

The space name is assigned on the server so anything specified in this field will be ignored.

request_id

string

Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.

CustomEmoji

Represents a custom emoji .

Поля
name

string

Identifier. The resource name of the custom emoji, assigned by the server.

Format: customEmojis/{customEmoji}

uid

string

Output only. Unique key for the custom emoji resource.

emoji_name

string

Optional. Immutable. User-provided name for the custom emoji, which is unique within the organization.

Required when the custom emoji is created, output only otherwise.

Emoji names must start and end with colons, must be lowercase and can only contain alphanumeric characters, hyphens, and underscores. Hyphens and underscores should be used to separate words and cannot be used consecutively.

Example: :valid-emoji-name:

temporary_image_uri

string

Output only. A temporary image URL for the custom emoji, valid for at least 10 minutes. Note that this is not populated in the response when the custom emoji is created.

payload

CustomEmojiPayload

Optional. Input only. Payload data. Required when the custom emoji is created.

CustomEmojiPayload

Payload data for the custom emoji.

Поля
file_content

bytes

Required. Input only. The image used for the custom emoji.

The payload must be under 256 KB and the dimension of the image must be square and between 64 and 500 pixels. The restrictions are subject to change.

filename

string

Required. Input only. The image file name.

Supported file extensions: .png , .jpg , .gif .

CustomEmojiMetadata

Метаданные аннотаций для пользовательских эмодзи.

Поля
custom_emoji

CustomEmoji

Пользовательские эмодзи.

DeleteCustomEmojiRequest

Request for deleting a custom emoji.

Поля
name

string

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji} . For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

DeleteMembershipRequest

Request to delete a membership in a space.

Поля
name

string

Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships.

When deleting a human membership, requires the chat.memberships scope with user authentication or the chat.memberships.app scope with app authentication and the spaces/{space}/members/{member} format. You can use the email as an alias for {member} . For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

When deleting an app membership, requires the chat.memberships.app scope and spaces/{space}/members/app format.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app .

use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.memberships OAuth 2.0 scope .

Deleting app memberships in a space isn't supported using admin access.

DeleteMessageRequest

Request to delete a message.

Поля
name

string

Required. Resource name of the message.

Формат: spaces/{space}/messages/{message}

If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message} . For details, see Name a message .

force

bool

Optional. When true , deleting a message also deletes its threaded replies. When false , if a message has threaded replies, deletion fails.

Only applies when authenticating as a user . Has no effect when authenticating as a Chat app .

DeleteReactionRequest

Deletes a reaction to a message.

Поля
name

string

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

DeleteSpaceRequest

Request for deleting a space.

Поля
name

string

Required. Resource name of the space to delete.

Формат: spaces/{space}

use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.delete OAuth 2.0 scope .

УдалениеМетаданных

Information about a deleted message. A message is deleted when delete_time is set.

Поля
deletion_type

DeletionType

Указывает, кто удалил сообщение.

Тип удаления

Кто и как удалил сообщение. В будущем могут быть добавлены дополнительные значения. Подробнее о том, когда сообщения можно удалить, см. в разделе «Редактирование или удаление сообщения в Google Chat».

Перечисления
DELETION_TYPE_UNSPECIFIED Это значение не используется.
CREATOR Пользователь удалил свое сообщение.
SPACE_OWNER Менеджер пространства удалил сообщение.
ADMIN Администратор Google Workspace удалил сообщение. Администраторы могут удалять любые сообщения в пространстве, включая сообщения, отправленные любым участником пространства или через приложение Chat.
APP_MESSAGE_EXPIRY Приложение Chat удалило собственное сообщение по истечении срока его действия.
CREATOR_VIA_APP Приложение Chat удалило сообщение от имени создателя (используя аутентификацию пользователя).
SPACE_OWNER_VIA_APP Приложение Chat удалило сообщение от имени менеджера пространства (используя аутентификацию пользователя).
SPACE_MEMBER Участник сообщества удалил сообщение. Пользователи могут удалять сообщения, отправленные приложениями.

Диалог

Обертка вокруг тела карточки диалога.

Поля
body

Card

Только ввод. Текст диалога, отображаемый в модальном окне. Приложения Google Chat не поддерживают следующие сущности карточек: DateTimePicker и OnChangeAction .

DialogAction

Содержит диалог и код статуса запроса.

Поля
action_status

ActionStatus

Только ввод. Статус запроса на вызов или отправку диалога . При необходимости отображает статус и сообщение для пользователей. Например, в случае ошибки или успешного выполнения.

action поля Союза. Действие для выполнения. action может быть только одним из следующих:
dialog

Dialog

Только ввод. Диалог для запроса.

DriveDataRef

A reference to the data of a drive attachment.

Поля
drive_file_id

string

The ID for the drive file. Use with the Drive API.

DriveLinkData

Данные для ссылок Google Drive.

Поля
drive_data_ref

DriveDataRef

DriveDataRef , который ссылается на файл Google Диска.

mime_type

string

Тип MIME связанного ресурса Google Диска.

Эмодзи

An emoji that is used as a reaction to a message.

Поля
Union field content . Required. The content of the emoji. content can be only one of the following:
unicode

string

Optional. A basic emoji represented by a unicode string.

custom_emoji

CustomEmoji

A custom emoji.

EmojiReactionSummary

Количество людей, отреагировавших на сообщение определенным эмодзи.

Поля
emoji

Emoji

Только вывод. Эмодзи, связанные с реакциями.

reaction_count

int32

Только вывод. Общее количество реакций с использованием соответствующего эмодзи.

FindDirectMessageRequest

A request to get direct message space based on the user resource.

Поля
name

string

Required. Resource name of the user to find direct message with.

Format: users/{user} , where {user} is either the id for the person from the People API, or the id for the user in the Directory API. For example, if the People API profile ID is 123456789 , you can find a direct message with that person by using users/123456789 as the name . When authenticated as a user , you can use the email as an alias for {user} . For example, users/example@gmail.com where example@gmail.com is the email of the Google Chat user.

GetAttachmentRequest

Request to get an attachment.

Поля
name

string

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment} .

GetCustomEmojiRequest

A request to return a single custom emoji.

Поля
name

string

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji} . For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

GetMembershipRequest

Request to get a membership of a space.

Поля
name

string

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication , you can optionally use spaces/{space}/members/app .

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member} . For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.memberships or chat.admin.memberships.readonly OAuth 2.0 scopes .

Getting app memberships in a space isn't supported when using admin access.

GetMessageRequest

Request to get a message.

Поля
name

string

Required. Resource name of the message.

Формат: spaces/{space}/messages/{message}

If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message} . For details, see Name a message .

GetSpaceEventRequest

Request message for getting a space event.

Поля
name

string

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

GetSpaceNotificationSettingRequest

Request message to get space notification setting. Only supports getting notification setting for the calling user.

Поля
name

string

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting , OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting , OR
  • users/123456789/spaces/{space}/spaceNotificationSetting . Note: Only the caller's user id or email is allowed in the path.

GetSpaceReadStateRequest

Request message for GetSpaceReadState API.

Поля
name

string

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState .

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState .

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState .

Format: users/{user}/spaces/{space}/spaceReadState

GetSpaceRequest

A request to return a single space.

Поля
name

string

Required. Resource name of the space, in the form spaces/{space} .

Формат: spaces/{space}

use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.spaces or chat.admin.spaces.readonly OAuth 2.0 scopes .

GetThreadReadStateRequest

Request message for GetThreadReadStateRequest API.

Поля
name

string

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState .

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState .

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState .

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

Группа

A Google Group in Google Chat.

Поля
name

string

Resource name for a Google Group.

Represents a group in Cloud Identity Groups API.

Format: groups/{group}

ИсторияГосударство

The history state for messages and spaces. Specifies how long messages and conversation threads are kept after creation.

Перечисления
HISTORY_STATE_UNSPECIFIED Default value. Do not use.
HISTORY_OFF History off. Messages and threads are kept for 24 hours .
HISTORY_ON History on. The organization's Vault retention rules specify for how long messages and threads are kept.

ListCustomEmojisRequest

A request to return a list of custom emojis.

Поля
page_size

int32

Optional. The maximum number of custom emojis returned. The service can return fewer custom emojis than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.

page_token

string

Optional. (If resuming from a previous query.)

A page token received from a previous list custom emoji call. Provide this to retrieve the subsequent page.

When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.

filter

string

Optional. A query filter.

Supports filtering by creator.

To filter by creator, you must specify a valid value. Currently only creator("users/me") and NOT creator("users/me") are accepted to filter custom emojis by whether they were created by the calling user or not.

For example, the following query returns custom emojis created by the caller:

creator("users/me")

Invalid queries are rejected with an INVALID_ARGUMENT error.

ListCustomEmojisResponse

A response to list custom emojis.

Поля
custom_emojis[]

CustomEmoji

Unordered list. List of custom emojis.

next_page_token

string

A token that you can send as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

ListMembershipsRequest

Request message for listing memberships.

Поля
parent

string

Required. The resource name of the space for which to fetch a membership list.

Формат: пробелы/{пробел}

page_size

int32

Optional. The maximum number of memberships to return. The service might return fewer than this value.

If unspecified, at most 100 memberships are returned.

The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.

Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token, received from a previous call to list memberships. Provide this parameter to retrieve the subsequent page.

When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.

filter

string

Optional. A query filter.

You can filter memberships by a member's role ( role ) and type ( member.type ).

To filter by role, set role to ROLE_MEMBER or ROLE_MANAGER .

To filter by type, set member.type to HUMAN or BOT . You can also filter for member.type using the != operator.

To filter by both role and type, use the AND operator. To filter by either role or type, use the OR operator.

Either member.type = "HUMAN" or member.type != "BOT" is required when use_admin_access is set to true. Other member type filters will be rejected.

For example, the following queries are valid:

role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
member.type = "HUMAN" AND role = "ROLE_MANAGER"

member.type != "BOT"

The following queries are invalid:

member.type = "HUMAN" AND member.type = "BOT"
role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

show_groups

bool

Optional. When true , also returns memberships associated with a Google Group , in addition to other types of memberships. If a filter is set, Google Group memberships that don't match the filter criteria aren't returned.

show_invited

bool

Optional. When true , also returns memberships associated with invited members, in addition to other types of memberships. If a filter is set, invited memberships that don't match the filter criteria aren't returned.

Currently requires user authentication .

use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires either the chat.admin.memberships.readonly or chat.admin.memberships OAuth 2.0 scope .

Listing app memberships in a space isn't supported when using admin access.

ListMembershipsResponse

Response to list memberships of the space.

Поля
memberships[]

Membership

Unordered list. List of memberships in the requested (or first) page.

next_page_token

string

A token that you can send as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

ListMessagesRequest

Lists messages in the specified space, that the user is a member of.

Поля
parent

string

Required. The resource name of the space to list messages from.

Формат: spaces/{space}

page_size

int32

Optional. The maximum number of messages returned. The service might return fewer messages than this value.

If unspecified, at most 25 are returned.

The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.

Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token received from a previous list messages call. Provide this parameter to retrieve the subsequent page.

When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.

filter

string

Optional. A query filter.

You can filter messages by date ( create_time ) and thread ( thread.name ).

To filter messages by the date they were created, specify the create_time with a timestamp in RFC-3339 format and double quotation marks. For example, "2023-04-21T11:30:00-04:00" . You can use the greater than operator > to list messages that were created after a timestamp, or the less than operator < to list messages that were created before a timestamp. To filter messages within a time interval, use the AND operator between two timestamps.

To filter by thread, specify the thread.name , formatted as spaces/{space}/threads/{thread} . You can only specify one thread.name per query.

To filter by both thread and date, use the AND operator in your query.

For example, the following queries are valid:

create_time > "2012-04-21T11:30:00-04:00"

create_time > "2012-04-21T11:30:00-04:00" AND
  thread.name = spaces/AAAAAAAAAAA/threads/123

create_time > "2012-04-21T11:30:00+00:00" AND

create_time < "2013-01-01T00:00:00+00:00" AND
  thread.name = spaces/AAAAAAAAAAA/threads/123

thread.name = spaces/AAAAAAAAAAA/threads/123

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

order_by

string

Optional. How the list of messages is ordered. Specify a value to order by an ordering operation. Valid ordering operation values are as follows:

  • ASC for ascending.

  • DESC for descending.

The default ordering is create_time ASC .

show_deleted

bool

Optional. Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.

ListMessagesResponse

Response message for listing messages.

Поля
messages[]

Message

Список сообщений.

next_page_token

string

You can send a token as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

ListReactionsRequest

Lists reactions to a message.

Поля
parent

string

Required. The message users reacted to.

Формат: spaces/{space}/messages/{message}

page_size

int32

Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.

page_token

string

Optional. (If resuming from a previous query.)

A page token received from a previous list reactions call. Provide this to retrieve the subsequent page.

When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.

filter

string

Optional. A query filter.

You can filter reactions by emoji (either emoji.unicode or emoji.custom_emoji.uid ) and user ( user.name ).

To filter reactions for multiple emojis or users, join similar fields with the OR operator, such as emoji.unicode = "🙂" OR emoji.unicode = "👍" and user.name = "users/AAAAAA" OR user.name = "users/BBBBBB" .

To filter reactions by emoji and user, use the AND operator, such as emoji.unicode = "🙂" AND user.name = "users/AAAAAA" .

If your query uses both AND and OR , group them with parentheses.

For example, the following queries are valid:

user.name = "users/{user}"
emoji.unicode = "🙂"
emoji.custom_emoji.uid = "{uid}"
emoji.unicode = "🙂" OR emoji.unicode = "👍"
emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
emoji.unicode = "🙂" AND user.name = "users/{user}"
(emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}")
AND user.name = "users/{user}"

The following queries are invalid:

emoji.unicode = "🙂" AND emoji.unicode = "👍"
emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}"
emoji.unicode = "🙂" OR user.name = "users/{user}"
emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR
user.name = "users/{user}"
emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
AND user.name = "users/{user}"

Invalid queries are rejected with an INVALID_ARGUMENT error.

ListReactionsResponse

Response to a list reactions request.

Поля
reactions[]

Reaction

List of reactions in the requested (or first) page.

next_page_token

string

Continuation token to retrieve the next page of results. It's empty for the last page of results.

ListSpaceEventsRequest

Request message for listing space events.

Поля
parent

string

Required. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space} .

page_size

int32

Optional. The maximum number of space events returned. The service might return fewer than this value.

Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token, received from a previous list space events call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to list space events must match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.

filter

string

Required. A query filter.

You must specify at least one event type ( event_type ) using the has : operator. To filter by multiple event types, use the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions ( google.workspace.chat.reaction.v1.created ), the server also returns batch new reactions events ( google.workspace.chat.reaction.v1.batchCreated ). For a list of supported event types, see the SpaceEvents reference documentation .

Optionally, you can also filter by start time ( start_time ) and end time ( end_time ):

  • start_time : Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
  • end_time : Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

To specify a start or end time, use the equals = operator and format in RFC-3339 . To filter by both start_time and end_time , use the AND operator.

For example, the following queries are valid:

start_time="2023-08-23T19:20:33+00:00" AND
end_time="2023-08-23T19:21:54+00:00"
start_time="2023-08-23T19:20:33+00:00" AND
(event_types:"google.workspace.chat.space.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created")

The following queries are invalid:

start_time="2023-08-23T19:20:33+00:00" OR
end_time="2023-08-23T19:21:54+00:00"
event_types:"google.workspace.chat.space.v1.updated" AND
event_types:"google.workspace.chat.message.v1.created"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

ListSpaceEventsResponse

Response message for listing space events.

Поля
space_events[]

SpaceEvent

Results are returned in chronological order (oldest event first). Note: The permissionSettings field is not returned in the Space object for list requests.

next_page_token

string

Continuation token used to fetch more events. If this field is omitted, there are no subsequent pages.

ListSpacesRequest

A request to list the spaces the caller is a member of.

Поля
page_size

int32

Optional. The maximum number of spaces to return. The service might return fewer than this value.

If unspecified, at most 100 spaces are returned.

The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.

Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page.

When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results.

filter

string

Optional. A query filter.

You can filter spaces by the space type ( space_type ).

To filter by space type, you must specify valid enum value, such as SPACE or GROUP_CHAT (the space_type can't be SPACE_TYPE_UNSPECIFIED ). To query for multiple space types, use the OR operator.

For example, the following queries are valid:

space_type = "SPACE"
spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

ListSpacesResponse

The response for a list spaces request.

Поля
spaces[]

Space

List of spaces in the requested (or first) page. Note: The permissionSettings field is not returned in the Space object for list requests.

next_page_token

string

You can send a token as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

MatchedUrl

Совпадающий URL-адрес в сообщении чата. Приложения чата могут просматривать совпадающие URL-адреса. Подробнее см. в разделе Предварительный просмотр ссылок .

Поля
url

string

Только вывод. URL-адрес, который был найден.

MeetSpaceLinkData

Данные для ссылок на пространство Meet.

Поля
meeting_code

string

Код встречи связанного пространства Meet.

type

Type

Указывает тип пространства для встреч.

huddle_status

HuddleStatus

Необязательно. Только вывод. Если встреча — это чат, указывает статус чата. В противном случае этот статус не задан.

HuddleStatus

Статус встречи

Перечисления
HUDDLE_STATUS_UNSPECIFIED Значение по умолчанию для перечисления. Не использовать.
STARTED Переговоры начались.
ENDED Хадл завершён. В этом случае URI и идентификаторы пространства Meet больше не будут действительны.
MISSED Хаддл был пропущен. В этом случае URI и идентификаторы пространства Meet больше не будут действительны.

Тип

Тип пространства для встреч.

Перечисления
TYPE_UNSPECIFIED Значение по умолчанию для перечисления. Не использовать.
MEETING Пространство Meet — это место для встреч.
HUDDLE Пространство Meet представляет собой место для встреч.

Членство

Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.

Поля
name

string

Identifier. Resource name of the membership, assigned by the server.

Format: spaces/{space}/members/{member}

state

MembershipState

Output only. State of the membership.

role

MembershipRole

Optional. User's role within a Chat space, which determines their permitted actions in the space.

This field can only be used as input in UpdateMembership .

create_time

Timestamp

Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.

delete_time

Timestamp

Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.

Union field memberType . Member associated with this membership. Other member types might be supported in the future. memberType can be only one of the following:
member

User

Optional. The Google Chat user or app the membership corresponds to. If your Chat app authenticates as a user , the output populates the user name and type .

group_member

Group

Optional. The Google Group the membership corresponds to.

Reading or mutating memberships for Google Groups requires user authentication .

MembershipRole

Represents a user's permitted actions in a Chat space. More enum values might be added in the future.

Перечисления
MEMBERSHIP_ROLE_UNSPECIFIED Default value. For users : they aren't a member of the space, but can be invited. For Google Groups : they're always assigned this role (other enum values might be used in the future).
ROLE_MEMBER

A member of the space. In the Chat UI, this role is called Member.

The user has basic permissions, like sending messages to the space. Managers and owners can grant members additional permissions in a space, including:

  • Add or remove members.
  • Modify space details.
  • Turn history on or off.
  • Mention everyone in the space with @all .
  • Manage Chat apps and webhooks installed in the space.

In direct messages and unnamed group conversations, everyone has this role.

ROLE_MANAGER

A space owner. In the Chat UI, this role is called Owner.

The user has the complete set of space permissions to manage the space, including:

  • Change the role of other members in the space to member, manager, or owner.
  • Delete the space.

Only supported in SpaceType.SPACE (named spaces).

To learn more, see Learn more about your role as a space owner or manager .

MembershipState

Specifies the member's relationship with a space. Other membership states might be supported in the future.

Перечисления
MEMBERSHIP_STATE_UNSPECIFIED Default value. Don't use.
JOINED The user is added to the space, and can participate in the space.
INVITED The user is invited to join the space, but hasn't joined it.
NOT_A_MEMBER The user doesn't belong to the space and doesn't have a pending invitation to join the space.

MembershipBatchCreatedEventData

Event payload for multiple new memberships.

Event type: google.workspace.chat.membership.v1.batchCreated

Поля
memberships[]

MembershipCreatedEventData

A list of new memberships.

MembershipBatchDeletedEventData

Event payload for multiple deleted memberships.

Event type: google.workspace.chat.membership.v1.batchDeleted

Поля
memberships[]

MembershipDeletedEventData

A list of deleted memberships.

MembershipBatchUpdatedEventData

Event payload for multiple updated memberships.

Event type: google.workspace.chat.membership.v1.batchUpdated

Поля
memberships[]

MembershipUpdatedEventData

A list of updated memberships.

MembershipCreatedEventData

Event payload for a new membership.

Event type: google.workspace.chat.membership.v1.created .

Поля
membership

Membership

The new membership.

MembershipDeletedEventData

Event payload for a deleted membership.

Event type: google.workspace.chat.membership.v1.deleted

Поля
membership

Membership

The deleted membership. Only the name and state fields are populated.

MembershipUpdatedEventData

Event payload for an updated membership.

Event type: google.workspace.chat.membership.v1.updated

Поля
membership

Membership

The updated membership.

Сообщение

Сообщение в чате Google.

Поля
name

string

Идентификатор. Имя ресурса сообщения.

Формат: spaces/{space}/messages/{message}

Где {space} — идентификатор пространства, в котором опубликовано сообщение, а {message} — системный идентификатор сообщения. Например, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB .

Если при создании сообщения вы задаёте пользовательский идентификатор, вы можете использовать его для указания сообщения в запросе, заменив {message} значением из поля clientAssignedMessageId . Например, spaces/AAAAAAAAAAA/messages/client-custom-name . Подробнее см. в разделе Имя сообщения .

sender

User

Только выходные данные. Пользователь, создавший сообщение. Если ваше приложение Chat аутентифицируется как пользователь , выходные данные содержат name и type пользователя .

create_time

Timestamp

Необязательное. Неизменяемое. Для чат-групп, созданных в чате, время создания сообщения. Это поле только выводится, за исключением случаев использования в чат-группах в режиме импорта.

Для пространств в режиме импорта задайте в этом поле историческую временную метку, когда сообщение было создано в источнике, чтобы сохранить исходное время создания.

last_update_time

Timestamp

Только вывод. Время последнего редактирования сообщения пользователем. Если сообщение никогда не редактировалось, это поле пустое.

delete_time

Timestamp

Только вывод. Время удаления сообщения в Google Chat. Если сообщение никогда не удалялось, это поле пустое.

text

string

Необязательно. Текст сообщения в виде обычного текста. Первая ссылка на изображение, видео или веб-страницу создаёт предварительный просмотр . Вы также можете @упомянуть пользователя Google Chat или всех участников чата.

Информацию о создании текстовых сообщений см. в разделе Отправка сообщения .

formatted_text

string

Только вывод. Содержит text сообщения с разметкой, добавленной для передачи форматирования. Это поле может не отображать всё форматирование, видимое в пользовательском интерфейсе, но включает следующее:

  • Синтаксис разметки для полужирного шрифта, курсива, зачеркнутого шрифта, моноширинного шрифта, моноширинного блока и маркированного списка.

  • Пользователь упоминает, используя формат <users/{user}> .

  • Пользовательские гиперссылки, использующие формат <{url}|{rendered_text}> , где первая строка — это URL-адрес, а вторая — отображаемый текст, например, <http://example.com|custom text> .

  • Custom emoji using the format :{emoji_name}: —for example, :smile: . This doesn't apply to Unicode emoji, such as U+1F600 for a grinning face emoji.

  • Элементы маркированного списка обозначаются звездочками ( * ), например, * item .

Для получения дополнительной информации см. Просмотр форматирования текста, отправленного в сообщении.

cards[]
(deprecated)

Card

Deprecated: Use cards_v2 instead.

Rich, formatted, and interactive cards that you can use to display UI elements such as: formatted texts, buttons, and clickable images. Cards are normally displayed below the plain-text body of the message. cards and cards_v2 can have a maximum size of 32 KB.

cards_v2[]

CardWithId

Необязательно. Набор карточек .

Создавать карточки можно только в приложениях Chat. Если ваше приложение Chat аутентифицируется как пользователь , сообщения не могут содержать карточки.

Чтобы узнать, как создать сообщение, содержащее карточки, см. раздел Отправка сообщения .

Создавайте и просматривайте открытки с помощью Card Builder.

Откройте конструктор карт

annotations[]

Annotation

Output only. Annotations can be associated with the plain-text body of the message or with chips that link to Google Workspace resources like Google Docs or Sheets with start_index and length of 0.

thread

Thread

Ветка, к которой принадлежит сообщение. Пример использования см. в разделе «Начать ветку сообщений или ответить на неё» .

space

Space

Только выходные данные. Если ваше приложение чата аутентифицируется как пользователь , выходные данные содержат только name пространства .

fallback_text

string

Необязательно. Текстовое описание карточек сообщения, используемое, когда сами карточки не могут быть отображены, например, в мобильных уведомлениях.

action_response

ActionResponse

Только ввод. Параметры, которые приложение чата может использовать для настройки способа публикации своего ответа.

argument_text

string

Только вывод. Текст сообщения в виде обычного текста без всех упоминаний приложения Chat.

slash_command

SlashCommand

Только вывод. Информация о команде с косой чертой, если применимо.

attachment[]

Attachment

Необязательно. Загруженное пользователем вложение.

matched_url

MatchedUrl

Только вывод. URL-адрес в spaces.messages.text , соответствующий шаблону предварительного просмотра ссылки. Подробнее см. в разделе Предварительный просмотр ссылок .

thread_reply

bool

Только вывод. При true сообщение является ответом в ветке ответов. При значении false сообщение отображается в чате верхнего уровня чат-группы как первое сообщение в ветке или как сообщение без ответов в ветке.

Если пространство не поддерживает ответы в потоках, это поле всегда имеет false .

client_assigned_message_id

string

Необязательно. Пользовательский идентификатор сообщения. Вы можете использовать поле для идентификации сообщения, а также для получения, удаления или обновления сообщения. Чтобы задать пользовательский идентификатор, укажите поле messageId при создании сообщения. Подробнее см. в разделе «Название сообщения» .

emoji_reaction_summaries[]

EmojiReactionSummary

Только вывод. Список эмодзи-реакций на сообщение.

private_message_viewer

User

Необязательное. Неизменяемое. Входные данные для создания сообщения, в противном случае — только выходные данные. Пользователь, который может просматривать сообщение. Если задано, сообщение становится конфиденциальным и видно только указанному пользователю и приложению Chat. Чтобы включить это поле в запрос, необходимо вызвать API Chat, используя аутентификацию приложения , и исключить следующее:

Подробности смотрите в разделе Отправить личное сообщение .

deletion_metadata

DeletionMetadata

Output only. Information about a deleted message. A message is deleted when delete_time is set.

quoted_message_metadata

QuotedMessageMetadata

Необязательно. Информация о сообщении, цитируемом в другом сообщении.

При создании сообщения вы можете цитировать сообщения из той же ветки или цитировать корневое сообщение, чтобы создать новое корневое сообщение. Однако цитировать ответ на сообщение из другой ветки нельзя.

При обновлении сообщения вы не можете добавить или заменить поле quotedMessageMetadata , но можете удалить его.

Пример использования см. в разделе Цитировать другое сообщение .

attached_gifs[]

AttachedGif

Только вывод. GIF-изображения, прикрепленные к сообщению.

accessory_widgets[]

AccessoryWidget

Необязательно. Один или несколько интерактивных виджетов, отображаемых внизу сообщения. Вы можете добавлять дополнительные виджеты к сообщениям, содержащим текст, карточки или и текст, и карточки. Не поддерживается для сообщений, содержащих диалоговые окна. Подробнее см. в разделе Добавление интерактивных виджетов внизу сообщения .

Для создания сообщения с помощью дополнительных виджетов требуется аутентификация приложения .

MessageBatchCreatedEventData

Event payload for multiple new messages.

Event type: google.workspace.chat.message.v1.batchCreated

Поля
messages[]

MessageCreatedEventData

A list of new messages.

MessageBatchDeletedEventData

Event payload for multiple deleted messages.

Event type: google.workspace.chat.message.v1.batchDeleted

Поля
messages[]

MessageDeletedEventData

A list of deleted messages.

MessageBatchUpdatedEventData

Event payload for multiple updated messages.

Event type: google.workspace.chat.message.v1.batchUpdated

Поля
messages[]

MessageUpdatedEventData

A list of updated messages.

MessageCreatedEventData

Event payload for a new message.

Event type: google.workspace.chat.message.v1.created

Поля
message

Message

The new message.

MessageDeletedEventData

Event payload for a deleted message.

Event type: google.workspace.chat.message.v1.deleted

Поля
message

Message

The deleted message. Only the name , createTime , deleteTime , and deletionMetadata fields are populated.

MessageUpdatedEventData

Event payload for an updated message.

Event type: google.workspace.chat.message.v1.updated

Поля
message

Message

The updated message.

QuotedMessageMetadata

Информация о сообщении, цитируемом в другом сообщении.

При создании сообщения вы можете цитировать сообщения из той же ветки или цитировать корневое сообщение, чтобы создать новое корневое сообщение. Однако цитировать ответ на сообщение из другой ветки нельзя.

При обновлении сообщения вы не можете добавить или заменить поле quotedMessageMetadata , но можете удалить его.

Пример использования см. в разделе Цитировать другое сообщение .

Поля
name

string

Обязательно. Имя ресурса цитируемого сообщения.

Формат: spaces/{space}/messages/{message}

last_update_time

Timestamp

Обязательно. Временная метка создания цитируемого сообщения или его последнего обновления.

If the message was edited, use this field, last_update_time . If the message was never edited, use create_time .

If last_update_time doesn't match the latest version of the quoted message, the request fails.

Реакция

A reaction to a message.

Поля
name

string

Identifier. The resource name of the reaction.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

user

User

Output only. The user who created the reaction.

emoji

Emoji

Required. The emoji used in the reaction.

ReactionBatchCreatedEventData

Event payload for multiple new reactions.

Event type: google.workspace.chat.reaction.v1.batchCreated

Поля
reactions[]

ReactionCreatedEventData

A list of new reactions.

ReactionBatchDeletedEventData

Event payload for multiple deleted reactions.

Event type: google.workspace.chat.reaction.v1.batchDeleted

Поля
reactions[]

ReactionDeletedEventData

A list of deleted reactions.

ReactionCreatedEventData

Event payload for a new reaction.

Event type: google.workspace.chat.reaction.v1.created

Поля
reaction

Reaction

The new reaction.

ReactionDeletedEventData

Event payload for a deleted reaction.

Type: google.workspace.chat.reaction.v1.deleted

Поля
reaction

Reaction

The deleted reaction.

RichLinkMetadata

A rich link to a resource. Rich links can be associated with the plain-text body of the message or represent chips that link to Google Workspace resources like Google Docs or Sheets with start_index and length of 0.

Поля
uri

string

URI этой ссылки.

data поля объединения. Данные для связанного ресурса. data могут быть только одним из следующих:

RichLinkType

Расширенный тип ссылки. В будущем могут быть добавлены и другие типы.

Перечисления
DRIVE_FILE Тип расширенной ссылки Google Drive.
CHAT_SPACE Тип расширенной ссылки для чат-пространства. Например, космический смарт-чип.
MEET_SPACE Тип расширенной ссылки для сообщения Meet. Например, чип Meet.
CALENDAR_EVENT Тип расширенной ссылки на сообщение календаря. Например, чип календаря.

SearchSpacesRequest

Request to search for a list of spaces based on a query.

Поля
use_admin_access

bool

When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires either the chat.admin.spaces.readonly or chat.admin.spaces OAuth 2.0 scope .

This method currently only supports admin access, thus only true is accepted for this field.

page_size

int32

The maximum number of spaces to return. The service may return fewer than this value.

If unspecified, at most 100 spaces are returned.

The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.

page_token

string

A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page.

When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.

query

string

Required. A search query.

You can search by using the following parameters:

  • create_time
  • customer
  • display_name
  • external_user_allowed
  • last_active_time
  • space_history_state
  • space_type

create_time and last_active_time accept a timestamp in RFC-3339 format and the supported comparison operators are: = , < , > , <= , >= .

customer is required and is used to indicate which customer to fetch spaces from. customers/my_customer is the only supported value.

display_name only accepts the HAS ( : ) operator. The text to match is first tokenized into tokens and each token is prefix-matched case-insensitively and independently as a substring anywhere in the space's display_name . For example, Fun Eve matches Fun event or The evening was fun , but not notFun event or even .

external_user_allowed accepts either true or false .

space_history_state only accepts values from the historyState field of a space resource.

space_type is required and the only valid value is SPACE .

Across different fields, only AND operators are supported. A valid example is space_type = "SPACE" AND display_name:"Hello" and an invalid example is space_type = "SPACE" OR display_name:"Hello" .

Among the same field, space_type doesn't support AND or OR operators. display_name , 'space_history_state', and 'external_user_allowed' only support OR operators. last_active_time and create_time support both AND and OR operators. AND can only be used to represent an interval, such as last_active_time < "2022-01-01T00:00:00+00:00" AND last_active_time > "2023-01-01T00:00:00+00:00" .

The following example queries are valid:

customer = "customers/my_customer" AND space_type = "SPACE"

customer = "customers/my_customer" AND space_type = "SPACE" AND
display_name:"Hello World"

customer = "customers/my_customer" AND space_type = "SPACE" AND
(last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time >
"2022-01-01T00:00:00+00:00")

customer = "customers/my_customer" AND space_type = "SPACE" AND
(display_name:"Hello World" OR display_name:"Fun event") AND
(last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time <
"2022-01-01T00:00:00+00:00")

customer = "customers/my_customer" AND space_type = "SPACE" AND
(create_time > "2019-01-01T00:00:00+00:00" AND create_time <
"2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND
(space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")
order_by

string

Optional. How the list of spaces is ordered.

Supported attributes to order by are:

  • membership_count.joined_direct_human_user_count — Denotes the count of human users that have directly joined a space.
  • last_active_time — Denotes the time when last eligible item is added to any topic of this space.
  • create_time — Denotes the time of the space creation.

Valid ordering operation values are:

  • ASC for ascending. Default value.

  • DESC for descending.

The supported syntax are:

  • membership_count.joined_direct_human_user_count DESC
  • membership_count.joined_direct_human_user_count ASC
  • last_active_time DESC
  • last_active_time ASC
  • create_time DESC
  • create_time ASC

SearchSpacesResponse

Response with a list of spaces corresponding to the search spaces request.

Поля
spaces[]

Space

A page of the requested spaces.

next_page_token

string

A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages.

total_size

int32

The total number of spaces that match the query, across all pages. If the result is over 10,000 spaces, this value is an estimate.

SetUpSpaceRequest

Request to create a space and add specified users to it.

Поля
space

Space

Required. The Space.spaceType field is required.

To create a space, set Space.spaceType to SPACE and set Space.displayName . If you receive the error message ALREADY_EXISTS when setting up a space, try a different displayName . An existing space within the Google Workspace organization might already use this display name.

To create a group chat, set Space.spaceType to GROUP_CHAT . Don't set Space.displayName .

To create a 1:1 conversation between humans, set Space.spaceType to DIRECT_MESSAGE and set Space.singleUserBotDm to false . Don't set Space.displayName or Space.spaceDetails .

To create an 1:1 conversation between a human and the calling Chat app, set Space.spaceType to DIRECT_MESSAGE and Space.singleUserBotDm to true . Don't set Space.displayName or Space.spaceDetails .

If a DIRECT_MESSAGE space already exists, that space is returned instead of creating a new space.

request_id

string

Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.

memberships[]

Membership

Optional. The Google Chat users or groups to invite to join the space. Omit the calling user, as they are added automatically.

The set currently allows up to 49 memberships (in addition to the caller).

For human membership, the Membership.member field must contain a user with name populated (format: users/{user} ) and type set to User.Type.HUMAN . You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}. For example, the user.name can be users/example@gmail.com . To invite Gmail users or users from external Google Workspace domains, user's email must be used for {user} .

For Google group membership, the Membership.group_member field must contain a group with name populated (format groups/{group} ). You can only add Google groups when setting Space.spaceType to SPACE .

Optional when setting Space.spaceType to SPACE .

Required when setting Space.spaceType to GROUP_CHAT , along with at least two memberships.

Required when setting Space.spaceType to DIRECT_MESSAGE with a human user, along with exactly one membership.

Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting Space.spaceType to DIRECT_MESSAGE and Space.singleUserBotDm to true ).

SlashCommand

Метаданные о команде слэш в Google Chat.

Поля
command_id

int64

Идентификатор команды слэш.

SlashCommandMetadata

Метаданные аннотаций для команд с косой чертой (/).

Поля
bot

User

Приложение чата, команда которого была вызвана.

type

Type

Тип команды «косая черта».

command_name

string

Имя вызванной слэш-команды.

command_id

int64

Идентификатор вызванной слэш-команды.

triggers_dialog

bool

Указывает, предназначена ли команда с косой чертой для диалога.

Тип

Перечисления
TYPE_UNSPECIFIED Значение по умолчанию для перечисления. Не использовать.
ADD Добавьте приложение «Чат» в пространство.
INVOKE Вызов команды «слэш» в пробеле.

Космос

A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.

Поля
name

string

Identifier. Resource name of the space.

Формат: spaces/{space}

Where {space} represents the system-assigned ID for the space. You can obtain the space ID by calling the spaces.list() method or from the space URL. For example, if the space URL is https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA , the space ID is AAAAAAAAA .

type
(deprecated)

Type

Output only. Deprecated: Use space_type instead. The type of a space.

space_type

SpaceType

Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.

single_user_bot_dm

bool

Optional. Whether the space is a DM between a Chat app and a single human.

threaded
(deprecated)

bool

Output only. Deprecated: Use spaceThreadingState instead. Whether messages are threaded in this space.

display_name

string

Optional. The space's display name. Required when creating a space with a spaceType of SPACE . If you receive the error message ALREADY_EXISTS when creating a space or updating the displayName , try a different displayName . An existing space within the Google Workspace organization might already use this display name.

For direct messages, this field might be empty.

Supports up to 128 characters.

external_user_allowed

bool

Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions:

  • The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user.

For existing spaces, this field is output only.

space_threading_state

SpaceThreadingState

Output only. The threading state in the Chat space.

space_details

SpaceDetails

Optional. Details about the space including description and rules.

space_history_state

HistoryState

Optional. The message history state for messages and threads in this space.

import_mode

bool

Optional. Whether this space is created in Import Mode as part of a data migration into Google Workspace. While spaces are being imported, they aren't visible to users until the import is complete.

Creating a space in Import Mode requires user authentication .

create_time

Timestamp

Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces.

For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time.

Only populated in the output when spaceType is GROUP_CHAT or SPACE .

last_active_time

Timestamp

Output only. Timestamp of the last message in the space.

admin_installed

bool

Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization.

To support admin install, your Chat app must feature direct messaging.

membership_count

MembershipCount

Output only. The count of joined memberships grouped by member type. Populated when the space_type is SPACE , DIRECT_MESSAGE or GROUP_CHAT .

access_settings

AccessSettings

Optional. Specifies the access setting of the space. Only populated when the space_type is SPACE .

space_uri

string

Output only. The URI for a user to access the space.

import_mode_expire_time

Timestamp

Output only. The time when the space will be automatically deleted by the system if it remains in import mode.

Each space created in import mode must exit this mode before this expire time using spaces.completeImport .

This field is only populated for spaces that were created with import mode.

customer

string

Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with app authentication and SpaceType is SPACE , otherwise should not be set.

In the format customers/{customer} , where customer is the id from the Admin SDK customer resource . Private apps can also use the customers/my_customer alias to create the space in the same Google Workspace organization as the app.

For DMs, this field isn't populated.

Union field space_permission_settings . Represents the permission settings of a space. Only populated when the space_type is SPACE . space_permission_settings can be only one of the following:
predefined_permission_settings

PredefinedPermissionSettings

Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the PermissionSettings field.

Setting predefined permission settings supports:

permission_settings

PermissionSettings

Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings.

Reading and updating permission settings supports:

AccessSettings

Represents the access setting of the space.

Поля
access_state

AccessState

Output only. Indicates the access state of the space.

audience

string

Optional. The resource name of the target audience who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see Make a space discoverable to a target audience .

Format: audiences/{audience}

To use the default target audience for the Google Workspace organization, set to audiences/default .

Reading the target audience supports:

This field is not populated when using the chat.bot scope with app authentication .

Setting the target audience requires user authentication .

AccessState

Represents the access state of the space.

Перечисления
ACCESS_STATE_UNSPECIFIED Access state is unknown or not supported in this API.
PRIVATE Only users or Google Groups that have been individually added or invited by other users or Google Workspace administrators can discover and access the space.
DISCOVERABLE

A space manager has granted a target audience access to the space. Users or Google Groups that have been individually added or invited to the space can also discover and access the space. To learn more, see Make a space discoverable to specific users .

Creating discoverable spaces requires user authentication .

MembershipCount

Represents the count of memberships of a space, grouped into categories.

Поля
joined_direct_human_user_count

int32

Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.

joined_group_count

int32

Output only. Count of all groups that have directly joined the space.

PermissionSetting

Represents a space permission setting.

Поля
managers_allowed

bool

Optional. Whether space owners ( ROLE_MANAGER ) have this permission.

members_allowed

bool

Optional. Whether basic space members ( ROLE_MEMBER ) have this permission.

PermissionSettings

Permission settings that you can specify when updating an existing named space.

To set permission settings when creating a space, specify the PredefinedPermissionSettings field in your request.

Поля
manage_members_and_groups

PermissionSetting

Optional. Setting for managing members and groups in a space.

modify_space_details

PermissionSetting

Optional. Setting for updating space name, avatar, description and guidelines.

toggle_history

PermissionSetting

Optional. Setting for toggling space history on and off.

use_at_mention_all

PermissionSetting

Optional. Setting for using @all in a space.

manage_apps

PermissionSetting

Optional. Setting for managing apps in a space.

manage_webhooks

PermissionSetting

Optional. Setting for managing webhooks in a space.

post_messages

PermissionSetting

Output only. Setting for posting messages in a space.

reply_messages

PermissionSetting

Optional. Setting for replying to messages in a space.

PredefinedPermissionSettings

Predefined permission settings that you can only specify when creating a named space. More settings might be added in the future. For details about permission settings for named spaces, see Learn about spaces .

Перечисления
PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED Unspecified. Don't use.
COLLABORATION_SPACE Setting to make the space a collaboration space where all members can post messages.
ANNOUNCEMENT_SPACE Setting to make the space an announcement space where only space managers can post messages.

SpaceDetails

Details about the space including description and rules.

Поля
description

string

Optional. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants.

Supports up to 150 characters.

guidelines

string

Optional. The space's rules, expectations, and etiquette.

Supports up to 5,000 characters.

SpaceThreadingState

Specifies the type of threading state in the Chat space.

Перечисления
SPACE_THREADING_STATE_UNSPECIFIED Сдержанный.
THREADED_MESSAGES Named spaces that support message threads. When users respond to a message, they can reply in-thread, which keeps their response in the context of the original message.
GROUPED_MESSAGES Named spaces where the conversation is organized by topic. Topics and their replies are grouped together.
UNTHREADED_MESSAGES Direct messages (DMs) between two people and group conversations between 3 or more people.

SpaceType

The type of space. Required when creating or updating a space. Output only for other usage.

Перечисления
SPACE_TYPE_UNSPECIFIED Сдержанный.
SPACE A place where people send messages, share files, and collaborate. A SPACE can include Chat apps.
GROUP_CHAT Group conversations between 3 or more people. A GROUP_CHAT can include Chat apps.
DIRECT_MESSAGE 1:1 messages between two humans or a human and a Chat app.

Тип

Deprecated: Use SpaceType instead.

Перечисления
TYPE_UNSPECIFIED Сдержанный.
ROOM Conversations between two or more humans.
DM 1:1 Direct Message between a human and a Chat app, where all messages are flat. Note that this doesn't include direct messages between two humans.

SpaceBatchUpdatedEventData

Event payload for multiple updates to a space.

Event type: google.workspace.chat.space.v1.batchUpdated

Поля
spaces[]

SpaceUpdatedEventData

A list of updated spaces.

SpaceEvent

An event that represents a change or activity in a Google Chat space. To learn more, see Work with events from Google Chat .

Поля
name

string

Resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

event_time

Timestamp

Время, когда произошло событие.

event_type

string

Type of space event. Each event type has a batch version, which represents multiple instances of the event type that occur in a short period of time. For spaceEvents.list() requests, omit batch event types in your query filter. By default, the server returns both event type and its batch version.

Supported event types for messages :

  • New message: google.workspace.chat.message.v1.created
  • Updated message: google.workspace.chat.message.v1.updated
  • Deleted message: google.workspace.chat.message.v1.deleted
  • Multiple new messages: google.workspace.chat.message.v1.batchCreated
  • Multiple updated messages: google.workspace.chat.message.v1.batchUpdated
  • Multiple deleted messages: google.workspace.chat.message.v1.batchDeleted

Supported event types for memberships :

  • New membership: google.workspace.chat.membership.v1.created
  • Updated membership: google.workspace.chat.membership.v1.updated
  • Deleted membership: google.workspace.chat.membership.v1.deleted
  • Multiple new memberships: google.workspace.chat.membership.v1.batchCreated
  • Multiple updated memberships: google.workspace.chat.membership.v1.batchUpdated
  • Multiple deleted memberships: google.workspace.chat.membership.v1.batchDeleted

Supported event types for reactions :

  • New reaction: google.workspace.chat.reaction.v1.created
  • Deleted reaction: google.workspace.chat.reaction.v1.deleted
  • Multiple new reactions: google.workspace.chat.reaction.v1.batchCreated
  • Multiple deleted reactions: google.workspace.chat.reaction.v1.batchDeleted

Supported event types about the space :

  • Updated space: google.workspace.chat.space.v1.updated
  • Multiple space updates: google.workspace.chat.space.v1.batchUpdated

Union field payload .

payload can be only one of the following:

message_created_event_data

MessageCreatedEventData

Event payload for a new message.

Event type: google.workspace.chat.message.v1.created

message_updated_event_data

MessageUpdatedEventData

Event payload for an updated message.

Event type: google.workspace.chat.message.v1.updated

message_deleted_event_data

MessageDeletedEventData

Event payload for a deleted message.

Event type: google.workspace.chat.message.v1.deleted

message_batch_created_event_data

MessageBatchCreatedEventData

Event payload for multiple new messages.

Event type: google.workspace.chat.message.v1.batchCreated

message_batch_updated_event_data

MessageBatchUpdatedEventData

Event payload for multiple updated messages.

Event type: google.workspace.chat.message.v1.batchUpdated

message_batch_deleted_event_data

MessageBatchDeletedEventData

Event payload for multiple deleted messages.

Event type: google.workspace.chat.message.v1.batchDeleted

space_updated_event_data

SpaceUpdatedEventData

Event payload for a space update.

Event type: google.workspace.chat.space.v1.updated

space_batch_updated_event_data

SpaceBatchUpdatedEventData

Event payload for multiple updates to a space.

Event type: google.workspace.chat.space.v1.batchUpdated

membership_created_event_data

MembershipCreatedEventData

Event payload for a new membership.

Event type: google.workspace.chat.membership.v1.created

membership_updated_event_data

MembershipUpdatedEventData

Event payload for an updated membership.

Event type: google.workspace.chat.membership.v1.updated

membership_deleted_event_data

MembershipDeletedEventData

Event payload for a deleted membership.

Event type: google.workspace.chat.membership.v1.deleted

membership_batch_created_event_data

MembershipBatchCreatedEventData

Event payload for multiple new memberships.

Event type: google.workspace.chat.membership.v1.batchCreated

membership_batch_updated_event_data

MembershipBatchUpdatedEventData

Event payload for multiple updated memberships.

Event type: google.workspace.chat.membership.v1.batchUpdated

membership_batch_deleted_event_data

MembershipBatchDeletedEventData

Event payload for multiple deleted memberships.

Event type: google.workspace.chat.membership.v1.batchDeleted

reaction_created_event_data

ReactionCreatedEventData

Event payload for a new reaction.

Event type: google.workspace.chat.reaction.v1.created

reaction_deleted_event_data

ReactionDeletedEventData

Event payload for a deleted reaction.

Event type: google.workspace.chat.reaction.v1.deleted

reaction_batch_created_event_data

ReactionBatchCreatedEventData

Event payload for multiple new reactions.

Event type: google.workspace.chat.reaction.v1.batchCreated

reaction_batch_deleted_event_data

ReactionBatchDeletedEventData

Event payload for multiple deleted reactions.

Event type: google.workspace.chat.reaction.v1.batchDeleted

SpaceNotificationSetting

The notification setting of a user in a space.

Поля
name

string

Identifier. The resource name of the space notification setting. Format: users/{user}/spaces/{space}/spaceNotificationSetting .

notification_setting

NotificationSetting

The notification setting.

mute_setting

MuteSetting

The space notification mute setting.

MuteSetting

The space notification mute setting types.

Перечисления
MUTE_SETTING_UNSPECIFIED Сдержанный.
UNMUTED The user will receive notifications for the space based on the notification setting.
MUTED The user will not receive any notifications for the space, regardless of the notification setting.

NotificationSetting

The notification setting types. Other types might be supported in the future.

Перечисления
NOTIFICATION_SETTING_UNSPECIFIED Сдержанный.
ALL Notifications are triggered by @mentions, followed threads, first message of new threads. All new threads are automatically followed, unless manually unfollowed by the user.
MAIN_CONVERSATIONS The notification is triggered by @mentions, followed threads, first message of new threads. Not available for 1:1 direct messages.
FOR_YOU The notification is triggered by @mentions, followed threads. Not available for 1:1 direct messages.
OFF Notification is off.

SpaceReadState

A user's read state within a space, used to identify read and unread messages.

Поля
name

string

Resource name of the space read state.

Format: users/{user}/spaces/{space}/spaceReadState

last_read_time

Timestamp

Optional. The time when the user's space read state was updated. Usually this corresponds with either the timestamp of the last read message, or a timestamp specified by the user to mark the last read position in a space.

SpaceUpdatedEventData

Event payload for an updated space.

Event type: google.workspace.chat.space.v1.updated

Поля
space

Space

The updated space.

Нить

Ветка в чате Google. Пример использования см. в разделе «Начать ветку сообщений или ответить на неё» .

Если вы указываете ветку при создании сообщения, вы можете установить поле messageReplyOption , чтобы определить, что произойдет, если соответствующая ветка не будет найдена.

Поля
name

string

Идентификатор. Имя ресурса потока.

Пример: spaces/{space}/threads/{thread}

thread_key

string

Необязательно. Ввод для создания или обновления потока. В противном случае только вывод. Идентификатор потока. Поддерживает до 4000 символов.

Этот идентификатор уникален для приложения Chat, которое его задаёт. Например, если несколько приложений Chat создают сообщение с одним и тем же ключом ветки, сообщения публикуются в разных ветках. Чтобы ответить в ветке, созданной пользователем или другим приложением Chat, укажите вместо этого поле name ветки.

ThreadReadState

A user's read state within a thread, used to identify read and unread messages.

Поля
name

string

Resource name of the thread read state.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

last_read_time

Timestamp

The time when the user's thread read state was updated. Usually this corresponds with the timestamp of the last read message in a thread.

UpdateMembershipRequest

Request message for updating a membership.

Поля
membership

Membership

Required. The membership to update. Only fields specified by update_mask are updated.

update_mask

FieldMask

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

  • role
use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.memberships OAuth 2.0 scope .

UpdateMessageRequest

Request to update a message.

Поля
message

Message

Required. Message with fields updated.

update_mask

FieldMask

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

allow_missing

bool

Optional. If true and the message isn't found, a new message is created and updateMask is ignored. The specified message ID must be client-assigned or the request fails.

UpdateSpaceNotificationSettingRequest

Request to update the space notification settings. Only supports updating notification setting for the calling user.

Поля
space_notification_setting

SpaceNotificationSetting

Required. The resource name for the space notification settings must be populated in the form of users/{user}/spaces/{space}/spaceNotificationSetting . Only fields specified by update_mask are updated.

update_mask

FieldMask

Required. Supported field paths:

  • notification_setting

  • mute_setting

UpdateSpaceReadStateRequest

Request message for UpdateSpaceReadState API.

Поля
space_read_state

SpaceReadState

Required. The space read state and fields to update.

Only supports updating read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState .

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState .

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState .

Format: users/{user}/spaces/{space}/spaceReadState

update_mask

FieldMask

Required. The field paths to update. Currently supported field paths:

  • last_read_time

When the last_read_time is before the latest message create time, the space appears as unread in the UI.

To mark the space as read, set last_read_time to any value later (larger) than the latest message create time. The last_read_time is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.

UpdateSpaceRequest

A request to update a single space.

Поля
space

Space

Required. Space with fields to be updated. Space.name must be populated in the form of spaces/{space} . Only fields specified by update_mask are updated.

update_mask

FieldMask

Required. The updated field paths, comma separated if there are multiple.

You can update the following fields for a space:

space_details : Updates the space's description. Supports up to 150 characters.

display_name : Only supports updating the display name for spaces where spaceType field is SPACE . If you receive the error message ALREADY_EXISTS , try a different value. An existing space within the Google Workspace organization might already use this display name.

space_type : Only supports changing a GROUP_CHAT space type to SPACE . Include display_name together with space_type in the update mask and ensure that the specified space has a non-empty display name and the SPACE space type. Including the space_type mask and the SPACE type in the specified space when updating the display name is optional if the existing space already has the SPACE type. Trying to update the space type in other ways results in an invalid argument error. space_type is not supported with useAdminAccess .

space_history_state : Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. space_history_state is not supported with useAdminAccess .

access_settings.audience : Updates the access setting of who can discover the space, join the space, and preview the messages in named space where spaceType field is SPACE . If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode . To learn more, see Make a space discoverable to specific users . access_settings.audience is not supported with useAdminAccess .

permission_settings : Supports changing the permission settings of a space. When updating permission settings, you can only specify permissionSettings field masks; you cannot update other field masks at the same time. permissionSettings is not supported with useAdminAccess . The supported field masks include:

  • permission_settings.manageMembersAndGroups
  • permission_settings.modifySpaceDetails
  • permission_settings.toggleHistory
  • permission_settings.useAtMentionAll
  • permission_settings.manageApps
  • permission_settings.manageWebhooks
  • permission_settings.replyMessages
use_admin_access

bool

Optional. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.spaces OAuth 2.0 scope .

Some FieldMask values are not supported using admin access. For details, see the description of update_mask .

Пользователь

A user in Google Chat. When returned as an output from a request, if your Chat app authenticates as a user , the output for a User resource only populates the user's name and type .

Поля
name

string

Resource name for a Google Chat user .

Format: users/{user} . users/app can be used as an alias for the calling app bot user.

For human users , {user} is the same user identifier as:

  • the id for the Person in the People API. For example, users/123456789 in Chat API represents the same person as the 123456789 Person profile ID in People API.

  • the id for a user in the Admin SDK Directory API.

  • the user's email address can be used as an alias for {user} in API requests. For example, if the People API Person profile ID for user@example.com is 123456789 , you can use users/user@example.com as an alias to reference users/123456789 . Only the canonical resource name (for example users/123456789 ) will be returned from the API.

display_name

string

Output only. The user's display name.

domain_id

string

Unique identifier of the user's Google Workspace domain.

type

Type

User type.

is_anonymous

bool

Output only. When true , the user is deleted or their profile is not visible.

Тип

Перечисления
TYPE_UNSPECIFIED Default value for the enum. DO NOT USE.
HUMAN Human user.
BOT Chat app user.

UserMentionMetadata

Метаданные аннотаций для упоминаний пользователей (@).

Поля
user

User

Пользователь упомянул.

type

Type

Тип упоминания пользователя.

Тип

Перечисления
TYPE_UNSPECIFIED Значение по умолчанию для перечисления. Не использовать.
ADD Добавить пользователя в пространство.
MENTION Упомяните пользователя в пробеле.

WidgetMarkup

A widget is a UI element that presents text and images.

Поля
buttons[]

Button

A list of buttons. Buttons is also oneof data and only one of these fields should be set.

Union field data . A WidgetMarkup can only have one of the following items. You can use multiple WidgetMarkup fields to display more items. data can be only one of the following:
text_paragraph

TextParagraph

Display a text paragraph in this widget.

image

Image

Display an image in this widget.

key_value

KeyValue

Display a key value item in this widget.

Кнопка

A button. Can be a text button or an image button.

Поля

Union field type .

type can be only one of the following:

text_button

TextButton

A button with text and onclick action.

image_button

ImageButton

A button with image and onclick action.

FormAction

A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form.

Поля
action_method_name

string

The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. You can use the same method name for several elements that trigger a common behavior.

parameters[]

ActionParameter

List of action parameters.

ПараметрДействия

List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, snooze next week. You might use action method = snooze() , passing the snooze type and snooze time in the list of string parameters.

Поля
key

string

The name of the parameter for the action script.

value

string

The value of the parameter.

Икона

The set of supported icons.

Перечисления
ICON_UNSPECIFIED
AIRPLANE
BOOKMARK
BUS
CAR
CLOCK
CONFIRMATION_NUMBER_ICON
DOLLAR
DESCRIPTION
EMAIL
EVENT_PERFORMER
EVENT_SEAT
FLIGHT_ARRIVAL
FLIGHT_DEPARTURE
HOTEL
HOTEL_ROOM_TYPE
INVITE
MAP_PIN
MEMBERSHIP
MULTIPLE_PEOPLE
OFFER
PERSON
PHONE
RESTAURANT_ICON
SHOPPING_CART
STAR
STORE
TICKET
TRAIN
VIDEO_CAMERA
VIDEO_PLAY

Изображение

An image that's specified by a URL and can have an onclick action.

Поля
image_url

string

URL-адрес изображения.

on_click

OnClick

The onclick action.

aspect_ratio

double

The aspect ratio of this image (width and height). This field lets you reserve the right height for the image while waiting for it to load. It's not meant to override the built-in aspect ratio of the image. If unset, the server fills it by prefetching the image.

ImageButton

An image button with an onclick action.

Поля
on_click

OnClick

The onclick action.

name

string

The name of this image_button that's used for accessibility. Default value is provided if this name isn't specified.

Union field icons . The icon can be specified by an Icon enum or a URL. icons can be only one of the following:
icon

Icon

The icon specified by an enum that indices to an icon provided by Chat API.

icon_url

string

The icon specified by a URL.

Ключ-значение

A UI element contains a key (label) and a value (content). This element can also contain some actions such as onclick button.

Поля
top_label

string

The text of the top label. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

content

string

The text of the content. Formatted text supported and always required. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

content_multiline

bool

If the content should be multiline.

bottom_label

string

The text of the bottom label. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

on_click

OnClick

The onclick action. Only the top label, bottom label, and content region are clickable.

Union field icons . At least one of icons, top_label and bottom_label must be defined. icons can be only one of the following:
icon

Icon

An enum value that's replaced by the Chat API with the corresponding icon image.

icon_url

string

The icon specified by a URL.

Union field control . A control widget. You can set either button or switch_widget , but not both. control can be only one of the following:
button

Button

A button that can be clicked to trigger an action.

OnClick

An onclick action (for example, open a link).

Поля

Union field data .

data can be only one of the following:

action

FormAction

A form action is triggered by this onclick action if specified.

Текстовая кнопка

A button with text and onclick action.

Поля
text

string

The text of the button.

on_click

OnClick

The onclick action of the button.

Текстовый абзац

A paragraph of text. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

Поля
text

string