Method: spaces.spaceEvents.list
Google Chat スペースのイベントを一覧表示します。イベントごとに、ペイロードには最新バージョンの Chat リソースが含まれます。たとえば、スペースの新しいメンバーに関するイベントを一覧表示すると、サーバーは最新のメンバーシップ情報を含む Membership
リソースを返します。リクエストされた期間中に新規メンバーが削除された場合、イベント ペイロードには空の Membership
リソースが含まれます。
ユーザー認証が必要です。イベントを一覧表示するには、認証済みのユーザーがスペースのメンバーである必要があります。
例については、Google Chat スペースのイベントを一覧表示するをご覧ください。
HTTP リクエスト
GET https://chat.googleapis.com/v1/{parent=spaces/*}/spaceEvents
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
parent |
string
必須。イベントが発生した Google Chat スペースのリソース名。 形式: spaces/{space} 。
|
クエリ パラメータ
パラメータ |
pageSize |
integer
省略可。返される空間イベントの最大数。サービスが返す値はこれよりも少ないことがあります。 負の値を指定すると、INVALID_ARGUMENT エラーが返されます。
|
pageToken |
string
省略可。前回の list space events 呼び出しから受け取ったページトークン。後続のページを取得するにはこれを指定します。 ページネーションを行う場合、list space events に指定する他のすべてのパラメータは、ページトークンを受け取った呼び出しと一致している必要があります。他のパラメータに異なる値を渡すと、予期しない結果になる可能性があります。
|
filter |
string
必須。クエリフィルタ。 has : 演算子を使用して、イベントタイプを少なくとも 1 つ(eventType )指定する必要があります。複数のイベントタイプでフィルタするには、OR 演算子を使用します。フィルタでバッチ イベントタイプを省略します。リクエストは、関連するバッチイベントを自動的に返します。たとえば、新しいリアクション(google.workspace.chat.reaction.v1.created )でフィルタすると、サーバーはバッチ新規リアクション イベント(google.workspace.chat.reaction.v1.batchCreated )も返します。サポートされているイベントタイプの一覧については、SpaceEvents リファレンス ドキュメントをご覧ください。 必要に応じて、開始時間(startTime )と終了時間(endTime )でフィルタすることもできます。
startTime : スペース イベントの一覧表示を開始する排他的なタイムスタンプ。最大 28 日前に発生したイベントを一覧表示できます。指定しない場合、過去 28 日間のスペース イベントが一覧表示されます。
endTime : スペース イベントが表示されるタイムスタンプ(終了日時を含む)。指定しない場合、リクエスト時点までのイベントが一覧表示されます。
開始時間または終了時間を指定するには、等式 = 演算子を使用し、RFC-3339 の形式を使用します。startTime と endTime の両方でフィルタするには、AND 演算子を使用します。 たとえば、次のクエリは有効です。
startTime="2023-08-23T19:20:33+00:00" AND
endTime="2023-08-23T19:21:54+00:00"
startTime="2023-08-23T19:20:33+00:00" AND
(eventTypes:"google.workspace.chat.space.v1.updated" OR
eventTypes:"google.workspace.chat.message.v1.created")
次のクエリは無効です。
startTime="2023-08-23T19:20:33+00:00" OR
endTime="2023-08-23T19:21:54+00:00"
eventTypes:"google.workspace.chat.space.v1.updated" AND
eventTypes:"google.workspace.chat.message.v1.created"
無効なクエリは、INVALID_ARGUMENT エラーでサーバーが拒否します。
|
リクエスト本文
リクエストの本文は空にする必要があります。
レスポンスの本文
スペース イベントの一覧表示に対するレスポンス メッセージ。
成功した場合、レスポンスの本文には次の構造のデータが含まれます。
JSON 表現 |
{
"spaceEvents": [
{
object (SpaceEvent )
}
],
"nextPageToken": string
} |
フィールド |
spaceEvents[] |
object (SpaceEvent )
結果は時系列順(古いイベントから順に)で返されます。注: リスト リクエストの Space オブジェクトには permissionSettings フィールドが返されません。
|
nextPageToken |
string
追加のイベントの取得に使用される連続トークン。このフィールドを省略すると、後続のページはなくなります。
|
認可スコープ
次の OAuth スコープのいずれかが必要です。
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
詳しくは、認可ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-08 UTC。
[null,null,["最終更新日 2024-11-08 UTC。"],[[["Lists events from a specified Google Chat space, including new members, messages, and reactions, with the payload containing the most recent version of the resource."],["Requires user authentication and membership in the space to list events, returning data chronologically with optional pagination."],["Allows filtering by event types, start time, and end time to refine the results of the listed events."],["The response includes an array of space events and a token for retrieving subsequent pages if available."],["Needs specific authorization scopes for accessing and retrieving the chat space data."]]],["This documentation outlines how to list events from a Google Chat space using the `GET` method. Key actions include: specifying the space via the `parent` path parameter, filtering events by type and time using the `filter` query parameter, and setting the number of events returned with `pageSize`. `pageToken` is used for pagination. Authentication requires user membership in the space and specific OAuth scopes. The response body includes a list of `spaceEvents` and a `nextPageToken` for further results.\n"]]