Method: spaces.list
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
호출자가 속한 스페이스를 나열합니다. 그룹 채팅 및 채팅 메시지는 첫 번째 메시지가 전송될 때까지 표시되지 않습니다. 예를 보려면 스페이스 목록을 참고하세요.
다음 유형의 인증을 지원합니다.
Google Workspace 조직의 이름이 지정된 모든 스페이스를 나열하려면 Workspace 관리자 권한을 사용하는 spaces.search()
메서드를 대신 사용하세요.
HTTP 요청
GET https://chat.googleapis.com/v1/spaces
URL은 gRPC 트랜스코딩 구문을 사용합니다.
쿼리 매개변수
매개변수 |
pageSize |
integer
선택사항입니다. 반환할 최대 스페이스 수입니다. 서비스가 이 값보다 더 적게 반환할 수 있습니다. 지정하지 않으면 최대 100개의 스페이스가 반환됩니다. 최대 값은 1,000입니다. 1,000을 초과하는 값을 사용하면 1,000으로 자동 변경됩니다. 음수 값은 INVALID_ARGUMENT 오류를 반환합니다.
|
pageToken |
string
선택사항입니다. 이전 list spaces 호출에서 받은 페이지 토큰입니다. 후속 페이지를 가져오려면 이 매개변수를 제공합니다. 페이지로 나누는 경우 필터 값이 페이지 토큰을 제공한 호출과 일치해야 합니다. 다른 값을 전달하면 예기치 않은 결과가 발생할 수 있습니다.
|
filter |
string
선택사항입니다. 쿼리 필터입니다. 스페이스 유형 (spaceType )을 기준으로 스페이스를 필터링할 수 있습니다. 스페이스 유형으로 필터링하려면 SPACE 또는 GROUP_CHAT 와 같은 유효한 enum 값을 지정해야 합니다 (spaceType 는 SPACE_TYPE_UNSPECIFIED 이 될 수 없음). 여러 스페이스 유형을 쿼리하려면 OR 연산자를 사용하세요. 예를 들어 다음 쿼리는 유효합니다.
spaceType = "SPACE"
spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
잘못된 쿼리는 서버에서 INVALID_ARGUMENT 오류와 함께 거부됩니다.
|
응답 본문
스페이스 목록 요청에 대한 응답입니다.
성공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"spaces": [
{
object (Space )
}
],
"nextPageToken": string
} |
필드 |
spaces[] |
object (Space )
요청된 페이지 (또는 첫 번째 페이지)의 스페이스 목록입니다. 참고: 목록 요청의 경우 스페이스 객체에 permissionSettings 필드가 반환되지 않습니다.
|
nextPageToken |
string
토큰을 pageToken 으로 전송하여 결과의 다음 페이지를 검색할 수 있습니다. 비어 있으면 후속 페이지가 없습니다.
|
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.bot
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eLists spaces (excluding empty group chats and DMs) that the caller is a member of, supporting app and user authentication.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering by space type and pagination for retrieving large result sets.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific authorization scopes related to Google Chat spaces and bots.\u003c/p\u003e\n"],["\u003cp\u003eProvides details on the HTTP request structure, query parameters, and expected response.\u003c/p\u003e\n"],["\u003cp\u003eTo list all spaces within a Google Workspace organization, use the \u003ccode\u003espaces.search()\u003c/code\u003e method with administrator privileges.\u003c/p\u003e\n"]]],["This document details how to list spaces a user is a member of via an HTTP `GET` request to `https://chat.googleapis.com/v1/spaces`. Key actions include utilizing optional query parameters like `pageSize`, `pageToken`, and `filter` to manage results. The request body must be empty. The response body returns an array of `spaces` and a `nextPageToken` for pagination. Authorization requires specific OAuth scopes, and alternative options exist for listing spaces by Google Workspace organization.\n"],null,["# Method: spaces.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListSpacesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nLists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/workspace/chat/list-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 the authorization scope:\n\n - `https://www.googleapis.com/auth/chat.bot`\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\nTo list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.\n\n### HTTP request\n\n`GET https://chat.googleapis.com/v1/spaces`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageSize` | `integer` Optional. The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an `INVALID_ARGUMENT` error. |\n| `pageToken` | `string` Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results. |\n| `filter` | `string` Optional. A query filter. You can filter spaces by the space type ([`spaceType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `spaceType` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: spaceType = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response for a list spaces request.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------|\n| ``` { \"spaces\": [ { object (/workspace/chat/api/reference/rest/v1/spaces#Space) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spaces[]` | `object (`[Space](/workspace/chat/api/reference/rest/v1/spaces#Space)`)` List of spaces in the requested (or first) page. Note: The `permissionSettings` field is not returned in the Space object for list requests. |\n| `nextPageToken` | `string` You can send a token as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\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\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]