SOLVED

Adaptive Card, Copy/Paste/Share functionality

%3CLINGO-SUB%20id%3D%22lingo-sub-2845764%22%20slang%3D%22en-US%22%3EAdaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2845764%22%20slang%3D%22en-US%22%3E%3CP%3EMS%20Teams%20application%20...%3C%2FP%3E%3CP%3EI%20send%20Adaptive%20Card%20to%20the%20client%20and%20Bot%20handles%20card%20actions.%20How%20can%20I%20add%2Fimplement%20copy-paste%20functionality%3F%3C%2FP%3E%3COL%3E%3CLI%3EClient%20will%20copy%20the%20card%20to%20the%20clipboard%20and%20send%20it%20to%20a%20different%20client.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EP.S.%3A%20I%20implemented%20%22Link%20unfurling%22%20functionality%20and%20can%20see%20%22Copy%22%20menu%20button%20but%20there%20is%20no%20one%20in%20the%20original%20Adaptive%20Card%20that%20I%20sent%20using%20ConnectorClient.Conversations.SendToConversationAsync(messageActivity).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EWhy%20there%20is%20no%26nbsp%3B%22Copy%22%20menu%20button%20in%20the%20original%20message.%20How%20can%20I%20add%20it%20or%20find%20workaround%20(additional%20button%2C%20or%20card%20link%20or%20unfurling%20or%20something%20else)%3F%26nbsp%3B%3C%2FLI%3E%3CLI%3EI%20created%20%22Share%20Message%22%20functionality%20using%20MessagingExtension%20(...%3D%26gt%3B%22More%20actions%22%20%3D%26gt%3B%20%22Share%20Message%22)%20and%20can%20display%20the%20card%20(unfurling)%20in%20the%20chat%20(can%20swith%20a%20client%20and%20send%20it)%20but%20how%20can%20I%20close%20the%20message%20%3F%20I%20can%20just%20close%20it%20using%20%22backspace%22%20button.%20It%20looks%20strange...%26nbsp%3B%26nbsp%3B%3C%2FLI%3E%3CLI%3EI%20thought%20that%20the%20actions%20of%20copied%20Adaptive%20Card%20won't%20work%20from%20a%20different%20channel%20(not%20Bot%2C%20Client%20to%20Client).%20But%20...%20I%20found%20that%20I%20can%20call%20card%20actions%20from%20a%20different%20channels%20(not%20Client-Bot%20chat)%20and%20bot%20handles%20the%20actions%20but%20...%20I%20send%20messages%20from%20the%20Bot%20(response)%20and%20can't%20see%20it%20in%20channel%20and%20...%20card%20displays%20%22%3CSPAN%3EUnable%20to%20reach%20app.%20Please%20try%20again.%3C%2FSPAN%3E%22%26nbsp%3B%20Bot%20catched%20the%20following%20exception%3A%20%22Operation%20returned%20an%20invalid%20status%20code%20'Forbidden'%22%2C%20Code%3A%26nbsp%3B%22BotNotInConversationRoster%22%2C%20%22The%20bot%20is%20not%20part%20of%20the%20conversation%20roster.%22%20Is%20it%20forbidden%3F%20How%20can%20I%20handle%20it%20(sending%20messages%20from%20the%20bot%20or%20display%20something%20or%20block%20sending%20answers%20(response)%20or%20I%20need%20to%20block%20actions%20from%20a%20different%20channels%20because%20it's%20unsupported)%3F%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2845764%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EChat%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2847141%22%20slang%3D%22en-US%22%3ERe%3A%20Adaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2847141%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20looking%20into%20the%20issue.We%20will%20update%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2857097%22%20slang%3D%22en-US%22%3ERe%3A%20Adaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2857097%22%20slang%3D%22en-US%22%3ECopy-Paste%20is%20not%20supported%20for%20Adaptive%20Cards.%20However%20it%20is%20supported%20for%20Messaging%20Extension%2FLink%20Unfurling.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2869635%22%20slang%3D%22en-US%22%3ERe%3A%20Adaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2869635%22%20slang%3D%22en-US%22%3EFor%20Question%203%20-%20Can%20you%20confirm%20that%20you%20have%20uploaded%20bot%20for%20organization%20or%20for%20yourself%3F%3CBR%20%2F%3EFor%20UpdateActivityAsync(...)%20-%20Could%20you%20share%20the%20repro%20steps%3FAs%20far%20as%20I%20understand%20you%20have%20sent%20a%20card%20using%20messaging%20extension%20and%20now%20you%20are%20trying%20to%20update%20it%20with%20the%20same%20card.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2872909%22%20slang%3D%22en-US%22%3ERe%3A%20Adaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2872909%22%20slang%3D%22en-US%22%3E%22uploaded%20bot%20for%20organization%20or%20for%20yourself%3F%22%3CBR%20%2F%3EWhat%20do%20you%20mean%3F%20I%20can%20say%20that%20I%20installed%20it%20to%20myself.%20(Chat%20Bot%20-%20User).%3CBR%20%2F%3EAny%20differences%3F%3CBR%20%2F%3EAlso.%20I%20can%20confirm%20that%20I%20added%20additional%20scopes%20like%20%22Team%20%26amp%3B%20Group%20Chat%22%2C%20add%20it%20to%20Group%20Chat%20(User1-%20User%202%20-%20Bot)%20and%20in%20that%20case%20I%20can%20update%20Adaptive%20Card%20using%20UpdateActivityAsync(...)%20but%20..%20In%20general%20...%20What%20about%20messages%20(with%20Adaptive%20Card)%20that%20I%20send%20using%20%22Messaging%20Extension%2FLink%20Unfurling%22.%20Can%20I%20update%20it%20after%20card%20action%3F%20I%20mean%20private%20chat%20(User%20-%20Bot)%20and%20external%20Chat%20(User%20-%20User)%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2857342%22%20slang%3D%22en-US%22%3ERe%3A%20Adaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2857342%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you.%3CBR%20%2F%3EMaybe%20...%20Are%20there%20any%20ways%20to%20send%20adaptive%20card%20from%20outside%20(Azure%20function)%20that%20will%20be%20(look)%20like%20%22Messaging%20Extension%2FLink%20Unfurling%22%20message%3F%3CBR%20%2F%3ELink%20Unfurling%20-%20I%20found%20that%20card-link%20is%20cached.%20Can%20I%20generate%20a%20new%20one%20or%20swith%20off%20the%20cache%20(or%20update%20the%20cache)%20%3F%3CBR%20%2F%3EAnd%20...%20Could%20you%20answer%20on%20question%203)%20(%22BotNotInConversationRoster%22)%2C%20please%3F%20What%20about%20copied%20(or%20sent%20via%26nbsp%3BMessagingExtension%2C%20unfurling%20for%20example%20)%20Adaptive%20Card%20actions%20...%20If%20I%20try%20to%26nbsp%3B%3CSTRONG%3EUpdateActivityAsync%3C%2FSTRONG%3E(...)%20I'll%20receive%20%22Operation%20returned%20an%20invalid%20status%20code%20'Forbidden'%22%20exception.%20How%20can%20I%20update%20Card%20of%20MessagingExtension%20by%26nbsp%3BMessaging%20Extension%20Card%20Button%20Click%3F%20Can%20I%20update%2Fdelete%26nbsp%3B%3CSPAN%3Ecard%20of%26nbsp%3B%22Messaging%20Extension%2FLink%20Unfurling%22%26nbsp%3Bmessage%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2874473%22%20slang%3D%22en-US%22%3ERe%3A%20Adaptive%20Card%2C%20Copy%2FPaste%2FShare%20functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2874473%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1182850%22%20target%3D%22_blank%22%3E%40Paul_By%3C%2FA%3E%20-%20As%20per%20my%20understanding%2C%20we%20do%20not%20have%20a%20way%20to%20update%20the%20adaptive%20card%20send%20through%20%22Messaging%20Extension%2FLink%20Unfurling%22%20but%20we%20can%20update%2Frefresh%20the%20normal%20adaptive%20card%20sent%20through%20turnContext.SendActivityAsync()%20via%20message%20reference%20id%2Fconversation%20id.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

MS Teams application ...

I send Adaptive Card to the client and Bot handles card actions. How can I add/implement copy-paste functionality?

  1. Client will copy the card to the clipboard and send it to a different client.

P.S.: I implemented "Link unfurling" functionality and can see "Copy" menu button but there is no one in the original Adaptive Card that I sent using ConnectorClient.Conversations.SendToConversationAsync(messageActivity).

 

  1. Why there is no "Copy" menu button in the original message. How can I add it or find workaround (additional button, or card link or unfurling or something else)? 
  2. I created "Share Message" functionality using MessagingExtension (...=>"More actions" => "Share Message") and can display the card (unfurling) in the chat (can swith a client and send it) but how can I close the message ? I can just close it using "backspace" button. It looks strange...  
  3. I thought that the actions of copied Adaptive Card won't work from a different channel (not Bot, Client to Client). But ... I found that I can call card actions from a different channels (not Client-Bot chat) and bot handles the actions but ... I send messages from the Bot (response) and can't see it in channel and ... card displays "Unable to reach app. Please try again."  Bot catched the following exception: "Operation returned an invalid status code 'Forbidden'", Code: "BotNotInConversationRoster", "The bot is not part of the conversation roster." Is it forbidden? How can I handle it (sending messages from the bot or display something or block sending answers (response) or I need to block actions from a different channels because it's unsupported)?
6 Replies

We are looking into the issue.We will update you.

Copy-Paste is not supported for Adaptive Cards. However it is supported for Messaging Extension/Link Unfurling.

Thank you.
Maybe ... Are there any ways to send adaptive card from outside (Azure function) that will be (look) like "Messaging Extension/Link Unfurling" message?
Link Unfurling - I found that card-link is cached. Can I generate a new one or swith off the cache (or update the cache) ?
And ... Could you answer on question 3) ("BotNotInConversationRoster"), please? What about copied (or sent via MessagingExtension, unfurling for example ) Adaptive Card actions ... If I try to UpdateActivityAsync(...) I'll receive "Operation returned an invalid status code 'Forbidden'" exception. How can I update Card of MessagingExtension by Messaging Extension Card Button Click? Can I update/delete card of "Messaging Extension/Link Unfurling" message?

For Question 3 - Can you confirm that you have uploaded bot for organization or for yourself?
For UpdateActivityAsync(...) - Could you share the repro steps?As far as I understand you have sent a card using messaging extension and now you are trying to update it with the same card.
"uploaded bot for organization or for yourself?"
What do you mean? I can say that I installed it to myself. (Chat Bot - User).
Any differences?
Also. I can confirm that I added additional scopes like "Team & Group Chat", add it to Group Chat (User1- User 2 - Bot) and in that case I can update Adaptive Card using UpdateActivityAsync(...) but .. In general ... What about messages (with Adaptive Card) that I send using "Messaging Extension/Link Unfurling". Can I update it after card action? I mean private chat (User - Bot) and external Chat (User - User)?
best response confirmed by Paul_By (Occasional Contributor)
Solution

@Paul_By - As per my understanding, we do not have a way to update the adaptive card send through "Messaging Extension/Link Unfurling" but we can update/refresh the normal adaptive card sent through turnContext.SendActivityAsync() via message reference id/conversation id.

Thanks, 

Chetan Sharma

----------------------------------------------------------------------------------------------------------

If the response is helpful, please click "Mark as Best Response" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.