Unfurlink Link (Adaptive card) in

%3CLINGO-SUB%20id%3D%22lingo-sub-2020064%22%20slang%3D%22en-US%22%3EUnfurlink%20Link%20(Adaptive%20card)%20in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2020064%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3EWe%20try%20to%20return%20an%20adaptive%20card%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fforums%2Fpostpage%2Fboard-id%2FTeamsDeveloper%2Fattachments-key%2Ff1bb8c20-f32d-4f50-be79-a355364b8858%23%22%20target%3D%22_blank%22%3EMicrosoft%20Teams%26nbsp%3B%3C%2FA%3Emessage%20area%20after%20pasting%20a%20URL%20in%20the%20MS%20Teams%20message%20area%20as%20shown%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FBotBuilder-Samples%2Fblob%2Fddab761d5bbe5076e5513de23696a94663c9d188%2Fsamples%2Fcsharp_dotnetcore%2F55.teams-link-unfurling%2FBots%2FLinkUnfurlingBot.cs%23L17%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E%26nbsp%3B(line%2017).%20The%20only%20difference%20between%20our%20code%20and%20the%20code%20displayed%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FBotBuilder-Samples%2Fblob%2Fddab761d5bbe5076e5513de23696a94663c9d188%2Fsamples%2Fcsharp_dotnetcore%2F55.teams-link-unfurling%2FBots%2FLinkUnfurlingBot.cs%23L17%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E%20is%20that%20instead%20of%20returning%20a%20Hero%20Card%20we%20would%20like%20to%20return%20an%20adaptive%20card.%20Unfortunately%20for%20some%20reason%20the%20adaptive%20card%20is%20not%20displayed%20in%20the%20MS%20Teams%20message%20area%20after%20pasting%20the%20URL%20in%20the%20message%20area.%3C%2FP%3E%3CP%3E%26nbsp%3BCould%20you%20share%20the%20way%20how%20to%20do%20it%20the%20correct%20way%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2020064%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBot%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2021470%22%20slang%3D%22en-US%22%3ERe%3A%20Unfurlink%20Link%20(Adaptive%20card)%20in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2021470%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F913534%22%20target%3D%22_blank%22%3E%40Kzawadka%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F55768%22%20target%3D%22_blank%22%3E%40Tomasz%20Poszytek%3C%2FA%3E%26nbsp%3Bis%20like%20the%20master%20of%20adaptive%20cards%20in%20Microsoft%20Teams.%20Hopefully%20he%20will%20be%20able%20to%20help%20or%20know%20someone%20who%20can%20in%20this%20one.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhilst%20it%20states%20here%20that%20adaptive%20cards%20are%20supported%20with%20Link%20unfurling%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fmessaging-extensions%2Fhow-to%2Flink-unfurling%3Ftabs%3Ddotnet%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ELink%20unfurling%20-%20Teams%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHe%20may%20be%20able%20to%20explicitly%20give%20you%20some%20pointers%20as%20to%20how%20to%20execute%20this%20one%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBest%2C%20Chris%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

Hello

We try to return an adaptive card to the Microsoft Teams message area after pasting a URL in the MS Teams message area as shown here (line 17). The only difference between our code and the code displayed here is that instead of returning a Hero Card we would like to return an adaptive card. Unfortunately for some reason the adaptive card is not displayed in the MS Teams message area after pasting the URL in the message area.

 Could you share the way how to do it the correct way?

2 Replies

@Kzawadka 

 

@Tomasz Poszytek is like the master of adaptive cards in Microsoft Teams. Hopefully he will be able to help or know someone who can in this one. 

 

Whilst it states here that adaptive cards are supported with Link unfurling

 

Link unfurling - Teams | Microsoft Docs

 

He may be able to explicitly give you some pointers as to how to execute this one

 

Best, Chris 

@Kzawadka I found the following solution: apparently the attachment requires a preview defined when returning an Adaptive Card.

 

Here a snipped how it works in Javascript:

 const adaptiveCard = CardFactory.adaptiveCard(card);
 const heroCard = CardFactory.heroCard("card title", "card text");

 const attachment = {
   contentType: adaptiveCard.contentType,
   content: adaptiveCard.content,
   preview: heroCard
 }

 

www.000webhost.com