Setup Webhooks when Shinobi has an Internal Event
Shinobi can do a web request when something happens internally.
This document assumes you have at least one monitor setup.
Please be aware there is 2 webhook mechanisms in Shinobi. The one that stands alone in the Monitor Settings will be deprecated in the future. Please be sure to follow this guide to use the proper one.
Difference between Inner Events (Internal Events) and just Events
Since the creation of Shinobi we used "Events" to describe the result of a successful detection with something like Motion Detection or Object Detection.
Webhooks have "Inner Events" which describes the general result of any kind of action within the system. We are going to discuss Inner Events in this article.
Setup the Webhook
In your Account Settings you will have a section labelled "Webhook". Here you can set the web endpoint Shinobi will run the request to.
Notice the parameters in brackets. These need to be included in your URL as shown.
http://your-webhook-point/onEvent/{{INNER_EVENT_TITLE}}?info={{INNER_EVENT_INFO}}
- INNER_EVENT_TITLE : Provides a simple type name for the event.
- INNER_EVENT_INFO : Provides a JSON object with other details regarding the event.
In your Monitor Settings you will see a Notification section. Enable Webhook here to get information about the monitor. At the time of writing this article you can get webhooks requests when a Monitor has died.
Detector events will automatically be sent through this request method. No other configuration is required for them.
Once configured Save the settings for them to become active.