Microsoft Teams Webhook Notifications

You can set Teams notifications triggered by direct message/mention chats sent to you.
Admins can also configure Teams notifications with  various triggers.

 

Advance Preparation

  • Microsoft Teams administrator privileges are required.
  • Prepare a Microsoft Teams team or channel to be notified.

 

Teams Settings

1. Open Teams

2. Select "Apps" from the menu on the left, search for the word "webhook"

スクリーンショット 2024-09-11 午後3.42.45.png

3. Click "Post to a channel when a webhook request is received" that appears in the Workflows section

4. Enter your webhook name and click "Next"

5. Select a Team and Channel as a notification destination and click "Add workflow"

6. Copy the URL and click "Done" to close the screen

スクリーンショット 2024-09-11 午後3.48.04.png

8. Perform settings on the ovice side

Please proceed to one of the steps below.
Set notifications for mention chats   ( can be set by  administrators and members )
Set notifications for various triggers   ( can  only be set by administrators )

 

ovice Settings (set mention chat notifications)

9. Open ovice and go to Personal Settings -> Integrations

10. Paste the contents of Teams setting  step 6 in the hook URL

11. Copy and paste the following character string into the post data and click Save

{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content": {
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.4",
"body":[
{
"type": "TextBlock",
"wrap": true,

"text": "{{name}} sent a message {{message}}"
}
],
"msteams": {
"width": "Full"
}

}
}
]
}


*The part of the string that says "{{name}} sent a message: {{message}}" can be changed to any message. See below for details.
Webhook Post Data

 

ovice Settings (set notifications with various triggers)

9. Click "Space Settings" → Integrations

10. Click the + button of Webhook

11. Select Trigger

Please refer to the following and select the trigger to be notified.
Configurable triggers

12. Paste the contents of Teams setting step 6 in the web hook URL

13. Copy & Paste the following strings to Post data

{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content": {
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.4",
"body":[
{
"type": "TextBlock",
"text": "CHANGE HERE LATER"
}
]
}
}
]
}

15. Edit the "CHANGE HERE LATER" part of the string

This part will be displayed in the notification on the Teams side. Please change it to any notification message depending on the type of web hook. You can also include information obtained from ovice in the notification message. For details, see below.
Webhook Post Data

 

Tips

  • With this setting, you don't need to enter the header data on the ovice side.
  • If you have selected a private channel as the Teams channel to notify, change the poster information using the following method.
    1. Open the workflow management screen (Microsoft support page)
    2. Click "Edit" from the three dots on the relevant flow
    3. Click "Send each adaptive card" > "Post card in a chat or a channel"
    4. Change the poster to "User" and click "Save"

Articles in this section