Method: subscriptions.list
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
HTTP-запрос
GET https://workspaceevents.googleapis.com/v1/subscriptions
URL использует синтаксис перекодировки gRPC .
Параметры запроса
Параметры |
---|
pageSize | integer Необязательно. Максимальное количество возвращаемых подписок. Сервис может вернуть меньше этого значения. Если не указано или установлено значение 0 , возвращается до 50 подписок. Максимальное значение — 100. Если указать значение больше 100, система вернет только 100 подписок. |
pageToken | string Необязательный. Токен страницы, полученный в результате предыдущего вызова подписки на список. Укажите этот параметр для получения следующей страницы. При пагинации значение фильтра должно соответствовать вызову, предоставившем токен страницы. Передача другого значения может привести к неожиданным результатам. |
filter | string Обязательно. Фильтр запроса. Вы можете фильтровать подписки по типу события ( event_types ) и целевому ресурсу ( target_resource ). В запросе необходимо указать хотя бы один тип событий. Для фильтрации по нескольким типам событий используйте оператор OR . Чтобы отфильтровать как по типу события, так и по целевому ресурсу, используйте оператор AND и укажите полное имя ресурса, например //chat.googleapis.com/spaces/{space} . Например, следующие запросы являются допустимыми: event_types:"google.workspace.chat.membership.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created"
event_types:"google.workspace.chat.message.v1.created" AND
target_resource="//chat.googleapis.com/spaces/{space}"
( event_types:"google.workspace.chat.membership.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created" ) AND
target_resource="//chat.googleapis.com/spaces/{space}"
Сервер отклоняет недопустимые запросы с ошибкой INVALID_ARGUMENT . |
Текст запроса
Тело запроса должно быть пустым.
Тело ответа
Ответное сообщение для SubscriptionsService.ListSubscriptions
.
В случае успеха тело ответа содержит данные со следующей структурой:
JSON-представление |
---|
{
"subscriptions": [
{
object (Subscription )
}
],
"nextPageToken": string
} |
Поля |
---|
subscriptions[] | object ( Subscription ) Список подписок. |
nextPageToken | string Токен, который можно отправить как pageToken для получения следующей страницы. Если это поле пропущено, последующих страниц не будет. |
Области авторизации
Требуется одна из следующих областей OAuth:
-
https://www.googleapis.com/auth/chat.bot
-
https://www.googleapis.com/auth/chat.spaces
-
https://www.googleapis.com/auth/chat.spaces.readonly
-
https://www.googleapis.com/auth/chat.messages
-
https://www.googleapis.com/auth/chat.messages.readonly
-
https://www.googleapis.com/auth/chat.messages.reactions
-
https://www.googleapis.com/auth/chat.messages.reactions.readonly
-
https://www.googleapis.com/auth/chat.memberships
-
https://www.googleapis.com/auth/chat.memberships.readonly
-
https://www.googleapis.com/auth/meetings.space.created
-
https://www.googleapis.com/auth/meetings.space.readonly
Более подробную информацию смотрите в Руководстве по авторизации .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-25 UTC.
[null,null,["Последнее обновление: 2025-07-25 UTC."],[[["\u003cp\u003eLists existing Google Workspace subscriptions, allowing retrieval of details like event types and target resources.\u003c/p\u003e\n"],["\u003cp\u003eEnables filtering of subscriptions by event types and target resource using query parameters, requiring at least one event type for filtering.\u003c/p\u003e\n"],["\u003cp\u003eUses pagination to retrieve large lists of subscriptions, providing a \u003ccode\u003enextPageToken\u003c/code\u003e for accessing subsequent pages.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific OAuth scopes for authorization, such as \u003ccode\u003ehttps://www.googleapis.com/auth/chat.bot\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/chat.spaces\u003c/code\u003e, to access and manage subscriptions.\u003c/p\u003e\n"],["\u003cp\u003eReturns a response body containing a list of subscriptions and a token for pagination if further pages exist.\u003c/p\u003e\n"]]],["This document outlines how to list Google Workspace subscriptions using a `GET` request to `https://workspaceevents.googleapis.com/v1/subscriptions`. Key parameters include `pageSize` (max 100) to limit results, `pageToken` for pagination, and a mandatory `filter` to specify event types and/or target resources using `OR` and `AND` operators. The request body is empty. The response body contains a list of `subscriptions` and an optional `nextPageToken` for subsequent pages. Specific OAuth scopes are required for authorization.\n"],null,["# Method: subscriptions.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.ListSubscriptionsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n\nLists Google Workspace subscriptions. To learn how to use this method, see [List Google Workspace subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).\n\n### HTTP request\n\n`GET https://workspaceevents.googleapis.com/v1/subscriptions`\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 subscriptions to return. The service might return fewer than this value. If unspecified or set to `0`, up to 50 subscriptions are returned. The maximum value is 100. If you specify a value more than 100, the system only returns 100 subscriptions. |\n| `pageToken` | `string` Optional. A page token, received from a previous list subscriptions 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 might lead to unexpected results. |\n| `filter` | `string` Required. A query filter. You can filter subscriptions by event type (`event_types`) and target resource (`target_resource`). You must specify at least one event type in your query. To filter for multiple event types, use the `OR` operator. To filter by both event type and target resource, use the `AND` operator and specify the full resource name, such as `//chat.googleapis.com/spaces/{space}`. For example, the following queries are valid: event_types:\"google.workspace.chat.membership.v1.updated\" OR event_types:\"google.workspace.chat.message.v1.created\" event_types:\"google.workspace.chat.message.v1.created\" AND target_resource=\"//chat.googleapis.com/spaces/{space}\" ( event_types:\"google.workspace.chat.membership.v1.updated\" OR event_types:\"google.workspace.chat.message.v1.created\" ) AND target_resource=\"//chat.googleapis.com/spaces/{space}\" The server rejects invalid queries with an `INVALID_ARGUMENT` error. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response message for [SubscriptionsService.ListSubscriptions](/workspace/events/reference/rest/v1/subscriptions/list#google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions).\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"subscriptions\": [ { object (/workspace/events/reference/rest/v1/subscriptions#Subscription) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `subscriptions[]` | `object (`[Subscription](/workspace/events/reference/rest/v1/subscriptions#Subscription)`)` List of subscriptions. |\n| `nextPageToken` | `string` A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, 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.bot`\n- `\n https://www.googleapis.com/auth/chat.spaces`\n- `\n https://www.googleapis.com/auth/chat.spaces.readonly`\n- `\n https://www.googleapis.com/auth/chat.messages`\n- `\n https://www.googleapis.com/auth/chat.messages.readonly`\n- `\n https://www.googleapis.com/auth/chat.messages.reactions`\n- `\n https://www.googleapis.com/auth/chat.messages.reactions.readonly`\n- `\n https://www.googleapis.com/auth/chat.memberships`\n- `\n https://www.googleapis.com/auth/chat.memberships.readonly`\n- `\n https://www.googleapis.com/auth/meetings.space.created`\n- `\n https://www.googleapis.com/auth/meetings.space.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]