manut
(Manuel Tancoigne)
January 28, 2025, 12:38pm
1
Hello !
I wanted to know if you’re interested by the implementation of a few webhooks for the Calendar plugin.
I can work on it if the community feels like it would be a good addition to the plugin…
That being said, it will take time as I cannot find a proper documentation on how to implement webhooks in a plugin, and will have to do some research
4 Likes
tvavrda
(Tomas Vavrda)
January 28, 2025, 12:54pm
2
Do you have some interesting use cases? What operations would you implement? Create/update/delete/event sign up/event sign out?
manut
(Manuel Tancoigne)
January 28, 2025, 1:56pm
3
Yes, these are the events I want to create for now; the use case being to trigger an external event management platform.
The next question will be to be able to accept hooks from the remote platform, but I may create a separate plugin for it as it can’t be generic (my first guess) unless we implement support for iCal format (but still, I already can see a lot of limitations to this).
1 Like
manut
(Manuel Tancoigne)
January 29, 2025, 9:28am
4
I found an official plugin with webhook extensions : GitHub - discourse/discourse-solved: Allow accepted answers on topics .
So I can start working on the implementation if there is no objection
manut
(Manuel Tancoigne)
January 29, 2025, 11:30am
5
I dug into the code and I found that’s not as easy as it should to add new webhooks.
Webhooks are part of a group of webhooks (I guess it’s for the admin and/or to namespace events)
For the Solved plugin, there are 2 webhooks: solved_accepted_solution
and solved_unaccepted_solution
, in the solved
group
Where it goes wrong is:
the solved
group is hardcoded in the WebHookEventType
model of Discourse
the two events are also hardcoded in the WebHookEventType
model of Discourse
I’ll see if and how I can manage to still declare new events without to have to touch to the Discourse code…