建立 Google Workspace 訂閱方案。如要瞭解如何使用這個方法,請參閱「建立 Google Workspace 訂閱方案」。
如要訂閱 Chat 目標資源,可以建立如下的訂閱項目:
指定以
chat.app開頭的授權範圍,並取得一次性管理員核准 (開發人員搶先體驗版)。詳情請參閱「透過管理員核准,以 Chat 應用程式身分授權」。使用者,方法是指定授權範圍,但名稱中不含
app。詳情請參閱「以 Chat 使用者身分授權」。
HTTP 要求
POST https://workspaceevents.googleapis.com/v1beta/subscriptions
這個網址使用 gRPC 轉碼語法。
查詢參數
| 參數 | |
|---|---|
validateOnly |
(選用步驟) 如果設為 |
要求主體
要求主體包含 Subscription 的例項。
回應主體
如果成功,回應主體會包含新建立的 Operation 例項。
metadata欄位包含空白陣列。response欄位包含新的Subscription執行個體。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.app.membershipshttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/meetings.space.createdhttps://www.googleapis.com/auth/meetings.space.readonlyhttps://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.metadatahttps://www.googleapis.com/auth/drive.metadata.readonlyhttps://www.googleapis.com/auth/drive.readonly
詳情請參閱授權指南。