N
Novu•12mo 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•12mo 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•12mo ago
Take this as an example
empe
empe•12mo ago
@Bocorbojon Did you manage?
Bocorbojon
Bocorbojon•12mo 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•12mo ago
@Pawan Jain please help here 🙂
Pawan Jain
Pawan Jain•12mo 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
Bocorbojon•12mo ago
Okay, will try it and see how it goes
Pawan Jain
Pawan Jain•12mo ago
@Bocorbojon Did you manage to get it working using above APIs?
Gali Baum
Gali Baum•12mo 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
Bocorbojon•12mo 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•12mo ago
@Bocorbojon, you just advanced to level 3!
Want results from more Discord servers?
Add your server
More Posts