Method: spaces.get
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回聊天室的詳細資料。如需範例說明,請參閱「取得聊天室詳細資料」。
支援下列類型的驗證:
使用下列其中一個授權範圍進行應用程式驗證:
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.app.spaces
(需要管理員核准)
使用下列其中一個授權範圍進行使用者驗證:
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.spaces
- 當管理員帳戶進行驗證、
useAdminAccess
為 true
,且使用下列其中一個授權範圍時,使用者驗證會授予管理員權限:
https://www.googleapis.com/auth/chat.admin.spaces.readonly
https://www.googleapis.com/auth/chat.admin.spaces
應用程式驗證有下列限制:
- 只有在使用
chat.app.spaces
範圍時,才會填入 space.access_settings
。
- 只有在使用
chat.app.spaces
範圍時,才會為 space.predefind_permission_settings
和 space.permission_settings
填入資料,且僅限應用程式建立的聊天室。
HTTP 要求
GET https://chat.googleapis.com/v1/{name=spaces/*}
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
name |
string
必要欄位。聊天室的資源名稱,格式為 spaces/{space} 。 格式:spaces/{space}
|
查詢參數
參數 |
useAdminAccess |
boolean
(非必要) 當 true 時,方法會使用使用者的 Google Workspace 管理員權限執行。 撥打的使用者必須是具備「管理即時通訊和聊天室對話」權限的 Google Workspace 管理員。 需要 chat.admin.spaces 或 chat.admin.spaces.readonly OAuth 2.0 範圍。
|
回應主體
如果成功,回應主體會包含 Space
的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/chat.admin.spaces
https://www.googleapis.com/auth/chat.admin.spaces.readonly
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.app.spaces
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eReturns detailed information about a Google Chat space, including its properties and settings.\u003c/p\u003e\n"],["\u003cp\u003eRequires a specific HTTP request structure using the space's resource name as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eOffers optional use of administrator privileges via a query parameter for authorized users.\u003c/p\u003e\n"],["\u003cp\u003eSupports various authentication methods, including app and user authentication with specific OAuth scopes for authorization.\u003c/p\u003e\n"],["\u003cp\u003eProvides a comprehensive response containing details about the space upon successful execution.\u003c/p\u003e\n"]]],["This describes retrieving details about a space using a `GET` request to `https://chat.googleapis.com/v1/{name=spaces/*}`. The space's resource name is a required path parameter. Optional `useAdminAccess` query parameter allows execution with admin privileges. The request body is empty. A successful response returns a Space object. Authentication requires specific OAuth scopes, and it supports both App and User authentication, including admin access. The request also contains an ability to test the request directly.\n"],null,["# Method: spaces.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces).\n\nSupports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):\n\n- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.bot`\n - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator approval](https://support.google.com/a?p=chat-app-auth)\n- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.spaces.readonly`\n - `https://www.googleapis.com/auth/chat.spaces`\n - User authentication grants administrator privileges when an administrator account authenticates, `useAdminAccess` is `true`, and one of the following authorization scopes is used:\n - `https://www.googleapis.com/auth/chat.admin.spaces.readonly`\n - `https://www.googleapis.com/auth/chat.admin.spaces`\n\nApp authentication has the following limitations:\n\n- `space.access_settings` is only populated when using the `chat.app.spaces` scope.\n- `space.predefind_permission_settings` and `space.permission_settings` are only populated when using the `chat.app.spaces` scope, and only for spaces the app created.\n\n### HTTP request\n\n`GET https://chat.googleapis.com/v1/{name=spaces/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name of the space, in the form `spaces/{space}`. Format: `spaces/{space}` |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `useAdminAccess` | `boolean` Optional. When `true`, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Space](/workspace/chat/api/reference/rest/v1/spaces#Space).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.admin.spaces`\n- `https://www.googleapis.com/auth/chat.admin.spaces.readonly`\n- `https://www.googleapis.com/auth/chat.spaces`\n- `https://www.googleapis.com/auth/chat.spaces.readonly`\n- `https://www.googleapis.com/auth/chat.bot`\n- `https://www.googleapis.com/auth/chat.app.spaces`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]