Missing _templateId causes `Response validation failed` when fetching notifications via @novu/api
I think I discovered a problem with the
@novu/api
lib
When I run
I'm getting the following error:
Expected behaviour: Even if the _templateId
is missing I still should be able to retrieve data.
Bonus question: The data that comes from novu.subscribers.notifications.feed()
is different from the one that comes from useNotifications()
hook. Is there a way of getting InboxNotification
(just as in useNotifications
) via the @novu/api
?8 Replies
Another issue: If I pass negative page size (e.g., -1) the request will hang forever
@AndreMaz
Could you please share the
@novu/api
version?@Pawan Jain Apologies. Forgot to add this info. I'm on
v1.4.0
@Pawan Jain another question. What's the purpose of payload
in the request?
Docs state
Base64 encoded string of the partial payload JSON objectbut I don't understand the meaning of this. Cal you please clarify?
@AndreMaz
Could you please share if you are using novu framework? do you see any specific meessage with which _templateId error occurs?
What's the purpose of payload in the request?Payload is an object which is used to send key value pairs to customize the notification content
Hey @Pawan Jain I'm on vacations right now.
I'll check the templateId issue next week. I'll let you know when I have more info
@AndreMaz, you just advanced to level 1!
@Pawan Jain I'm back.
Could you please share if you are using novu framework? do you see any specific meessage with which _templateId error occurs?Tested again but the error is gone. Did you change something on server side?
Payload is an object which is used to send key value pairs to customize the notification contentYep, it's similar to
data
in useNotifications
hook in a sense that the payload
can be used to filter/query the notifications.
Probably the documentation can be improved as the Base64 encoded string of the partial payload JSON object
is not explicit enough.
Some additional questions:
- Would it be possible, in future versions of @novu/api, to also filter by data
?
- Can you take a look at https://github.com/novuhq/novu-ts/issues/78 ?GitHub
[Feature Request] Allow archive notification via API · Issue #78 ...
At the moment it's not possible to archive the notification via API. Docs: https://docs.novu.co/api-reference/subscribers/update-notifications-state Only available states are "read" |...
Would it be possible, in future versions of @novu/api, to also filter by data ?We have added this option in
@novu/react
hooks
https://docs.novu.co/platform/inbox/react/tabs#filter-tabs-by-data-attributes