Method: subscriptions.list
HTTP 要求
GET https://workspaceevents.googleapis.com/v1/subscriptions
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
pageSize |
integer
選用設定。要傳回的訂閱數量上限。服務傳回的產品數量可能會少於這個值。 如果未指定或設為 0 ,最多會傳回 50 個訂閱項目。 值的上限為 100。如果指定的值超過 100,系統則只會傳回 100 個訂閱項目。
|
pageToken |
string
選用設定。屬於來自先前 list 訂閱呼叫的頁面權杖。提供這個參數即可擷取後續網頁。 進行分頁時,篩選器值應與提供網頁權杖的呼叫相符。如果傳送不同的值,可能會導致非預期的結果。
|
filter |
string
必要欄位。查詢篩選器。 您可以依事件類型 (event_types ) 和目標資源 (target_resource ) 篩選訂閱項目。 你必須在查詢中指定至少一個事件類型。如要篩選多個事件類型,請使用 OR 運算子。 如要同時依事件類型和目標資源進行篩選,請使用 AND 運算子並指定完整的資源名稱,例如 //chat.googleapis.com/spaces/{space} 。 舉例來說,以下查詢是有效的查詢:
event_types:"google.workspace.chat.membership.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created"
event_types:"google.workspace.chat.message.v1.created" AND
target_resource="//chat.googleapis.com/spaces/{space}"
( event_types:"google.workspace.chat.membership.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created" ) AND
target_resource="//chat.googleapis.com/spaces/{space}"
伺服器會拒絕無效的查詢,並顯示 INVALID_ARGUMENT 錯誤。
|
回應主體
JSON 表示法 |
{
"subscriptions": [
{
object (Subscription )
}
],
"nextPageToken": string
} |
欄位 |
subscriptions[] |
object (Subscription )
訂閱項目清單。
|
nextPageToken |
string
可做為 pageToken 傳送的權杖,用於擷取後續網頁。如果省略這個欄位,就不會有後續頁面。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/chat.bot
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.messages.reactions
https://www.googleapis.com/auth/chat.messages.reactions.readonly
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.memberships.readonly
https://www.googleapis.com/auth/meetings.space.created
https://www.googleapis.com/auth/meetings.space.readonly
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-22 (世界標準時間)。
[null,null,["上次更新時間:2024-08-22 (世界標準時間)。"],[[["Lists existing Google Workspace subscriptions, allowing retrieval of details like event types and target resources."],["Enables filtering of subscriptions by event types and target resource using query parameters, requiring at least one event type for filtering."],["Uses pagination to retrieve large lists of subscriptions, providing a `nextPageToken` for accessing subsequent pages."],["Requires specific OAuth scopes for authorization, such as `https://www.googleapis.com/auth/chat.bot` or `https://www.googleapis.com/auth/chat.spaces`, to access and manage subscriptions."],["Returns a response body containing a list of subscriptions and a token for pagination if further pages exist."]]],["This document outlines how to list Google Workspace subscriptions using a `GET` request to `https://workspaceevents.googleapis.com/v1/subscriptions`. Key parameters include `pageSize` (max 100) to limit results, `pageToken` for pagination, and a mandatory `filter` to specify event types and/or target resources using `OR` and `AND` operators. The request body is empty. The response body contains a list of `subscriptions` and an optional `nextPageToken` for subsequent pages. Specific OAuth scopes are required for authorization.\n"]]