waha icon indicating copy to clipboard operation
waha copied to clipboard

[Feature Request][ALL]: Mark All Unread Messages as Read Without Message ID

Open manojsitapara opened this issue 11 months ago • 1 comments

Is your feature request related to a problem? Please describe. I'm always frustrated when I have multiple unread messages across different chats in the NOWEB WhatsApp API, and I need to mark them as read one by one by passing individual message IDs. This process is time-consuming and inefficient, especially when handling a large number of unread messages.

Describe the solution you'd like

I would like an API that allows us to mark all unread messages from all chats as read in one go, without requiring message IDs. This will help streamline message management and reduce the complexity of handling unread messages in bulk.

Describe alternatives you've considered

One alternative is to first fetch all unread messages using an API and then loop through them to mark each one as read using the existing method. However, this is not an efficient solution because it requires multiple API calls, increasing the processing time and server load.

Additional context This feature will be useful for businesses and developers managing high volumes of messages

patron:PLUS

manojsitapara avatar Feb 06 '25 04:02 manojsitapara

Hi @manojsitapara

How you determine unread messages?

I fetch the messages and got response like { id: xxxxx, timestamp: 1740995443, from: xxxxx fromMe: false, body:xxxxx hasMedia: false, media: null, ack: null, ackName: 'UNKNOWN', replyTo: null, _data: { key: [Object], message: [Object], messageTimestamp: 1740995443, reportingTokenInfo: [Object] } }

patron:PLUS

RikoOrlando avatar Mar 07 '25 08:03 RikoOrlando

Hi!

In 2025.4.2 added new Read messages API

POST /api/{SESSION}/chats/{chatId}/messages/read

Support all engines. You can hit this endpoint before sending any message to make sure you've read all messages (remember also "typing" before sending a message to the chat after you read all messages)

patron:PRO

devlikepro avatar May 05 '25 06:05 devlikepro

@RikoOrlando hi! yes, ack and ackName is the right field to look. It might not have the right value after you pair a new session tho, but it should have the right values after you receive or send a message via API.

Also fix was added in 2025.4.2

NOWEB - Fix ack for new messages (it was UNKNOWN, now it’s DEVICE)

Added new filter.ack in https://waha.devlike.pro/docs/how-to/chats/#get-messages

patron:PRO

devlikepro avatar May 05 '25 06:05 devlikepro