🔗 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 usualmessage.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
Handle link unfurling when a URL from your registered domain is submited 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:
The user can expand the preview card by clicking on the expand button on the top right.
The user can then choose to send entire the preview or the full adaptive card as a message.