Method: spaces.create
スペースを作成します。名前付きスペースや Import mode
のグループ チャットを作成するために使用できます。例については、スペースを作成するをご覧ください。
次のタイプの認証をサポートしています。
アプリとして認証する場合は、リクエストで space.customer
フィールドを設定する必要があります。
作成時のスペースの参加資格は、スペースが Import mode
で作成されたかどうかによって異なります。
- インポート モード: メンバーは作成されません。
- その他のすべてのモード: 呼び出し元のユーザーがメンバーとして追加されます。以下に例を示します。
- アプリ認証を使用している場合、アプリ自体。
- ユーザー認証を使用している場合は、人間のユーザー。
スペースの作成時にエラー メッセージ ALREADY_EXISTS
が表示された場合は、別の displayName
を試してください。Google Workspace 組織内の既存のスペースで、この表示名がすでに使用されている可能性があります。
HTTP リクエスト
POST https://chat.googleapis.com/v1/spaces
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
パラメータ |
requestId |
string
省略可。このリクエストの一意の識別子。ランダムな UUID を使用することをおすすめします。既存のリクエスト ID を指定すると、新しいスペースが作成されるのではなく、その ID で作成されたスペースが返されます。同じ Chat アプリの既存のリクエスト ID を指定して、認証済みのユーザーが異なると、エラーが返されます。
|
リクエストの本文
リクエストの本文には Space
のインスタンスが含まれます。
レスポンスの本文
成功した場合、レスポンスの本文には、新しく作成された Space
のインスタンスが含まれます。
認可スコープ
以下のいずれかの OAuth スコープが必要です。
https://www.googleapis.com/auth/chat.app.spaces.create
https://www.googleapis.com/auth/chat.app.spaces
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.create
詳しくは、認可ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-27 UTC。
[null,null,["最終更新日 2025-02-27 UTC。"],[[["Creates a space in Google Chat, which can be a named space or a group chat, supporting app and user authentication."],["When using app authentication, the space.customer field is required and no members are added in Import mode; otherwise, the calling user becomes a member."],["Uses the `POST https://chat.googleapis.com/v1/spaces` HTTP request to create a space and requires specific OAuth scopes for authorization."],["The request body should contain a Space object and the response, if successful, will contain the newly created Space object."],["If the displayName already exists, an `ALREADY_EXISTS` error will be returned, suggesting to try a different displayName."]]],["This content outlines how to create a space using the Chat API. Key actions include sending a `POST` request to `https://chat.googleapis.com/v1/spaces`. The request may include a unique `requestId` and must contain a `Space` instance in the body. Authentication can be app-based or user-based, requiring specific OAuth scopes. Space membership varies by import mode; no members in import mode, otherwise the caller is added. Response will contain new space information.\n"]]