Method: users.spaces.updateSpaceReadState
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
스페이스 내에서 사용자의 읽음 상태를 업데이트합니다. 읽은 메시지와 읽지 않은 메시지를 식별하는 데 사용됩니다. 예를 보려면 사용자의 스페이스 읽기 상태 업데이트를 참고하세요.
승인 범위를 사용하여 사용자 인증이 필요합니다.
https://www.googleapis.com/auth/chat.users.readstate
HTTP 요청
PATCH https://chat.googleapis.com/v1/{spaceReadState.name=users/*/spaces/*/spaceReadState}
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
spaceReadState.name |
string
스페이스 읽기 상태의 리소스 이름입니다. 형식: users/{user}/spaces/{space}/spaceReadState
|
쿼리 매개변수
Parameters |
updateMask |
string (FieldMask format)
필수 항목입니다. 업데이트할 필드 경로입니다. 현재 지원되는 필드 경로는 다음과 같습니다.
lastReadTime 가 최신 메시지 생성 시간보다 이전이면 스페이스가 UI에 읽지 않은 상태로 표시됩니다.
스페이스를 읽은 것으로 표시하려면 lastReadTime 를 최신 메시지 생성 시간보다 나중에 (더 큰) 발생한 값으로 설정합니다. lastReadTime 는 최신 메시지 생성 시간과 일치하도록 강제됩니다. 스페이스 읽기 상태는 스페이스의 최상위 대화에 표시되는 메시지의 읽기 상태에만 영향을 미칩니다. 대화목록의 답장은 이 타임스탬프의 영향을 받지 않으며 대신 대화목록 읽기 상태를 사용합니다.
|
요청 본문
요청 본문에 SpaceReadState
의 인스턴스가 포함됩니다.
응답 본문
성공한 경우 응답 본문에 SpaceReadState
의 인스턴스가 포함됩니다.
승인 범위
다음 OAuth 범위가 필요합니다.
https://www.googleapis.com/auth/chat.users.readstate
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eThis API updates a user's read state within a Google Chat space, marking messages as read or unread.\u003c/p\u003e\n"],["\u003cp\u003eIt requires user authentication and the \u003ccode\u003echat.users.readstate\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"],["\u003cp\u003eThe request uses the PATCH method and specifies the space read state resource name in the URL path.\u003c/p\u003e\n"],["\u003cp\u003eYou can control which fields to update using the \u003ccode\u003eupdateMask\u003c/code\u003e query parameter, such as setting the \u003ccode\u003elastReadTime\u003c/code\u003e to mark a space as read.\u003c/p\u003e\n"],["\u003cp\u003eThe request and response bodies utilize the \u003ccode\u003eSpaceReadState\u003c/code\u003e object to represent the user's read state information.\u003c/p\u003e\n"]]],["This outlines updating a user's read state in a space using a PATCH request to `https://chat.googleapis.com/v1/{spaceReadState.name=users/*/spaces/*/spaceReadState}`. Key components include specifying the `spaceReadState.name` in the path, updating the `lastReadTime` via the `updateMask` query parameter, and providing a `SpaceReadState` instance in the request body. The response, if successful, returns a `SpaceReadState` instance. This operation requires user authentication and the `https://www.googleapis.com/auth/chat.users.readstate` authorization scope.\n"],null,["# Method: users.spaces.updateSpaceReadState\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\nUpdates a user's read state within a space, used to identify read and unread messages. For an example, see [Update a user's space read state](https://developers.google.com/workspace/chat/update-space-read-state).\n\nRequires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with the [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):\n\n- `https://www.googleapis.com/auth/chat.users.readstate`\n\n### HTTP request\n\n`PATCH https://chat.googleapis.com/v1/{spaceReadState.name=users/*/spaces/*/spaceReadState}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------------------|------------------------------------------------------------------------------------------------------|\n| `spaceReadState.name` | `string` Resource name of the space read state. Format: `users/{user}/spaces/{space}/spaceReadState` |\n\n### Query parameters\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Required. The field paths to update. Currently supported field paths: - `lastReadTime` When the `lastReadTime` is before the latest message create time, the space appears as unread in the UI. To mark the space as read, set `lastReadTime` to any value later (larger) than the latest message create time. The `lastReadTime` is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state. |\n\n### Request body\n\nThe request body contains an instance of [SpaceReadState](/workspace/chat/api/reference/rest/v1/users.spaces#SpaceReadState).\n\n### Response body\n\nIf successful, the response body contains an instance of [SpaceReadState](/workspace/chat/api/reference/rest/v1/users.spaces#SpaceReadState).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/chat.users.readstate`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]