Coder Social home page Coder Social logo

codefaceio / webhook-payload-templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from meraki/webhook-payload-templates

0.0 0.0 0.0 3.73 MB

A collection of Webhook Payload Templates and related integration docs.

Python 47.66% Liquid 52.34%

webhook-payload-templates's Introduction

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.

Node-RED

  • node-red-webhook-payload.flows.json A Node-RED flow to help test and manage payload templates

Python

  • CRUD_Webhooks.py A python script to manage payload templates in a Meraki organization

    Navigate into the integration directory, then run the python script (from its relative directory).

    cd webex
    ../CRUD_Webhook.py
    
    
    
    
                                   ./(((((((((((((((((/.
                              *(((((((((((((((((((((((((((((
                           .(((((((((((((((((((((((((((((((((((/
                         ((((((((((((((((((((((((((((((((((((((((/
                       ,((((((((((((((((((((((((((((((((((((((((((((
                     .((((((((((((((((((((     ((((((/     ((((((((((,
                    ((((((((((((((((((((((     ((((((/     (((((((((((
                 /((((((((((((((((((((((((((((((((((((((((((((((((((((
                ((((((((((((((((((((((((((((((((((((((((((((((((((((((*
               ((((((((((((((((((((((((((((((((((((((((((((((((((((((((
              (((((((((((((((((((((((((((((((((((((((((((((((((((((((((
             ((((((((((((((((((((((((     ((((((((((((((/     (((((((((
            ,((((((((((((((((((((((((     ((((((((((((((/     ((((((((/
            (((((((((((((((((((((((((    .//////////////*    .((((((((
           ,(((((((((((((((((((((((((((((/              ((((((((((((.
           ((((((((((((((((((((((((((((((/              (((((((((((
           (((((((((((((((((((((((((((((((((((((((((((((((((((((((*
          .(((((((((((((((((((((((((((((((((((((((((((((((((((((*
          /((((((((((((((((((((((((((((((((((((((((((((((((((*
          (((((((((((((((((((((((((((((((((((((((((((((((*
          (((((((((((/.                     ....
          (((((((/
          (((((
          (((
          /.            Welcome to the power of the Meraki API
    
    
      This is a demo on how to manage custom Webhook-payloadTemplates
      If you like to upload your custom Webhook-payloadTemplate,
      the headers.liquid and body.liquid file needs to be in the same dir as this script.
    
                The use of this tool is on your own risk.
    
      Please visit:  https://meraki.io
    
    
    
          Press Enter to continue
    
    
    ```
    

webhook-payload-templates's People

Contributors

0x2142 avatar davidnmbond avatar dexterlabora avatar pdath avatar rahmaniftaliyev avatar yujiterada avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.