Rocket.chat: How to get unread message via rest api in Rocket.chat

Created on 9 Feb 2018  路  8Comments  路  Source: RocketChat/Rocket.Chat

Hello I have used this /api/v1/im.history?roomId=MLtBizp6jZT6w5LmqXrJK2GRbJBPPKSYPm&unreads=true for get unread message via rest API and i am using Rocket.version 0.59.4. But i got unreadNotLoaded=0, which is not right. Please help me

Most helpful comment

@graywolf336
I have the same question. The answer you mentioned in above link is not the correct one for this question (here, I want to get unread messages. Not the messages not shown by the query). I figured out that the "unreads=true" in APIs channels.history, groups.history and im.history is for another purpose instead of pulling unread messages. I found it from here https://stackoverflow.com/questions/42646197/get-unread-message-via-rest-api-for-rocket-chat

I'm still stuck on this. Does rocketchat provide ways to get total unread messages, room based unread messages via Rest API? I've searched around but not found a solution yet. Please guide me.

Thanks,

All 8 comments

Closing as we have answered this several times and it is on StackOverflow: https://stackoverflow.com/a/45752751/6997092

@graywolf336
I have the same question. The answer you mentioned in above link is not the correct one for this question (here, I want to get unread messages. Not the messages not shown by the query). I figured out that the "unreads=true" in APIs channels.history, groups.history and im.history is for another purpose instead of pulling unread messages. I found it from here https://stackoverflow.com/questions/42646197/get-unread-message-via-rest-api-for-rocket-chat

I'm still stuck on this. Does rocketchat provide ways to get total unread messages, room based unread messages via Rest API? I've searched around but not found a solution yet. Please guide me.

Thanks,

Same here, we really need an API to get the number of unread message for a specified user in all the room and private where the user is in.

Is it possible to give the /api/v1/users.info method the attributes "unreadState" and "unreadCount" ?

The only actual solution, that I know, is to iterate over all rooms and users. And this solution has way too much requests..

Thanks!

@graywolf336

I am also searching the way to get unread messages for particular user.
The current API is for channels, but if my multiple users are online and each belongs to at least five group then this will impact to our application speed as well as sometimes due more through and fall calls my rocket-chat server get down.

Thanks,
Jamirkhan Pathan

I opened a similar issue in in the Rocket Chat Forum, and I think that I would provide a solution for this here as well. You can vote for it here:
https://forums.rocket.chat/t/api-to-retrieve-unread-count-for-more-then-one-room-at-a-time/2427

I created another one as I have elaborated some possible solutions that would be super helpful.

Hopefully with enough votes we could get this in the pipeline.

I opened a similar issue in in the Rocket Chat Forum, and I think that I would provide a solution for this here as well. You can vote for it here:
https://forums.rocket.chat/t/api-to-retrieve-unread-count-for-more-then-one-room-at-a-time/2427

I created another one as I have elaborated some possible solutions that would be super helpful.

Hopefully with enough votes we could get this in the pipeline.

jumping in does that mean where I would be able to get it? subscribe to the room itself or user info?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Buzzele picture Buzzele  路  3Comments

sta-szek picture sta-szek  路  3Comments

zeigerpuppy picture zeigerpuppy  路  3Comments

djeber picture djeber  路  3Comments

danpospisil picture danpospisil  路  3Comments