caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
673 stars 61 forks source link

Webhook Support #97

Closed DunklerPhoenix closed 1 year ago

DunklerPhoenix commented 1 year ago

Heho There are some tools I can't use with apprise. E.g. Overseer It supports webhooks so it would be great if apprise-api has an endpoint for receiving messages in json-webhook format.

brave_0w5QGSQ9Bf

EDIT: Added Screenshot in english EDIT2: I thought a little bit about that. The implementation would be quite difficult. It needs a template support to support every webhook, because not every service gives you the option to create the webhook payload like overseer. EDIT3: Someone created something like that https://github.com/camalot/apprise-webhook

caronc commented 1 year ago

Is there a common webhook JSON format that all services tend to use? Maybe this is just a matter of adding a webhook/notify url to compliment the /notify one?

DunklerPhoenix commented 1 year ago

I don't think so. :/

mrtwnklr commented 1 year ago

I have the same use case: support an application that has a fixed json payload. In my case it is Grafana.

Recently I wrote a tiny python tool, similar to the linked camalot/apprise-webhook one. The difference is: camalot/apprise-webhook allows to modify the message-field of the Apprise notification payload. apprise-it-for-me allows to provide a complete mapping to the Apprise notification payload via custom python code.

Enough advertisement ;)

It's documented and should be easily extendable. Maybe it can help you using Overseer with Apprise.

caronc commented 1 year ago

So to work with Overseer, i just need a endpoint that passes it's payload via JSON? Just curious how that differs from what is here already?

Are there mandatory tag names or a JSON schema i need to accept outside of the one already built in?

DunklerPhoenix commented 1 year ago

https://docs.overseerr.dev/v/master/using-overseerr/notifications/webhooks

That would be the format for overseer, but because every webhook system is different, it would be better to make a dynamic webhook system I think where you can assign values via template. (Of course this would be a bit complicated. See https://github.com/mrtwnklr/apprise-it-for-me)

At the moment i don't know what is already implemented ^^'

caronc commented 1 year ago

Closing this ticket off as the requested webhook support has been added.