N
Novu12mo ago
Maks Salad

How the Workflow Group property might be used in the Headless API?

Hi! I've added different workflow groups for notifications. I'm using Headless API to work with notifications. Can I exclude notifications with a specific workflow group for a user, using Headless API? How the Workflow Group property might be used in the Headless API? Thanks a lot in advance!
15 Replies
Pawan Jain
Pawan Jain12mo ago
Hi @Maks Salad you want to hide all notifications from a particular workflow group?
Maks Salad
Maks SaladOP12mo ago
Yes If there is some way to do it with Headless API?
Pawan Jain
Pawan Jain12mo ago
As headless api is used for fetching in-app notification. What if you use subscriber preference and turn off in-app channel of particular workflow for a user (subscriber) https://docs.novu.co/subscribers/preferences If in-app channel will be off and you will trigger the workflow to subscriber from server side , then user will not receive in-app notification and it will not be returned while fetching with headless library methodsin client side
Maks Salad
Maks SaladOP12mo ago
I fetch user preferences with
fetchUserPreferences
fetchUserPreferences
method. But I don't see any mention of a workflow group in
IUserPreferenceSettings
IUserPreferenceSettings
for turning off in-app channel of a particular workflow group
Novu_Bot
Novu_Bot12mo ago
@Maks Salad, you just advanced to level 1!
Pawan Jain
Pawan Jain12mo ago
@Maks Salad You can use headlessService.updateUserPreferences method. currently, workflow group is not supported for these methods. We have planned the use of workflow group feature for subscriber preference in future https://docs.novu.co/notification-center/client/headless/api-reference#updateuserpreferences
Maks Salad
Maks SaladOP12mo ago
I can update it but I don't see a way to filter for what exact notification I'll turn off in-app channel I have tags inside IUserPreferenceSettings but I believe they are not connected to Group Workflow, am I right?
Pawan Jain
Pawan Jain12mo ago
Yes tags and workflow grpups are not connected with preference methods
Maks Salad
Maks SaladOP11mo ago
I'm looking forward to this feature in future updates Thank you! Hey @Pawan Jain Could you please clarify if I can get workflow group from any headlessService method now?
Pawan Jain
Pawan Jain11mo ago
@Maks Salad Do you want to fetch workflow groups for this?
Maks Salad
Maks SaladOP11mo ago
Yes, I'd like to fetch workflow groups for filtering what notifications I show. Or is it possible to enable/disable notifications that have a specific workflow group for the user, using headless API?
Russ Salad
Russ Salad11mo ago
@Pawan Jain so do we have any options in this case?
Pawan Jain
Pawan Jain11mo ago
@Russ Salad and @Maks Salad Sorry for missing this I am checking this a way to implement this now I just checked, it is not possible to workflow group for conditionally displaying notifications
Maks Salad
Maks SaladOP11mo ago
It's impossible to restrict delivery preferences based on workflow group on a per-subscriber basis using headless API. And it's impossible to get workflow group with headless API to restrict receiving notifications with a particular workflow group. Am I understanding you right?
Pawan Jain
Pawan Jain11mo ago
yeah this is correct as currently workflow group is not part of subscriber preference is this blocking you to use our in-app notification center?
Want results from more Discord servers?
Add your server