Method: subscriptions.list

列出 Google Workspace 訂閱方案。如要瞭解如何使用這個方法,請參閱「列出 Google Workspace 訂閱方案」。

HTTP 要求

GET https://workspaceevents.googleapis.com/v1/subscriptions

這個網址使用 gRPC 轉碼語法。

查詢參數

參數
pageSize

integer

選用設定。要傳回的訂閱項目數量上限。服務傳回的產品數量可能會少於這個值。

如果未指定或設為 0,最多會傳回 50 個訂閱項目。

最大值是 100。如果您指定的值超過 100,系統只會傳回 100 個訂閱項目。

pageToken

string

選用設定。接收自先前清單訂閱呼叫的網頁權杖。提供這個參數即可擷取後續網頁。

進行分頁時,篩選器值應與提供網頁權杖的呼叫相符。傳送不同的值可能會導致非預期的結果。

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 錯誤的無效查詢。

要求主體

要求主體必須為空白。

回應主體

SubscriptionsService.ListSubscriptions 的回應訊息。

如果成功,回應主體即會包含具有以下結構的資料:

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

詳情請參閱授權指南