Method: subscriptions.list

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

HTTP 要求

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

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

查詢參數

參數
pageSize

integer

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

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

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

pageToken

string

(選用步驟) 這是從先前的 list subscriptions 呼叫收到的頁面權杖。提供此參數即可擷取後續網頁。

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

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
  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.metadata
  • https://www.googleapis.com/auth/drive.metadata.readonly
  • https://www.googleapis.com/auth/drive.readonly

詳情請參閱授權指南