Skip to main content

Looking for a configuration example for sending webhook notifications to Teams channel.

Assuming you've already set up an incoming webhook in Microsoft Teams and got the webhook URL, the trick is to get the correct format which MS Teams expects.

The trick is that MS Teams expects a specific JSON structure. This worked for me using custom format:

Format: Custom

Source expression: `{"text":"${_raw}"}`

328_486a175df68247ef8a81064f1b2eb971.png

https://webhook.site/ is an excellent resource for testing what the output of your webhook post looks like (assuming there is nothing sensitive, of course).

Note: Looks like compression needs to be turned off as well.


Hi Eugene - we were struggling to set this up.  Maybe you can point us in the right direction.  Can you help us understand exactly what you did on MS teams to match the JSON schema for this source expression?

 

this?
 

{
"text": {
"type": "string"
}

}

 

Here’s what we see defaulted - which i assume needs to be changed, but were not sure exactly what to.


Full Schema we see that is defaulted

{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"contentType": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"type": {
"type": "string"
},
"version": {
"type": "string"
},
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
},
"required": u
"type"
]
}
}
}
}
},
"required": u
"contentType",
"content"
]
}
}
}
}

 


rallen - This is an older post moved from a legacy system (this site does not allow for timestamps to be changed) so Eugene’s response may no longer be valid.  I’ll ask around to see if someone can give an updated example. 


Reply