Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

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

Open shreekarade opened this issue 8 years ago • 8 comments

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

shreekarade avatar Feb 09 '18 06:02 shreekarade

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

graywolf336 avatar Feb 09 '18 16:02 graywolf336

@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,

dqcanh avatar Mar 29 '18 07:03 dqcanh

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.

amdev74 avatar May 08 '18 06:05 amdev74

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!

Maqsyo avatar May 23 '18 04:05 Maqsyo

@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

Jamirkhan50 avatar Jun 06 '18 10:06 Jamirkhan50

@Jamirkhan50 Please leave a vote here: https://forums.rocket.chat/t/api-user-info-unread-messages-and-count-of/1152

Maqsyo avatar Jun 06 '18 11:06 Maqsyo

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.

amirHizkiya avatar Nov 11 '18 01:11 amirHizkiya

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?

Boby avatar Aug 20 '20 07:08 Boby