Calculate total number of unread messages from group channels whose name matches a particular string

calculate total number of unread messages from group channels whose name matches a particular string, or contains a particular string

Hello @vkay

Welcome to the Sendbird community!

To calculate the total number of unread messages from group channels whose name matches or contains a particular string, you can use the following API endpoint:

GET /users/{user_id}/unread_message_count

This endpoint retrieves the total number of unread messages for a user in group channels. You can pass the user ID as a parameter in the URL.

To filter the group channels based on the name, you can retrieve the list of group channels using the following API endpoint:

GET /users/{user_id}/group_channels

Then, you can iterate through the list of group channels and check if the name matches or contains the particular string. If it does, you can sum up the unread message count for each matching group channel to get the total number of unread messages.

Please note that you need to replace {user_id} with the actual user ID and handle pagination if there are more than 100 group channels.

Let me know if you need any further assistance!