N
Novu•9mo ago
winston.tech

MARKING NOTIFICATIONS AS SEEN

There seems to be no way using the api to mark the notificaiton as seen, I want to mark it as seen so it doesnt apepar int he users list.
9 Replies
Ask Inkeep
Ask Inkeep•9mo ago
Hi @winston.tech, I'm an AI assistant knowledgeable about Novu. While a team member is able to review this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Mark a subscriber feed messages as seen or as read * Africa's Talking * Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed. * Headless API Reference -----------------------------
Ask Inkeep
Ask Inkeep•9mo ago
Answer Novu does indeed provide a way to mark notifications as seen using their API. There are two relevant endpoints you can use depending on your specific needs: 1. To mark individual subscriber feed messages as seen or as read, you can use the following endpoint:
curl --request POST \
--url https://api.novu.co/v1/subscribers/{subscriberId}/messages/markAs \
--header 'Content-Type: application/json' \
--data '{
"messageId": "<string>",
"mark": {
"seen": true,
"read": true
}
}'
curl --request POST \
--url https://api.novu.co/v1/subscribers/{subscriberId}/messages/markAs \
--header 'Content-Type: application/json' \
--data '{
"messageId": "<string>",
"mark": {
"seen": true,
"read": true
}
}'
This allows you to specify which messages to mark as seen by providing the messageId (1) . 2. If you need to mark all messages for a subscriber as seen, you can use this endpoint:
curl --request POST \
--url https://api.novu.co/v1/subscribers/{subscriberId}/messages/mark-all \
--header 'Content-Type: application/json' \
--data '{
"feedIdentifier": "<string>",
"markAs": "seen"
}'
curl --request POST \
--url https://api.novu.co/v1/subscribers/{subscriberId}/messages/mark-all \
--header 'Content-Type: application/json' \
--data '{
"feedIdentifier": "<string>",
"markAs": "seen"
}'
This endpoint enables you to mark all messages as seen, optionally filtered by feed identifier (2) . Both of these methods provide a way to manage notification visibility for users, ensuring that once a notification has been seen, it can be marked accordingly and not clutter the user's list of notifications.
Ask Inkeep
Ask Inkeep•9mo ago
Got it. Tagging @Support for additional help.
winston.tech
winston.techOP•9mo ago
I WANT TO BE ABLE TO MARK IT AS SEEN AND THEN NOT HAVE THE APPEAR IN THE LIST
Mei
Mei•9mo ago
You can filter out messages that have been marked as seen with the seen query parameter of the get in app notifications endpoint. https://docs.novu.co/api-reference/subscribers/get-in-app-notification-feed-for-a-particular-subscriber There is no way to prevent notifications from appearing in an unfiltered feed list except via deleting them.
Pawan Jain
Pawan Jain•9mo ago
@winston.tech on marking as read/seen, novu just change the status of message. it does not remove it from UI. if you permanently wants to remove the in-app message (notification) then you can delete the message using delete message api or you can achieve this by adding client side filtration logic as suggested by @Mei
Laiix
Laiix•9mo ago
@Pawan Jain What about the old endpoint? /novu/$subscriberId/messages/$messageId/seen does this not exist anymore? @Ask Inkeep
Pawan Jain
Pawan Jain•9mo ago
@Laiix Yes it exist but it will not remove in-app notification from UI
Laiix
Laiix•9mo ago
Thx 🙂
Want results from more Discord servers?
Add your server