emqx-web-hook icon indicating copy to clipboard operation
emqx-web-hook copied to clipboard

How to subscribe to a web hook?

Open jwillmer opened this issue 6 years ago • 6 comments

Based on my knowledge about web hooks I need to subscribe to a web hook first by giving him a URL he should send the payload to. I don't see how to do this in your README.

jwillmer avatar Dec 23 '17 13:12 jwillmer

@jwillmer do changes in config file. Config file for emq-web-hook located in plugins/emq-web-hook.

s4kibs4mi avatar Dec 23 '17 14:12 s4kibs4mi

Yes, I know the config. The config is also posted in the README. I am asking for how do I subscribe 1-n applications to the web hooks. I guess the reference to the config means that as of now this is a manual process that can't be done via web interface?

jwillmer avatar Dec 23 '17 16:12 jwillmer

@jwillmer Understood. Till now it works as 1-1 application. if you check config there is option to add one endpoint. You can use a middleware who will consume webhook's request and distribute among n applications.

s4kibs4mi avatar Dec 24 '17 10:12 s4kibs4mi

@emqplus can we use endpoint as array than string ? Then it will be possible to send request to multiple applications for an event of webhook.

s4kibs4mi avatar Dec 24 '17 10:12 s4kibs4mi

I lately design my own web hook endpoint for a web application. I oriented myself on the excellent work of pipedrive.com. Below you can see some screenshots of there web UI for creating and managing web hooks.

pipedrive ui 1

pipedrive ui 2

The point is that you can subscribe to defined events. I am not interested in all events. I only like to be notified about one - maybe I even don't care about the payload instead I just do something then I get notified. This brakes if you just send notifications for all events.

jwillmer avatar Dec 24 '17 11:12 jwillmer

@jwillmer only keep the events in config file you want to get notified. Remove the events from config those are not necessary.

s4kibs4mi avatar Dec 24 '17 11:12 s4kibs4mi