No-code webhook integrations

The following is an example of a webhook integration using Low-code or No-code on the receiving server.

The IF This Then That (IFTTT) web application is used as an example here, but the general guidelines can also be applied to similar web applications such as Zapier.

When integrating 3rd party No-code web applications with webhooks, the following actions generally apply:

  • In the 3rd party application, set up the actions to be performed based on the event that will trigger the webhook.
  • In the 3rd party application, copy the URL as this will be used to set up the webhook in XProtect.
  • In XProtect Management Client create and set up the webhook, using the URL from the 3rd party application.
  • In XProtect Management Client, create the rule that will trigger the webhook for a given event.

Remember to test your event before deploying your changes.

Example - Send an email with IFTTT when an event is triggered

This example contains several procedures that illustrate how you can use the IF This Then That (IFTTT) web application to send an email message to a Gmail account when an event is triggered in your XProtect system.

1. Connect a webhook in IFTTT

First, create the IFTTT Applet that will send the Gmail message for the event and save the resulting URL.

You must create an IFTTT user in order to utilize the features of the IFTTT website.

  1. Go to the IFTTT website and log in with your IFTTT credentials.
  2. Create a new Applet: https://ifttt.com/create
  3. Set up the If This part:
    1. Click If This
    2. Search for Webhooks
    3. Click the blue Webhooks tile
    4. Click Receive a web request with a JSON payload
    5. Click Connect
    6. Write xprotect_test in Event Name
    7. Click Create trigger
  4. Set up the Then That part:
    1. Click Then That
    2. Search Gmail
    3. Click the blue Gmail tile
    4. Click Send yourself an email
    5. Click Connect
    6. Click Create action
  5. Click Continue
  6. Click Finish
  7. Go to https://ifttt.com/maker_webhooks
  8. Click Documentation
  9. Identify your URL. The URL should be something similar to: https://maker.ifttt.com/trigger/{event}/json/with/key/lPY4YYsvGSfTSJBM54MrDDSOGWTmk6z9VSD113hxoDY
  10. Replace {event} with xprotect_test. The URL should end up similar to: https://maker.ifttt.com/trigger/xprotect_test/json/with/key/lPY4YYsvGSfTSJBM54MrDDSOGWTmk6z9VSD113hxoDY
  11. Copy and save this address. The address should not be shared with unauthorized users.

2. Create a webhook in XProtect

After you have set up the applet in IFTTT, you must create the webhook in XProtect, using the URL you created in steps 9-11 above when setting up the IFTTT applet.

  1. In Management Client > Rules and Events > Webhooks, right-click Webhooks and select Add New…
  2. In Webhook Information:
    1. Name field: Enter “IFTTT Gmail”
    2. Address field: Set the address to the one from step 11 of the previous section. It should be something similar to: https://maker.ifttt.com/trigger/xprotect_test/json/with/key/lPY4YYsvGSfTSJBM54MrDDSOGWTmk6z9VSD113hxoDY
  3. Click Save in the toolbar to save the new webhook.

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 Gmail 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.
  6. Click Next to go to Step 2: Conditions.
  7. In Step 2: Conditions, apply any conditions relevant to the event you are creating.
  8. Click Next to go to Step 3: Actions.
  9. In Step 3: Actions, scroll down and select Send event info to <Webhook>.
  10. Click address on the Edit the rule description pane
  11. Add the IFTTT Gmail webhook and click OK.
  12. Click Next to go to Step 4: Stop criteria.
  13. In Step 4: Stop criteria, click Finish to create the rule.

4. Test the webhook from XProtect (Optional)

You should test the event to verify that the event triggers and sends the email as it should before utilizing the event and webhook in daily operations.

  1. Open Management Client > Rules and Events and click User-defined Events.
  2. Select Event High and click Test Event to test the event.
  3. Open the inbox of the Gmail account you specified in the IFTTT web application above to verify you have received the correct email with the event you triggered.

5. Changing the email content (Optional)

You can change the content of the existing email message sent through the IFTTT web application.

  1. Go to the IFTTT website and log in with your IFTTT credentials.
  2. Go to My Applets - IFTTT
  3. Click the If Maker Event ‘xprotect_test’, then ...Applet
  4. Click Settings
  5. Click Then
  6. Edit the text of the email subject or email body, for example rename the subject to Event High from XProtect
  7. Click Update action and then click Update.