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