/meraki-webhook-payload-templates

A collection of Meraki Webhook Templates.

Primary LanguageLiquid

meraki-webhook-payload-templates

This is a collection of Meraki Webhook Payload Templates.

Each folder consists of one integration which includes a couple of key files.

  • /integration/

    • readme.md

      Description of the template, links to the related API service and screenshots of results.

    • body.liquid

      The body template file

    • headers.liquid

      The headers template file

Alert Types

The template files will leverage the Liquid language and render the final results based on the alertType that is sent via the webhook.

  • alertTypes.json
    Included sample of alert types and the variables that are available to the template.

Using Liquid Templates

The Liquid template language provides a number of options to present and transform the data. For more information and helpful tools, checkout these resources.

Liquid Docs

Liquid for Designers

Meraki Liquid Filters

In addition to the standard Liquid filters, Meraki has provided a few extras for helpful tasks. Use these by appending a pipe and the name of the filter

alertData | jsonify

jsonify

Converts a JSON object into a JSON string.

Hint, if you see [Object object] try using this

alertData | jsonify

--- Returns ---

{"portNum":3,"description":"Gigabit link negotiation failed","status":"10 Gbps","prevStatus":"100 Gbps","portDesc":"Corp Access"}

json_markdown

Converts a JSON object into a markdown friendly view of the keys and values and avoids clashing when nested in other JSON.

alertData | json_markdown

--- Returns ---

portNum: 3
description: Gigabit link negotiation failed
status: 10 Gbps
prevStatus: 100 Gbps
portDesc: Corp Access

REST API

Using the Dashboard API, the templates can be uploaded, managed, tested and applied.

Payload Templates

get /networks/{networkId}/webhooks/payloadTemplates getNetworkWebhooksPayloadTemplates
post /networks/{networkId}/webhooks/payloadTemplates createNetworkWebhooksPayloadTemplate
get /networks/{networkId}/webhooks/payloadTemplates/{payloadTemplateId} getNetworkWebhooksPayloadTemplate
delete /networks/{networkId}/webhooks/payloadTemplates/{payloadTemplateId} deleteNetworkWebhooksPayloadTemplate
put /networks/{networkId}/webhooks/payloadTemplates/{payloadTemplateId} updateNetworkWebhooksPayloadTemplate

Webhook Tests

post /networks/{networkId}/webhooks/webhookTests createNetworkWebhooksWebhookTest
get /networks/{networkId}/webhooks/webhookTests/{webhookTestId} getNetworkWebhooksWebhookTest

Webhook HTTP Servers

get /networks/{networkId}/webhooks/httpServers getNetworkWebhooksHttpServers
post /networks/{networkId}/webhooks/httpServers createNetworkWebhooksHttpServer
get /networks/{networkId}/webhooks/httpServers/{httpServerId} getNetworkWebhooksHttpServer
put /networks/{networkId}/webhooks/httpServers/{httpServerId} updateNetworkWebhooksHttpServer
delete /networks/{networkId}/webhooks/httpServers/{httpServerId} deleteNetworkWebhooksHttpServer

Utilities

A graphical web app to build and test template files.

Run in Postman

  • Webhooks Management.postman_collection.json

    A postman collection for the related Meraki API operations to manage webhooks is included in this folder.