Method: spaces.spaceEvents.get

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

注意:对于此请求,空间事件数据的空间对象中不会返回 permissionSettings 字段。

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

  • 开发者预览版中,通过管理员批准进行应用身份验证,并使用以下授权范围之一:

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

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.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

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