Update a user's space read state (original) (raw)

This guide explains how to use theupdate()method on the SpaceReadState resource of the Google Chat API to mark spaces as read or unread.

TheSpaceReadState resourceis a singleton resource that represents details about a specified user's last read message in a Google Chat space.

Prerequisites

Node.js

#set-up-environment).

Update the calling user's space read state

To update a user's read state within a space, include the following in your request:

The following example updates the calling user's space read state:

Node.js

To run this sample, replace SPACE_NAME with the ID from the space'sname. You can obtain the ID by calling theListSpaces()method or from the space's URL.

The Google Chat API updates the specified space read state and returns an instance ofSpaceReadState.