Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

“entry.unlocked” is the event type that will trigger the rule:

Code Block
{
  "nameversion": "Send Openpath event to Slack1.0",

 "description": "Notify Slack when front foor unlocks",
  "trigger": {
    "properties": {
      "event": {
        "enum": [
          "entry.unlocked"
        ]
      },
      "required": [
        "event"
      ],

Replace “####” with entry IDs to only trigger the rule when specific entries unlock.

Code Block
      "data": {
        "requiredallOf": [
          {
            "entryIdsproperties": {
       ],       "_type":  "properties": {entry",
              "entryIds": {
                "contains": {
                  "enum": [
                    ####
                  ]
                }
              }
            }
          }
        ]
      }
    }
  },

Replace the URL below with your app’s Webhook URL.

Code Block
  "variablesrequests": [
    {
      "nametype": "base_urlhttp",
      "valueblocking": "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXXXXXXX"false,
    }  "preRequestDelaySeconds": ]0,
      "curlOptshttpParams": {
        "followLocationheaders": false,[
    "maxRedirs": 10,     "autoReferer": trueUser-Agent: Openpath/Rules Engine",
    "ssl_verifyPeer": 0,     "connectTimeout"Content-Type: 10,application/json"
    "timeout": 10,   ],
 "httpHeader": [       "method"Content-type:application/json": "post",
    ]    },

...

"url": "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXXXXXXX",

“body” is the data that will be sent to the specified Slack channel. If you’d like to format this differently, refer to Slack’s documentation. For an example of what this notification looks like, see below.

Note: To include a link to your organization’s Entry Activity Report, replace the ### in /o/###/reports in the example below with your OrgId.

Code Block
languagejson
  "requests": [
    {
      "curlOpts": {
        "post": 1,
        "postFields": "body":"{\"username\":\"openpath\",\"icon_emoji\":\":openpath:\",\"channel\":\"webhooktest\",\"text\":\"{{event.event}} {{event.timestamp}} {{event.data.org.name}} {{event.data.entries.0.name}} Unlocked using {{event.data.requestType}} {{event.data.connectionType}} by {{event.data.userId}} at {{event.data.requestTimestamp}}\",\"attachments\":[{\"color\":\"warning\",\"title\":\"Click here to see Entry Report\",\"title_link\":\"https://control.openpath.com/o/###/reports/entryActivity\"}]}",
        "url": "{{base_url}}"
      }
    }   ]
}
Iframe
allowfullscreentrue
srchttps://info.openpath.com/hubfs/images/kustomer-articles/slack-webhook.png
width700
frameborderhide
titleslack-webhook
alignmiddle
height223
longdescslack webhook

...