# Unread Message count for Group Channel

**URL:** <https://community.sendbird.com/t/unread-message-count-for-group-channel/4691>\
**Category:** Miscellaneous\
**Created:** [May 19, 2022, 12:54pm UTC](https://community.sendbird.com/t/unread-message-count-for-group-channel/4691 "2022-05-19T12:54:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepa\_Test](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/deepa_test/32/1708_2.png) [@Deepa\_Test](https://community.sendbird.com/u/Deepa_Test)\
**Post date:** [May 19, 2022, 12:54pm UTC](https://community.sendbird.com/t/unread-message-count-for-group-channel/4691/1 "2022-05-19T12:54:19Z")

</div>

How to make unread message count as 0 if any one of the group member reads the chat in group channel.

Lets say we created a channel with 4 members, if person A reads message we need to make for others also unread message count as 0. As person A read and took action on the chat, so for other members we have to make no unread messages. How we can achieve this?

---

<div class="post-metadata">

**Author:** ![taha.saghir](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/taha.saghir/32/2094_2.png) [@taha.saghir](https://community.sendbird.com/u/taha.saghir)\
**Post date:** [May 24, 2022, 5:11pm UTC](https://community.sendbird.com/t/unread-message-count-for-group-channel/4691/3 "2022-05-24T17:11:01Z")

</div>

Hi @Deepa_Test,

The [mark as read API](https://sendbird.com/docs/chat/v3/platform-api/message/read-receipts/mark-all-messages-as-read-message) works for a single user, so you will have to call the API for each user in the group.

---

<div class="post-metadata">

**Author:** ![Development\_Account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/development_account/32/1584_2.png) [@Development\_Account](https://community.sendbird.com/u/Development_Account)\
**Post date:** [May 27, 2022, 3:02pm UTC](https://community.sendbird.com/t/unread-message-count-for-group-channel/4691/4 "2022-05-27T15:02:12Z")

</div>

@taha.saghir Thanks for the update, Can you please share the code reference for the same?

---

<div class="post-metadata">

**Author:** ![Development\_Account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/development_account/32/1584_2.png) [@Development\_Account](https://community.sendbird.com/u/Development_Account)\
**Post date:** [June 7, 2022, 5:56am UTC](https://community.sendbird.com/t/unread-message-count-for-group-channel/4691/5 "2022-06-07T05:56:38Z")

</div>

@taha.saghir Any update on this?

---

<div class="post-metadata">

**Author:** ![taha.saghir](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/taha.saghir/32/2094_2.png) [@taha.saghir](https://community.sendbird.com/u/taha.saghir)\
**Post date:** [June 7, 2022, 5:28pm UTC](https://community.sendbird.com/t/unread-message-count-for-group-channel/4691/6 "2022-06-07T17:28:56Z")

</div>

Hi @Development_Account - sorry for missing your message earlier.

We do not have sample code for Platform API, as it could have vast use cases and the code would depend on the language (server-side) that is being used to call the API.

That said, one of the possible solution is:

When a user [views a channel](https://sendbird.com/docs/chat/v3/platform-api/channel/channel-overview#4-list-of-properties-for-group-channels) from the UI, check if the `read_receipt` timestamp of any user is less than the `last_message / created_at` timestamp - if so, call the [mark as read API](https://sendbird.com/docs/chat/v3/platform-api/message/read-receipts/mark-all-messages-as-read-message) iteratively with the `user_id` of all of those users.

Alternatively, you can use the [message read](https://sendbird.com/docs/chat/v3/platform-api/webhook/events/group-channel#2-group_channel-message_read) webhook.
