# Determine Number of Unread Messages

**URL:** https://forum.mattermost.com/t/determine-number-of-unread-messages/11402
**Category:** Troubleshooting
**Created:** [March 21, 2021, 9:18pm UTC](https://forum.mattermost.com/t/determine-number-of-unread-messages/11402 "2021-03-21T21:18:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![reggie](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@reggie](https://forum.mattermost.com/u/reggie)
#### Post date: [March 21, 2021, 9:18pm UTC](https://forum.mattermost.com/t/determine-number-of-unread-messages/11402/1 "2021-03-21T21:18:39Z")

</div>

Hello.  
I’m working with the Client4 and websocket portions of the mattermost-redux package to implement a custom client in React, and I’m trying to determine the correct “recipe” to find and maintain the number of unread messages in a given channel.

I’ve come across the Client4 `getPostsSince` method that lets me get the posts in a given channel since a given post ID. This seems like it might be a way to get the number of unread posts as longs as the last time the user viewed a specific channel is known. Is the information on when the user last viewed a channel available via the API?

Alternatively, is there a more effective way of determining and maintaining the number of unread messages per channel? Is there a “recipe” or tutorial covering this topic?

---

<div class="post-metadata">

### Author: ![lengtmp](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lengtmp](https://forum.mattermost.com/u/lengtmp)
#### Post date: [April 7, 2021, 1:59pm UTC](https://forum.mattermost.com/t/determine-number-of-unread-messages/11402/2 "2021-04-07T13:59:57Z")

</div>

Hi Reggie, there’s a lot of guides on this over the web. Am not sure posting an external link is allowed or not. If yes kindly confirm me in the reply so I can give you a link to some guide to go forward with.

---

<div class="post-metadata">

### Author: ![XxLilBoPeepsxX](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/xxlilbopeepsxx/32/4993_2.png) [@XxLilBoPeepsxX](https://forum.mattermost.com/u/XxLilBoPeepsxX)
#### Post date: [April 7, 2021, 10:26pm UTC](https://forum.mattermost.com/t/determine-number-of-unread-messages/11402/3 "2021-04-07T22:26:38Z")

</div>

You’re most certainly allowed to post external links here!

---

<div class="post-metadata">

### Author: ![reggie](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@reggie](https://forum.mattermost.com/u/reggie)
#### Post date: [May 26, 2021, 7:00pm UTC](https://forum.mattermost.com/t/determine-number-of-unread-messages/11402/4 "2021-05-26T19:00:11Z")

</div>

@lengtmp can you post a link to a guide on how to do this?

---

<div class="post-metadata">

### Author: ![lengtmp](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lengtmp](https://forum.mattermost.com/u/lengtmp)
#### Post date: [June 20, 2021, 2:21am UTC](https://forum.mattermost.com/t/determine-number-of-unread-messages/11402/5 "2021-06-20T02:21:41Z")

</div>

Sure, check out the blog version of this, front contains the list of crap so **do check out blog sections** of any of these two:

1. [https://mycoles.vip/](https://mycoles.vip/)
2. [https://mythdhr.vip/](https://mythdhr.vip/)

Hope this helps, thanks!
