Meraki Webhooks & MS Teams

USMC92
Getting noticed

Meraki Webhooks & MS Teams

Created Incoming Webhook in our MS Teams environment; however, does not require a "secret" as it's anonymous.  Meraki dashboard requires to input a secret.  Does anyone know how to get around this?

25 Replies 25
HodyCrouch
Building a reputation

Meraki does not validate the secret.  Instead, the value is included in the payload sent to your environment.  It's up to you to validate the secret (if you choose to do so).

 

If you're not going to validate the shared secret, you can enter any value you want.

USMC92
Getting noticed

Yeah, I read that in a different article; however, my alerts are not showing up in my Teams environment.

Tim_Patrick_ADS
Here to help

I have the same issue, I have installed the incoming webhook connector into my teams channel, used the URL it generated and pointed the Meraki webhook to that URL. The alerts are not being delivered, yet if I use the E-mail address of the channel and set it as an alert recipient from the dashboard those messages do make it in.

 

Has any one gotten this integration working yet?

HodyCrouch
Building a reputation

I'm not using Microsoft Teams, so I don't have a good way to test that end of the integration.

 

However, I did a quick test yesterday with ngrok and a simple Node.js receiver.  It took a little longer than I expected for the notifications to start arriving, but it did eventually work.  I wasn't keeping close track, but I would guess that it was 10 or 15 minutes.

 

I set my webhook to receive configuration change notifications only.  I didn't add it to the top-level notification list.  I then toggled a setting on the notification page a few times to cause the notifications to go out.

 

Here's one of the notifications as an example to look at:

 

{  
   "alertData":{  
      "name":"Alerts",
      "url":"/manage/configure/alerts",
      "changes":{  
         "rogueAp":{  
            "label":"A rogue AP is detected",
            "oldText":"{\"enabled\":false}",
            "newText":"{\"enabled\":true}",
            "changedBy":"Someone (someone@company.com)",
            "ssidId":null
         }
      },
      "userId":123456
   },
   "alertId":"1234567890123456789",
   "alertType":"Settings changed",
   "occurredAt":"2018-10-29T14:41:39.953568Z",
   "organizationId":"654321",
   "organizationName":"Org Name",
   "organizationUrl":"https://n123.meraki.com/o/5pWeda/manage/organization/overview",
   "networkId":"N_1234567890123456",
   "networkName":"A Network Name",
   "networkUrl":"https://n123.meraki.com/A-Network-Name/n/HakdfJH/manage/nodes/list",
   "version":"0.1",
   "sharedSecret":"asharedsecret",
   "sentAt":"2018-10-29T14:51:47.623106Z"
}
DaMiBu
Conversationalist

anyone have this working with Microsoft Teams yet?

USMC92
Getting noticed

Negative

MCurtis
New here

Just checking to see if anyone has had any success with using the Meraki Webhooks with MS Teams?  I just tried configuring it this morning and the tests all fail.

JTe
Conversationalist

I have manage to do this with Microsoft flow. First create Microsoft flow with http receiver and then send that infromation as MessageCard format to MS Teams as webhooks.

MS FlowMS Flow

I am currently using combination of different Meraki webhooks in my HTTP receiver to get all information from Meraki.

 

{
    "type": "object",
    "properties": {
        "alertData": {
            "type": "object",
            "properties": {
                "kbTotal": {
                    "type": "integer"
                },
                "nodeTag": {
                    "type": "string"
                },
                "period": {
                    "type": "integer"
                },
                "usageThreshold": {
                    "type": "integer"
                },
                "vpnType": {
                    "type": "string"
                },
                "peerIdent": {
                    "type": "string"
                },
                "peerContact": {
                    "type": "string"
                },
                "connectivity": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "userId": {
                    "type": "string"
                },
                "changes": {
                    "type": "object",
                    "properties": {
                        "globalRecipients": {
                            "type": "object",
                            "properties": {
                                "label": {
                                    "type": "string"
                                },
                                "ssidId": {},
                                "newText": {
                                    "type": "string"
                                },
                                "oldText": {
                                    "type": "string"
                                },
                                "changedBy": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                },
                "countNode": {
                    "type": "integer"
                },
                "bssids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "minFirstSeen": {
                    "type": "integer"
                },
                "maxLastSeen": {
                    "type": "integer"
                },
                "countIsContained": {
                    "type": "integer"
                },
                "reason": {
                    "type": "string"
                },
                "wiredMac": {
                    "type": "string"
                },
                "mac": {
                    "type": "string"
                },
                "ip": {
                    "type": "string"
                },
                "connected": {
                    "type": "string"
                },
                "uplink": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "portDesc": {
                    "type": "string"
                },
                "portNum": {
                    "type": "integer"
                },
                "prevStatus": {
                    "type": "integer"
                },
                "status": {
                    "type": "integer"
                }
            }
        },
        "alertId": {
            "type": "string"
        },
        "alertType": {
            "type": "string"
        },
        "deviceMac": {
            "type": "string"
        },
        "deviceName": {
            "type": "string"
        },
        "deviceSerial": {
            "type": "string"
        },
        "deviceUrl": {
            "type": "string"
        },
        "networkId": {
            "type": "string"
        },
        "networkName": {
            "type": "string"
        },
        "networkUrl": {
            "type": "string"
        },
        "occurredAt": {
            "type": "string"
        },
        "organizationId": {
            "type": "string"
        },
        "organizationName": {
            "type": "string"
        },
        "organizationUrl": {
            "type": "string"
        },
        "sentAt": {
            "type": "string"
        },
        "sharedSecret": {
            "type": "string"
        },
        "version": {
            "type": "string"
        }
    }
}

Sending information to MS Teams is pretty simple operation. Just format and send it to MS Teams webhook address.

Flow2TeamsFlow2Teams

APittman
New here

Could you export/share out this MSFlow? We are having an issues getting this to work in our environment. 

 

thank you

JTe
Conversationalist

You can download exported Flow from https://1drv.ms/u/s!ArsWMmlHspG7yxdwMNUbomLve8tN

 

 

 

karthikD
Conversationalist

@JTe 

 

Would you provide step by step in setting up Flow to integrate the webhooks from Meraki. Please guide me , thanks a million in advance....

JRV
Here to help

Did you have any luck APittman? I'm getting failures on submitting a test webhook from Meraki using the flow in the thread.

JTe
Conversationalist

That test webhook is not working either in our dashboard, but if you just put that Flow url there and save configuration it will send those webhooks 🙂 

JRV
Here to help

Interesting. Thanks for the feedback! I'll give it a try.

 

J.R.

JRV
Here to help

Wanted to let you know that worked. Appreciate the tip!

Mikeyy
Comes here often

What adress did you use for the webhook? I don't understand what you mean with "the flow url", don't see it anywhere?

Ping @JTe @JRV 

Thanks,
Mike

JRV
Here to help

The first step in your flow should be an HTTP receiver. There is where an incoming URL is created for you to use with your webhooks.

Mikeyy
Comes here often

Thanks for the reply. Yeah, I've made a copy of the imported flow so it should have its unique webhook (in my case https://prod-114.westeurope.logic.azure.com:443/w........) but Meraki dashboard does not want to send anything to it? hook.PNGhook2.PNG

 

What am I missing? 🙂

JRV
Here to help

Are you using the test webhook functionality on the Meraki dashboard? If so, it doesn't work and you'll have to wait for an alert to be generated or shut down an AP for a few until it trips an alert.

MarkD_BT
Getting noticed

Hi, the system works I haven't had a problem with that. It's how to format a response which is a

alertType Settings changed.
The structure of these responses which have caused issues as can't figure out a way to get these to display nicely.

 

for example multiple port changes here is the information received in flow which Meraki generates. The following id for a field switchPort138034122919267. You need this to get label, old / new text. Can't figure out how to read this value to then use the value to get the information contained within it.

 

{
"alertData": {
"name": "Switch ports",
"url": "/manage/configure/switchports",
"changes": {
"switchPort138034122919267": {
"label": "Secondary Outer Switch - SSOC-CFT-PoC / 7",
"oldText": {
"port": [
"enabled"
]
},
"newText": {
"port": [
"disabled"
]
},
"changedBy": "Mark Davis ()",
"ssidId": null
},
"switchPort138034122919268": {
"label": "Secondary Outer Switch - SSOC-CFT-PoC / 8",
"oldText": {
"port": [
"enabled"
]
},
"newText": {
"port": [
"disabled"
]
},
"changedBy": "Mark Davis ()",
"ssidId": null
},
"switchPort138034122919269": {
"label": "Secondary Outer Switch - SSOC-CFT-PoC / 9",
"oldText": {
"port": [
"enabled"
]
},
"newText": {
"port": [
"disabled"
]
},
"changedBy": "Mark Davis ()",
"ssidId": null
}
},
"userId": xxxxxx
},
"alertId": "695806142430688260",
"alertType": "Settings changed",
"occurredAt": "2019-01-25T14:31:05.361531Z",
"sentAt": "2019-01-25T14:41:07.378277Z"
}

Gary_OIT
New here

@Mikeyy

 

Don't forget to add the 'test' user shown in your example to the list of recipients at the top of the page (as I did) otherwise you won't receive any triggers.

 

 
 

 

MarkD_BT
Getting noticed

I had a similar setup but more convoluted with many conditions to filter the type so was handy finding out about this switch to handle it. Problem i still have is settings changed which has different formats and information within it anyone got a good way for handling settings changes?

 

Thanks

 

Mark

Angus
Comes here often

Thanks for this Powerflow app. I am getting this error when the Meraki webhook calls the MS Flow. Can someone please help me understand why this error is showing?

 

Angus_0-1586141499116.png

 

 

 

<!DOCTYPE html>
<html>
<head>
<title>The resource cannot be found.</title>
<meta name="viewport" content="width=device-width" />
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:pointer; }
@media screen and (max-width: 639px) {
pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
}
@media screen and (max-width: 479px) {
pre { width: 280px; }
}
</style>
</head>

<body bgcolor="white">

<span><H1>Server Error in '/webhook' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>The resource cannot be found.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
<br><br>

<b> Requested URL: </b>/webhook/...<br><br>

</font>

</body>
</html>

Angus
Comes here often

Typo in my URL. Disregard this.
MyHomeNWLab
A model citizen

FYI.

 

This topic is very helpful. And, it is easy to get hits from search engines.

So I'll share some recent new information.


If you use the Webhook Payload Template (Beta feature), you can send alerts directly from Meraki to Microsoft Teams.

 

Now in beta! Webhook Payload Template Editor Dashboard GUI page - The Meraki Community
https://community.meraki.com/t5/API-Early-Access-Announcements/Now-in-beta-Webhook-Payload-Template-...

 

You must be a member of the API Early Access Group to view the topics above.

 

API Early Access Group - The Meraki Community
https://community.meraki.com/t5/API-Early-Access-Group/gh-p/api-early-access

 

I was confusing "Webhook Payload Template" with "Webhook Payload Template Editor".

 

[Sample Alerts]

MS_Teams_Alert_Sample.jpg

[Meraki Settings (Key Point)]

Enable "Early API Access".

Without customization, activation of Early API Access was not required.

Early_Access.jpg

 

"Payload template" setting will be displayed.

Set to "Microsoft Teams (included)".

Sample_Meraki_Webhook_Setting_01.jpg

 

Don't forget to specify webhook in "Default recipients".

Sample_Meraki_Webhook_Setting_02.jpg

 

 

Memo: I used "Incoming Webhook" for the Microsoft Teams side.

Get notified when there are additional replies to this discussion.