ZIS Bundle: Parsing and sending an event to webhook.site

The following example bundle uses the Transform action to parse an event payload and put together a string which is then posted to a webhook.site.

The bundle allows you to see the incoming event payload ($.input) and other data available in the ZIS Flow object ($.subdomain, $.integration_key, $.account_id). See Data accessible to Actions in Flows.

{  "zis_template_version": "2019-10-14",  "name": "Simple event parser",  "description": "React to incoming events by parsing the entire payload and sending it to webhook.site",  "resources": {    "webhook_site.post_message_action": {      "type": "ZIS::Action::Http",      "properties": {        "name": "webhook_site.post_message",        "definition": {          "method": "POST",          "url.$": "https://webhook.site/{{$.path}}",          "requestBody": {            "text.$": "$.message"          }        }      }    },    "parse_and_dump_event_flow": {      "type": "ZIS::Flow",      "properties": {        "name": "parse_and_dump_event_flow",        "definition": {          "StartAt": "ParseEvent",          "States": {            "ParseEvent": {              "Type": "Action",              "ActionName": "zis:common:transform:Jq",              "Parameters": {                "expr": "[((. | to_entries) | map(\"\" + .key + \": \" + (.value | tostring)) | join(\",\") | tostring)]",                "data.$": "$"              },              "ResultPath": "$.webhooksite.message",              "Next": "PostMessageToWebhook_Site"            },            "PostMessageToWebhook_Site": {              "Type": "Action",              "ActionName": "zis:<YOUR_INTEGRATION>:action:webhook_site.post_message",              "Parameters": {                "path": "<WEBHOOK_SITE_PATH>",                "message.$": "A thing happened, and the incoming event payload is: {{$.webhooksite.message}}"              },              "End": true            }          }        }      }    },    "parse_and_dump_event_job_spec": {      "type": "ZIS::JobSpec",      "properties": {        "name": "parse_and_dump_event_job_spec",        "event_source": "support",        "event_type": "ticket.CommentAdded",        "flow_name": "zis:<YOUR_INTEGRATION>:flow:parse_and_dump_event_flow"      }    }  }}

Replace the following placeholders with your own values:

  • <YOUR_INTEGRATION> with the name of your integration
  • <WEBHOOK_SITE_PATH> with the unique identifier from a https://webhook.site/ test URL https://webhook.site/<WEBHOOK_SITE_PATH>. Example: 36cd21b5-8ed3-42e7-b524-6cd946c51ef8.