Skip to main content

๐Ÿ”— Link unfurling

Link unfurling lets your app respond when users paste URLs into Teams. When a URL from your registered domain is pasted, your app receives the URL and can return a card with additional information or actions. This works like a search command where the URL acts as the search term.

note

Users can use link unfurling even before they discover or install your app in Teams. This is called Zero install link unfurling. In this scenario, your app will receive a message.ext.anon-query-link activity instead of the usual message.ext.query-link.

Setting up your Teams app manifestโ€‹

"composeExtensions": [
{
"botId": "${{BOT_ID}}",
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"www.test.com"
]
}
}
]
}
]

When a user pastes a URL from your registered domain (like www.test.com) into the Teams compose box, your app will receive a notification. Your app can then respond by returning an adaptive card that displays a preview of the linked content. This preview card appears before the user sends their message in the compose box, allowing them to see how the link will be displayed to others.

Handle link unfurling when a URL from your registered domain is submitted into the Teams compose box.

createLinkUnfurlCard() function

The link unfurling response includes both a full adaptive card and a preview card. The preview card appears in the compose box when a user pastes a URL:

Screenshot showing a preview card for an unfurled URL in the Teams compose box.

The user can expand the preview card by clicking on the expand button on the top right.

Screenshot of Teams compose box with an outline around the unfurled link card labeled 'Adaptive Card'.

The user can then choose to send either the preview or the full adaptive card as a message.

Resourcesโ€‹