列出 Google Chat 聊天室中的事件。对于每个事件,载荷都包含最新版本的 Chat 资源。例如,如果您列出有关新聊天室成员的事件,服务器会返回包含最新成员资格详细信息的 Membership 资源。如果在请求的时间段内移除了新成员,事件载荷将包含一个空的 Membership 资源。
支持以下类型的 身份验证,并使用适合读取所请求数据的 授权范围:
-
https://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.spaces.readonlyhttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.membershipshttps://www.googleapis.com/auth/chat.app.memberships.readonly
用户身份验证,并使用以下授权范围之一:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships
如需列出事件,经过身份验证的调用方必须是聊天室的成员。
如需查看示例,请参阅列出 Google Chat 聊天室中的事件。
HTTP 请求
GET https://chat.googleapis.com/v1/{parent=spaces/*}/spaceEvents
网址采用 gRPC 转码语法。
路径参数
| 参数 | |
|---|---|
parent |
必需。发生事件的 Google Chat 聊天室 的资源名称。 格式: |
查询参数
| 参数 | |
|---|---|
pageSize |
可选。返回的聊天室事件数量上限。服务可能会返回小于此值的结果。 负值会返回 |
pageToken |
可选。从之前的列出聊天室事件调用收到的页面令牌。利用其进行后续页面检索。 进行分页时,提供给列出聊天室事件的所有其他参数都必须与提供页面令牌的调用一致。向其他参数传递不同的值可能会导致意外结果。 |
filter |
必需。查询过滤条件。 您必须使用 has 您还可以选择按开始时间 (
如需指定开始时间或结束时间,请使用等于 例如,以下查询是有效的: 以下查询无效: 服务器会拒绝无效查询,并返回 |
请求正文
请求正文必须为空。
响应正文
用于列出聊天室事件的响应消息。
如果成功,响应正文将包含结构如下的数据:
| JSON 表示法 |
|---|
{
"spaceEvents": [
{
object ( |
| 字段 | |
|---|---|
spaceEvents[] |
结果按时间顺序返回(最旧的事件在前)。注意:对于列表请求,系统不会在 Space 对象中返回 |
nextPageToken |
用于提取更多事件的连续令牌。如果省略此字段,则不存在后续页面。 |
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/chat.app.membershipshttps://www.googleapis.com/auth/chat.app.memberships.readonlyhttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.messages.reactions.readonly
如需了解详情,请参阅授权指南。