SOLVED

Adaptive Card, Copy/Paste/Share functionality

Brass 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 (Brass 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. 

1 best response

Accepted Solutions
best response confirmed by Paul_By (Brass 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. 

View solution in original post