Google Workspace サブスクリプションを作成します。このメソッドの使用方法については、Google Workspace サブスクリプションを作成するをご覧ください。
Chat ターゲット リソースのサブスクリプションの場合、次のようにサブスクリプションを作成できます。
Chat アプリがスペース イベントをサブスクライブする。このアプリは、
chat.appで始まる認可スコープを指定し、管理者の 1 回限りの承認を得ることで、メンバーになります。詳しくは、管理者の承認を得て Chat アプリとして認可するをご覧ください。デベロッパー プレビュー: Chat アプリが Google Workspace 組織内のすべてのイベントをサブスクライブする。このアプリは、
chat.app.allで始まる認可スコープを指定し、管理者の 1 回限りの承認を得ることで、メンバーになります。詳しくは、Workspace 組織内のすべての Google Chat イベントをサブスクライブする をご覧ください。ユーザーが、名前に
appを含まない認可スコープを指定する。詳しくは、Chat ユーザーとして認可するをご覧ください。
HTTP リクエスト
POST https://workspaceevents.googleapis.com/v1beta/subscriptions
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
| パラメータ | |
|---|---|
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.memberships.readonlyhttps://www.googleapis.com/auth/chat.app.all.memberships.readonlyhttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.all.messages.readonlyhttps://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.spaces.readonlyhttps://www.googleapis.com/auth/chat.app.all.spaces.readonlyhttps://www.googleapis.com/auth/chat.app.all.users.readstate.readonlyhttps://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
詳細については、認可ガイドをご覧ください。