How to add a feed to the in-app step of a template from the API?
Just recently discovered feeds for the in-app notifications and I have 2 questions:
1. With the create notification template endpoint, can you define the feed of the in-app notification step?
2. What can we do with feeds? Does the React component provide a way to add tabs to the notification center to group notifications by feed?
11 Replies
https://docs.novu.co/notification-center/react/react-components#multiple-tab-layout
Yes you can group in-app notifications by feed
Enable Use Feeds option, create new or choose existing feeds
Take this as an example
@Bocorbojon Did you manage?
Haven't tested the tabs yet, however, what I also need is to programatically add a feed to a workflow using the create template endpoint of your API. Is that possible?
I have checked the response that you receive when you fetch the workflows using the get templates endpoint, and in the response I see that, in the in-app step, there is a property called _feedId which your API adds automatically, but I couldn't find a way to manually send a feedId when I actually do the POST request on the path to create template.
@Pawan Jain please help here 🙂
Hi @Bocorbojon
You first need to take feedId from anyof the feeds response return by this API
https://docs.novu.co/api/get-feeds/
or
create a new feed using this API
https://docs.novu.co/api/create-feed/
and then send returned feedId in create/update template request payload
Okay, will try it and see how it goes
@Bocorbojon Did you manage to get it working using above APIs?
@Bocorbojon @Pawan Jain I believe the assignment of a feedId to a template through the api fits the bug described in this issue: https://github.com/novuhq/novu/issues/3505
In the create/update of template through the api, please also try sending feedId instead of _feedId in addition to all of Pawan's suggestions
It worked. If I send the feedId through the create template endpoint it sets the feed in the in-app step. Thanks!
@Bocorbojon, you just advanced to level 3!