Incoming webhook on Microsoft Teams

Osvaldo González Venegas
2 min readDec 14, 2020

Hello everyone, in this post i’m going to explain how to send messaging webhooks using Microsoft Teams

What are incoming webhooks in Teams?

Incoming webhooks are special type of Connector in Teams that provide a simple way for an external app to share content in team channels and are often used as tracking and notification tools. Teams provides a unique URL to which you send a JSON payload with the message that you want to POST, typically in a card format. Cards are user-interface (UI) containers that contain content and actions related to a single topic and are a way to present message data in a consistent way. Teams uses cards within three capabilities:

  • Bots
  • Messaging extensions
  • Connectors

Add an incoming webhook to a Teams channel

choose your custom channel to configure the incoming webhook, go to options and connectors

then, select incoming Webhook

Set a custom Name for the webhook and also you can customize the image

2. once done the previous step, Microsoft Teams will provide a webhook URL.

you will be able to test the integration using this sample code (nodeJS)

const request = require('request');const options = {'method': 'POST','url': WEBHOOK_URL,'headers': {'Content-Type': 'application/json'},body: JSON.stringify({"summary":"Hello World info","@type":"MessageCard","@context":"https://schema.org/extensions","themeColor":"#00e07f","sections":[{"title":"Hello World","activitySubtitle":"9/13/2016, 3:34pm","facts":[{"name":"Hi:","value":"Reader"},{"name":"Message:","value":"greetings you from a webhook"}]}]})};request(options, function (error, response) {if (error) throw new Error(error);console.log(response.body);});

3. Results

Remove an incoming webhook from a Teams channel

  1. Navigate to the channel where the webhook was added and select (•••) More Options from the top navigation bar.
  2. Choose Connectors from the drop-down menu.
  3. On the left, under Manage, choose Configured.
  4. Select the number Configured to see a list of your current connectors.
  5. Select Manage next to the connector that you want to delete.
  6. Select the Remove button and you will be presented with a Remove Configuration dialog box.
  7. Optionally, complete the dialog box fields and checkboxes prior to selecting the Remove button. The webhook will be deleted from the team channel.

Official doc:

https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook

--

--

Osvaldo González Venegas

Software Engineer | Tech enthusiast, Node Js Developer & Cloud Expert