Microsoft Teams Webhooks with Jamf

igorman
New Contributor II

Hello,

I set up the following four webhooks for testing within my JAMF server (Global Management -> Webhooks), they are as follows:

Notify on MobileDeviceEnrolled (JSON)
Notify on MobileDeviceUnEnrolled (JSON)
Notify on JSSShutdown (JSON)
Notify on JSSTartup (JSON)
REQUEST.BIN TEST (JSON)

These tie into our Microsoft Teams chat client, specifically using the 'Incoming Webhook' connector. The URLs provided are accurate and triple checked.

Any of these events that occur generate a webhook, which was verified with REQUEST.BIN, however, I am not notified in Microsoft Teams.

JAMF Support initially had me change the Webhook from XML to JSON, but there was no success.

Any suggestions?

8 REPLIES 8

dgreening
Valued Contributor II

<subscribed>

hkabik
Valued Contributor

Keeping an eye on this as well.

dan-snelson
Valued Contributor II

"Paging @brysontyrrell …"

BrysonTyrrell
Contributor II

@ian2buckz I'm going to assume you're using the inbound webhooks for MS Teams to create cards?

https://dev.outlook.com/Connectors/GetStarted

Support only got you part of the way. Check out this guide here:
https://dev.outlook.com/Connectors/GetStarted#post-a-card-to-the-webhook

The cards you're creating need to have the following JSON format:

{
    "title": "<optional>",
    "text": "",
}

You need an in-between service to take the webhook event from the JSS and translate it into the format MS Teams wants for new cards.

Jamf Pro --> Webhook fires --> Your service translates --> Post to MS Teams

Likely you'll also want to do some formatting on the string that becomes the "text"* value. The cool thing is, it looks like from Microsoft's example you can leverage markdown for getting in some rich text.

Check out the dev docs on card objects:
https://dev.outlook.com/Connectors/reference

igorman
New Contributor II

@brysontyrrell

OK. Got cURL up and running, this is where I am at:

curl -H "Content-Type: application/json" -d "{"text": "Hello World!"}" <YOUR WEBHOOK URL>

I understand in <YOUR WEBHOOK URL> is where I place my URL.

How do I get your format in the command line properly?

BrysonTyrrell
Contributor II

@ian2buckz the <YOUR WEBHOOK-URL> would be the URL to the MS Teams connector webhook you created.

But, you can't use cURL for this on its own. You need a receiver to take the JSON from Jamf Pro webhook and then make a POST to to the MS Teams webhook.

Check out some examples here:https://github.com/brysontyrrell/Example-JSS-Webhooks

igorman
New Contributor II

Ahh. Well, this is a project for another day.

Thanks!

Ahadub
New Contributor III

any tips for using the Jamf Pro > Settings > Webhooks with Microsoft Teams? 

I made an entry in Jamf with the webhook URL and specified JSON (the other choice is xml) and I am not seeing anything in MS Teams.