Method: spaces.spaceEvents.get

返回 Google Chat 聊天室中的事件。事件载荷包含已更改资源的最新版本。例如,如果您请求有关新消息的事件,但该消息后来已更新,则服务器会在事件载荷中返回更新后的 Message 资源。

注意:对于此请求,permissionSettings 字段不会在聊天室事件数据的 Space 对象中返回。

支持以下类型的 身份验证,并使用适合读取所请求数据的 授权范围

  • 应用身份验证(需获得管理员批准),并使用以下授权范围之一:

    • https://www.googleapis.com/auth/chat.app.spaces
    • https://www.googleapis.com/auth/chat.app.spaces.readonly
    • https://www.googleapis.com/auth/chat.app.messages.readonly
    • https://www.googleapis.com/auth/chat.app.memberships
    • https://www.googleapis.com/auth/chat.app.memberships.readonly
  • 用户身份验证,并使用以下授权范围之一:

    • 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 聊天室中事件的详细信息

HTTP 请求

GET https://chat.googleapis.com/v1/{name=spaces/*/spaceEvents/*}

网址采用 gRPC 转码语法。

路径参数

参数
name

string

必需。聊天室事件的资源名称。

格式:spaces/{space}/spaceEvents/{spaceEvent}

请求正文

请求正文必须为空。

响应正文

如果成功,则响应正文包含一个 SpaceEvent 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.app.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.messages.readonly
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.app.spaces.readonly
  • 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

如需了解详情,请参阅授权指南