Is there any Discourse Notification API?


(Roberto_Pezzali) #1

Is there any API or solution to send notification to a user in the notification bar?

In my main app (rails) people are notified when someone add a comment to a post they are following. I send this notification to a user in a bar like the Discourse user bar and via mail.

How can I send my notification also on the Discourse Bar? And of course is possibile to call with an API the Discourse notification so I can merge them with the apps notification in my main app?


(Ulrich Klauer) #2

It seems there was no reply to this and no other topic addresses it, but I’d also like to know – is there a way to create notifications via the API?


(Sam Saffron) #3

Notification.create from ruby will create a notification, but there is no API endpoint for it yet.

PR welcome (with tests)


(Muhlis C) #6

Is there a complete spec for this?

  • who will be allowed to create notification?
  • should this allow link to external app/website?

(Sam Saffron) #11

Hmmm,

Are you looking to build this feature? What specific problem are you trying to solve for your community?


(Muhlis C) #13

I’ve been contacted by @erlend_sh to work on this. Is that still the case @erlend_sh?

I’m ready to submit a PR with following features:

  • allow admins to create/update/delete notification
  • allow link to external url in notification

(Sam Saffron) #14

The PR looks quite good.

Only admins as you have it set up now.

Hmm maybe, but I don’t want to add too much feature creep here.

My concern is that I want to see a real world consumer for this feature. Do @robypez or @chirlu want to test this?


(Erlend Sogge Heggen) #15

Let’s keep that out of the initial PR then? so we’re not blocked on it.


(Erlend Sogge Heggen) #16

Thanks @mbcahyono!