I am developing an application using rocket.chat REST API and Realtime API, I would like to ask how to get room’s unread messages and how to mark messages as read? Now I’m fetching rooms using Realtime API Get Rooms method, it sends me rooms with last message, but I can’t figure it out how can I differentiate if a message is read or not and later on how to mark a message as read when a user will load the room’s history.
Thank you for response, yes I did, it doesn’t work. First of all it is related to channels (room type “c”) not direct chat (room type “d”).
And even when I’ve created testing channel for this endpoint it only returns an array of messages with success boolean and unreadNotLoaded which looks like that:
When it comes to the second question, if there is a possibility to get “unread” messages, when they get “read” status? Is there some kind of endpoint to do it?
I know that /api/v1/im.history endpoint is for the direct messages, and /api/v1/channels.history endpoint is for the channels, but I don’t for example how can I find out which message is unread when a user logins to an account and the app displays him a list of users with their’s last message from Realtime API rooms/get method.
The rooms/get method sends me back the lastMessage, but I don’t know how can I find out if the message was read by the user before or not.