N
Novu•2y ago
Bocorbojon

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
Pawan Jain
Pawan Jain•2y ago
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
Pawan Jain
Pawan Jain•2y ago
Take this as an example
empe
empe•2y ago
@Bocorbojon Did you manage?
Bocorbojon
BocorbojonOP•2y ago
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.
Tomer Barnea
Tomer Barnea•2y ago
@Pawan Jain please help here 🙂
Pawan Jain
Pawan Jain•2y ago
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
Bocorbojon
BocorbojonOP•2y ago
Okay, will try it and see how it goes
Pawan Jain
Pawan Jain•2y ago
@Bocorbojon Did you manage to get it working using above APIs?
Gali Baum
Gali Baum•2y ago
@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
Bocorbojon
BocorbojonOP•2y ago
It worked. If I send the feedId through the create template endpoint it sets the feed in the in-app step. Thanks!
Novu_Bot
Novu_Bot•2y ago
@Bocorbojon, you just advanced to level 3!
Want results from more Discord servers?
Add your server