Khi xác thực dưới dạng ứng dụng, bạn phải đặt trường space.customer trong yêu cầu.
Quyền thành viên của không gian khi tạo phụ thuộc vào việc không gian được tạo trong Import mode hay không:
Chế độ nhập: Không tạo thành viên nào.
Tất cả chế độ khác: Người dùng gọi được thêm làm thành viên. Đó là:
Chính ứng dụng khi sử dụng tính năng xác thực ứng dụng.
Người dùng khi sử dụng phương thức xác thực người dùng.
Nếu bạn nhận được thông báo lỗi ALREADY_EXISTS khi tạo không gian, hãy thử một displayName khác. Một không gian hiện có trong tổ chức Google Workspace có thể đã sử dụng tên hiển thị này.
Không bắt buộc. Giá trị nhận dạng duy nhất cho yêu cầu này. Bạn nên dùng UUID ngẫu nhiên. Việc chỉ định mã yêu cầu hiện có sẽ trả về không gian được tạo bằng mã đó thay vì tạo không gian mới. Việc chỉ định mã yêu cầu hiện có từ cùng một ứng dụng Chat với một người dùng đã xác thực khác sẽ trả về lỗi.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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"]]