2. Create a webhook in XProtect
After you have started the server, you must create the webhook in XProtect.
1. In Management Client > Rules and Events > Webhooks, right-click Webhooks and select Add New…
a. In Webhook Information:
b. Name field: Enter Python integration
c. Token (optional) field: Enter the token string you copied into the main.py file.
d. Address field: Set the address of the receiving server.
If you installed Python on the same machine where the Event Server, enter http://127.0.0.1:5000/webhooks
If you installed Python on a server with a public IPaddress, enter https://<IP>:5000/webhooks where <IP>is the
IPaddress of the server with a public address.
For Python installed on machines without public addresses, see the section below.
You can use http:// instead of https://, but using http:// through non-secure networks may expose event data in plain text.
Using the more secure https://is strongly recommended..
2. Click Save in the toolbar to save the new webhook.
For Python on machines without public addresses
If you installed Python on a machine on a different network and without a public IPaddress, for example on a development or testing
machine, you can use NGrok for testing purposes.
1. Install https://ngrok.com/ on the same machine you installed Python on.
2. On your machine, locate and run ngrok http 5000
3. Copy the generated public address and insert the address in the Address field above. The NGrok public address should be
something similar to: https://0c60-12-212-221-50.eu.ngrok.io
3. Trigger the webhook with a rule in XProtect
After you have created and set up a webhook, you must create and set up an event to trigger the webhook.
1. In Management Client > Rules and Events > Rules, right-click Rules and select Add Rule… to start the Manage Rule wizard
at Step 1: Type of rule.
2. In Step 1: Type of rule > Name field, enter Send Event High to Python and add an optional description of the rule in the
Description field.
3. In the Select the rule type you want you create pane, select Perform an action on <event>
4. In the Edit the rule description pane, click event and in Events > External Events > User-defined Events, select Event High.
5. Click OK to create the event.