How to send Message Notification on Microsoft Teams channel — Rest API & Webhook
Feb 26, 2023
Step By Step Guide to setup MS Team Webhook & Rest API
First, we need to open the channel, where we need to add the communication webhook.
On the channel, click on 3 dots(kebab menu) and click on Connectors
Search for Incoming webhook
Enter webhook name and upload icon image:
Click on create and then it will generate the webhook URL.
Message:
JSON Message Format:
{ "text": "My Test Message example"}
JSON Message + IMAGE Format:
{
"@type": "MessageCard",
"text": "My Test Message example",
"sections": [
{
"images": [
{
"image": "{BASE-64-IMAGE}"
}
]
}
]
}
Example:
Sending HTML Table Message:
{"text":"<b>Test Suite</b><table border=1><tr><th>Company</th><th>Contact</th><th>Country</th></tr><tr><td>AlfredsFutterkiste</td><td>MariaAnders</td><td>Germany</td></tr><tr><td>CentrocomercialMoctezuma</td><td>FranciscoChang</td><td>Mexico</td></tr><tr><td>ErnstHandel</td><td>RolandMendel</td><td>Austria</td></tr><tr><td>IslandTrading</td><td>HelenBennett</td><td>UK</td></tr><tr><td>LaughingBacchusWinecellars</td><td>YoshiTannamuri</td><td>Canada</td></tr><tr><td>MagazziniAlimentariRiuniti</td><td>GiovanniRovelli</td><td>Italy</td></tr></table>"}