REST API to get user's unread message count

There is REST api for cometchat:
https://prodocs.cometchat.com/reference#user-users

But there is no any method to get user’s unread messages count.
I need this api to show counter in header of site. And i do not want to use sockets just to take this values for user.

@mayur.bhandari, hello, could you provide some info about question above?
thanks!

Hello @Konstantin,

You can use the fetch messages api and pass unread=1 & count=1 as query parameter.
Please refer the following link to fetch messages:

https://prodocs.cometchat.com/reference#user-listusermessages

Thanks for reference, but as i see, this function gets messages for specified opponent or group only.
But i need total amount of undead messages for all opponents and groups for current user.
I think it is commonly used functional.

Hello @Konstantin,

You can use the fetch all messages API and pass unread=1 & count=1 as a query parameter.
Please refer the following link to fetch messages:

https://prodocs.cometchat.com/reference#user-listallmessages

I hope this helps.!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.