Method: spaces.spaceEvents.get
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Возвращает событие из пространства Google Chat. Полезные данные события содержат самую последнюю версию измененного ресурса. Например, если вы запрашиваете событие о новом сообщении, но позже сообщение было обновлено, сервер возвращает обновленный ресурс Message
в полезных данных события.
Примечание. Поле permissionSettings
не возвращается в объекте Space данных о событиях Space для этого запроса.
Требуется аутентификация пользователя с областью авторизации, подходящей для чтения запрошенных данных:
-
https://www.googleapis.com/auth/chat.spaces.readonly
-
https://www.googleapis.com/auth/chat.spaces
-
https://www.googleapis.com/auth/chat.messages.readonly
-
https://www.googleapis.com/auth/chat.messages
-
https://www.googleapis.com/auth/chat.messages.reactions.readonly
-
https://www.googleapis.com/auth/chat.messages.reactions
-
https://www.googleapis.com/auth/chat.memberships.readonly
-
https://www.googleapis.com/auth/chat.memberships
Чтобы получить событие, аутентифицированный пользователь должен быть членом пространства.
Пример см. в разделе Получение сведений о событии из чата Google .
HTTP-запрос
GET https://chat.googleapis.com/v1/{name=spaces/*/spaceEvents/*}
URL-адрес использует синтаксис транскодирования gRPC .
Параметры пути
Параметры |
---|
name | string Необходимый. Имя ресурса космического события. Формат: spaces/{space}/spaceEvents/{spaceEvent} |
Тело запроса
Тело запроса должно быть пустым.
Тело ответа
В случае успеха тело ответа содержит экземпляр SpaceEvent
.
Области авторизации
Требуется одна из следующих областей OAuth:
-
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.memberships
-
https://www.googleapis.com/auth/chat.memberships.readonly
-
https://www.googleapis.com/auth/chat.messages.reactions
-
https://www.googleapis.com/auth/chat.messages.reactions.readonly
Дополнительную информацию см. в руководстве по авторизации .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-25 UTC.
[null,null,["Последнее обновление: 2025-07-25 UTC."],[[["\u003cp\u003eThis request returns an event from a Google Chat space, providing the most recent version of the changed resource in the payload.\u003c/p\u003e\n"],["\u003cp\u003eTo get an event, the authenticated user must be a member of the space and use the \u003ccode\u003eGET\u003c/code\u003e method with the specified URL structure.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should be empty, and a successful response returns a \u003ccode\u003eSpaceEvent\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThis action requires specific OAuth scopes related to Google Chat spaces, messages, memberships, and reactions for authorization.\u003c/p\u003e\n"]]],["This describes retrieving a Google Chat space event using a `GET` request to `https://chat.googleapis.com/v1/{name=spaces/*/spaceEvents/*}`. The `name` path parameter, in the format `spaces/{space}/spaceEvents/{spaceEvent}`, is required. The request body must be empty. Successful requests return a `SpaceEvent` instance, containing the resource's latest version. Authentication requires specific OAuth scopes, and the user must be a space member. The event payload details any resource changes within the space.\n"],null,["# Method: spaces.spaceEvents.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_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 an event from a Google Chat space. The [event payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) contains the most recent version of the resource that changed. For example, if you request an event about a new message but the message was later updated, the server returns the updated `Message` resource in the event payload.\n\nNote: The `permissionSettings` field is not returned in the Space object of the Space event data for this request.\n\nRequires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with an [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) appropriate for reading the requested data:\n\n- `https://www.googleapis.com/auth/chat.spaces.readonly`\n- `https://www.googleapis.com/auth/chat.spaces`\n- `https://www.googleapis.com/auth/chat.messages.readonly`\n- `https://www.googleapis.com/auth/chat.messages`\n- `https://www.googleapis.com/auth/chat.messages.reactions.readonly`\n- `https://www.googleapis.com/auth/chat.messages.reactions`\n- `https://www.googleapis.com/auth/chat.memberships.readonly`\n- `https://www.googleapis.com/auth/chat.memberships`\n\nTo get an event, the authenticated user must be a member of the space.\n\nFor an example, see [Get details about an event from a Google Chat space](https://developers.google.com/workspace/chat/get-space-event).\n\n### HTTP request\n\n`GET https://chat.googleapis.com/v1/{name=spaces/*/spaceEvents/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The resource name of the space event. Format: `spaces/{space}/spaceEvents/{spaceEvent}` |\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 [SpaceEvent](/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent).\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.messages`\n- `https://www.googleapis.com/auth/chat.messages.readonly`\n- `https://www.googleapis.com/auth/chat.memberships`\n- `https://www.googleapis.com/auth/chat.memberships.readonly`\n- `https://www.googleapis.com/auth/chat.messages.reactions`\n- `https://www.googleapis.com/auth/chat.messages.reactions.readonly`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]