Method: users.spaces.updateSpaceReadState
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בקשת HTTP
PATCH https://chat.googleapis.com/v1/{spaceReadState.name=users/*/spaces/*/spaceReadState}
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
spaceReadState.name |
string
שם המשאב של מצב הקריאה של המרחב המשותף. פורמט: users/{user}/spaces/{space}/spaceReadState
|
פרמטרים של שאילתה
פרמטרים |
updateMask |
string (FieldMask format)
חובה. נתיבי השדות שרוצים לעדכן. נכון לעכשיו, אלה נתיבי השדות הנתמכים:
אם הערך של lastReadTime נמוך מהשעה שבה נוצרה ההודעה האחרונה, המרחב המשותף יופיע כ'לא נקרא' בממשק המשתמש. כדי לסמן את המרחב המשותף כנקרא, מגדירים את lastReadTime לערך מאוחר יותר (גדול יותר) מהשעה שבה נוצרה ההודעה האחרונה. הערך של lastReadTime מחויב להתאים לשעת היצירה של ההודעה האחרונה. חשוב לזכור שמצב הקריאה במרחב המשותף משפיע רק על מצב הקריאה של הודעות שגלויות בשיחה ברמה העליונה של המרחב המשותף. תשובות בשרשורים לא מושפעות מחותמת הזמן הזו, אלא מסתמכות על מצב הקריאה של השרשור.
|
גוף הבקשה
גוף הבקשה מכיל מופע של SpaceReadState
.
גוף התשובה
אם הפעולה מצליחה, גוף התגובה מכיל מופע של SpaceReadState
.
היקפי הרשאה
נדרשת הרשאת OAuth ברמת ההיקף הבאה:
https://www.googleapis.com/auth/chat.users.readstate
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת 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)."]]