Forum Discussion

Paul_By's avatar
Paul_By
Brass Contributor
Oct 14, 2021

Adaptive Card, Copy/Paste/Share functionality

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)?
  • 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. 

    • ChetanSharma-msft's avatar
      ChetanSharma-msft
      Icon for Microsoft rankMicrosoft
      Copy-Paste is not supported for Adaptive Cards. However it is supported for Messaging Extension/Link Unfurling.
      • Paul_By's avatar
        Paul_By
        Brass Contributor

        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?

Resources