balzack / databag

fast & lightweight self-hosted messenger
Apache License 2.0
903 stars 49 forks source link

API for bots #80

Open turnercore opened 8 months ago

turnercore commented 8 months ago

I would love to see this project get an API for bot usage so a NodeRED or HomeAssistant (or whatever else) bots could use the messaging and notification systems of Databag. That way people wouldn't have to use Telegram or Discord and can stay on the self-hosted side of things.

balzack commented 8 months ago

In the doc folder there is an open api spec file (.oa3), it is up to date, but inadequate in terms of documentation.

In the next few weeks I plan to push a browser app update, following that I will focus on a proper design doc, which will explain the data architecture with API sequence diagrams.

I may need add some functionality in the API to support bots properly, but this should be fine and has happened several times as more use cases are supported.

Thanks again for your interest in the project!

turnercore commented 8 months ago

Thanks this is great info, I haven't dug into the project enough to know if there was an un/underdocumented api or if it didn't exist. I think just making another account on my server and letting it send me messages would be the main thing I could make a bot work with. Obviously there are other endpoints that may be useful to add for just bot use, but if there are endpoints to send and receive messages/attachments then I think that would cover most use cases.

I'll have to dig into it if I get the time, I'll do a write up on how to connect it to nodeRED if I end up doing it.