Incoming Webhook In MS Teams


This blog will help you to configure Incoming Webhooks and send messages to configured channels.
Incoming Webhook can be scoped to channel level.

How to configure Incoming Webhooks?

Configuring an incoming Webhook is very easy. It is just like filling in a form. To configure it follow the below steps.

Step 1
Hover over the channel where we need to add the Webhook and click on More options (…)
Step 2
Select Connectors from the fly out menu.
Step 3
Click on the Configure beside incoming Webhook.
Step 4
Enter the name of the Webhook and if we need to change the icon we can upload the associated image.
Click on Create button to create the Webhook.
Step 5
Copy the URL as this would be helpful for sending messages to the channel.

How to Send Messages Using Incoming Webhook ?

We would use the URL that we generated from the above section and do a post request with proper JSON data.

For the demo we would use Postman to send POST request.
Request Parameter
Verb = POST
URL = The URL copied from the previous section
Body = raw / JSON type
  1. {  
  2.   "@context""",  
  3.   "@type""MessageCard",  
  4.   "themeColor""0072C6",  
  5.   "title""<at>OutgoingWebhook<at> Visit the Outlook Dev Portal",  
  6.   "text""<at>OutgoingWebhook<at> Click **Learn More** to learn more about Actionable Messages!",  
  7.   "potentialAction": [  
  8.     {  
  9.       "@type""OpenUri",  
  10.       "name""Learn More",  
  11.       "targets": [  
  12.         { "os""default""uri""" }  
  13.       ]  
  14.     }  
  15.   ]  
  16. }   
In the body we have used Actionable Messages to learn more about actionable messages -- follow the below link
Final Outcome