/symhook

Symhook is incoming webhook of Symphony. You can integrate with any app which has a notification function or you can write http request in your app and integrate it.

Primary LanguageGoMIT LicenseMIT

Symhook

Symhook is incoming webhook of Symphony.
You can integrate with any app which has a notification function or you can write http request in your app and integrate it.

Demo

  1. Add a Symhook service account to any room in which you want to get notification from an integrated app.

  2. Send a message /webhook and get a webhook URL from Symhook.

  3. Copy the URL and paste it to notification setting page of an app you want to integrate.
    *Choose Slack in Type.
    e.g.) This is notification setting page in Grafana

  4. That's it! Just wait for notifications.

Installation & Usage

  1. You can pull Symhook docker image using the following command.
    docker pull keitamizuno/symhook

  2. Symhook works as a Symphony bot so do what you need to do when you create Symphony bots.

  3. Make config directory and put your config.json and rsa-private.key.

    mkdir config
    cp config.json <your-privatekey-name>.pem config
    
  4. Run Symhook
    docker run -p 8445:8445 -v /<path-your-config-folder>/config/:/config/ -e FQDN_IP="<mysymhook.com>" keitamizuno/symhook

    FQDN_IP : your symhook's FQDN or IP address.

Note

Integration with apps that have notification function.

There are many apps can send a notification message to chat apps by REST API.
In integration or notification setting page of those, you can choose what type of chat (or mail) app to send.
Most of the cases, you can find Slack type (since Slack is the one of most popular chat application) and choose it.

Symhook converts Slack format messages to Symphony format (MessageML Format) and sends the converted message to Symphony pod.
*However, not all of the Slack format are supported. I will add a list of what is supported and not supported.

Integration with apps you created.

If you want to integrate apps you created you can just write HTTP requests in your code.

  • Header
    "Content-Type" : "application/json"
  • Body - You can write anything as MessageML Format
    "text" : "<Message Text In MessageML Format>"
    e.g.)
    {
        "text" : "<card iconSrc="url" accent="tempo-bg-color--blue">
                    <header>Card Header. Always visible.</header>
                    <body>Card Body. User must click to view it.</body>
                  </card>"
    }
    
    *It doesn't need <MessageML> tag.
    *You can write a message of Slack format but remember that MessageML Format is much easier for simple notification messages.

Author

License

Symhook is under MIT license.