Podczas uwierzytelniania jako aplikacja musisz ustawić w żądaniu pole space.customer.
Uprawnienia do pokoju po utworzeniu zależą od tego, czy pokój został utworzony w Import mode:
Tryb importowania: nie są tworzeni nowi członkowie.
Wszystkie inne tryby: użytkownik dzwoniący jest dodawany jako członek. Oto one:
sama aplikacja, jeśli używasz uwierzytelniania aplikacji;
Użytkownik (człowiek) podczas uwierzytelniania użytkownika.
Jeśli podczas tworzenia pokoju pojawi się komunikat o błędzie ALREADY_EXISTS, spróbuj użyć innego displayName. Ta wyświetlana nazwa może być już używana w przypadku istniejącego pokoju w organizacji Google Workspace.
Opcjonalnie: Unikalny identyfikator tego żądania. Zalecamy losowy identyfikator UUID. Podanie identyfikatora istniejącej prośby spowoduje zwrócenie pokoju utworzonego z tym identyfikatorem, a nie utworzenie nowego pokoju. Podanie istniejącego identyfikatora prośby z tej samej aplikacji Google Chat, ale z innym uwierzytelnionym użytkownikiem spowoduje błąd.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2024-12-02 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"]]