N
Novu•16mo ago
Kai Pradel

Why are topics API accessible only?

Hi folks. Just wondering why topic are not accessible from the UI? I am subscribing users to a topic and find it difficult to see a list of all subscribers. Seems ike there is a call to confirm a specific subscriber on a topic but not an entire list. Thanks in advance, Kai
7 Replies
Dima Grossman
Dima Grossman•16mo ago
Hi @.mrjoojoo we have this on our roadmap, just haven't gotten to it yet 😦 https://roadmap.novu.co/roadmap
Kai Pradel
Kai PradelOP•16mo ago
Ah ok, good to know. I watched the office hours video and don't remember hearing about it. After some testing I ran into additional issues. Namely that checking id a user is subscribed to a topic I get 404 errors = I assume this indicates that a given subscriberId could not be found in the topic? Would be better if the call returns a 200 with payload consisting of a [] zero array or something else..
Unknown User
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Pawan Jain
Pawan Jain•16mo ago
Check If subscribers is part of topic API returns this response in case subscriber is not present in topic
No description
--
--•16mo ago
404 was a deliberately choice as managing status codes is simpler that parsing responses as @changsheng12 mentioned. Appreciate your feedback though.
Kai Pradel
Kai PradelOP•16mo ago
I see. Usually when I throw 404's it's because an endpoint doesn't exist, not when the data is null. The former requires try/catch statements whereas the latter can be handled with application logic. I assume this is consistent throughout the API then?
--
--•16mo ago
I have to disagree as in this case the data is not mean to be null, the subscriber might exist but it hasn't been assigned to the topic. Therefore in the endpoint implementation we check that the topic resource includes the subscriber sub-resource: GET https://api.novu.co/v1/topics/:topicKey/subscribers/:externalSubscriberId So we considered 404 is the status code you would expect following REST guidelines. Topics is one of the newest APIs, and we are trying to be as REST compliant as possible. I don't discard that in older parts of the API we might have other guidelines that are not following REST guidelines properly unfortunately.
Want results from more Discord servers?
Add your server