Using adaptive cards with incoming webhooks - microsoft-teams

Is it in any way possible to send an AdaptiveCard through an incoming webhook and display it in Microsoft Teams?

No, only Actionable Cards are supported in webhooks. Please see this reference: https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook.
If you need to use Adaptive Cards, you'll need to create a bot to send messages. See: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/what-are-bots

Related

How to send proactive message to multiple Teams group chats?

I'm able to send a proactive message as a bot to one Teams group chat at a time using Bot connector API's. If I want to send the same message to multiple Teams chats at the same time, do I need to use connector.Conversations.SendToConversationAsync() for each conversation separately or is there support for batch requests?
I see batching specified in https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/rate-limit, but not able to find any documentation on how to do it.

Mark an Adaptive card posted via Incoming webhook in MS Teams as done

We get messages/tasks from an external PHP-server via incoming webhook in a Teams channel. They are posted in the Adaptive Card format using the 'message with attachments' method.
I would like to find a possibility to mark these messages as done.
My idea would be that the message has a button, that turns green and maybe changes the text when clicked. This has to be permanent. Also the text of the card should be hidden.
I tried to implement a button that toggles the visibility of the card, but it turns out the toggle is not persistent but gets reset every time the channel is opened.
As a workaround we are using reactions at the moment, but I would like to find a more obvious way.
Obviously an incoming webhook does not support the use of Action.Submit (as stated in the link above). So I cannot obviously update the card with this method.
I was thinking to use the Post adaptive card and await answer -method from Flow, but it cannot post an answer to a post, but only post a new card, so the context is missing, which of the posts in the channel you ant to mark as done.
A Power automate Flow could achieve this, if it could be told to alter the posted message.
I realize that it is actually a Task I want to post, not necessarily a message/card in a Teams channel. But there seems no way to post a new task directly to a Tasks tab in a Teams channel via an incoming webhook?
Has anybody an idea what technique could be used to achieve my goal?
This is possible using Actions with O365 connector card format, and is not a currently supported feature in Adaptive cards,
Ref Doc: ⁠Create and send messages - Teams | Microsoft Docs
Could you please raise an User Voice

Sending a message to users as a bot in bot channel of Microsoft Teams using the Graph API

I have created a bot by following the steps mentioned in the doc.I have authenticated user using oauth 2.0 (auth code grant) as mentioned in the doc and in reverse I got a access token. But when I send message to channel in the teams using (/teams/{id}/channels/{id}/messages) API the message was sent on behalf of me. But I want my bot as the sender of message. Here is the image of the message that I have sent using the above API. and is there any way to send direct message to user as a bot?
Instead of using the Graph, there's another approach using the Bot Framework itself, to send a message to a team channel, a group chat, or a 1-1 conversation. The code doesn't even need to live inside the bot itself, it just needs to leverage the bot framework under the covers (for example, I have several Azure Functions that pro-actively message users). This idea is called "Proactive messaging" and you can read more about it in the docs here.
You do need to get certain fields when the user first installs the bot though, or any time the bot receives a message. I've described that more at Programmatically sending a message to a bot in Microsoft Teams. You haven't said what language you're using, but there are examples for a bunch of them - I can send you links if you let me know what you're using.

Can the Powerapps Teams Connector instant message an individual vs posting in a channel?

I currently have a front-desk reception Powerapp that will send a Skype message to whichever employee the visitor selects from the gallery. The employee is notified via Skype message of the visitors arrival. I used SkypeForBusiness.SendMessage connector/function to pull this off. Is there an equivalent in Teams, I have only seen options for posting into public channels. At this time, do you know if the Powerapps Teams connector can send individual private messages to someone via Chat vs Channel? Is this at all possible?
Currently, This is not possible with Connector or Graph APIs. You can use Graph APIs or Connector send messages only to channels.
Bots can send personal as well as channel messages.

Is it possible to post message to a conversation on Skype using directline

We have a scenario , wherein we are trying to post messages to users (which have conversations with Bot opened on Skype channels ) through directline api.
We are unable to achieve this.
But we are able to broadcast messages from a conversation on Webchat to another conversation on webchat .
Similarly from one conversation in Skype to another conversation on Skype.
Is it possible to broadcast a message from directline to a conversation on Skype ?
You need to send a message to your bot, requesting this. Your bot can choose the correct channel to answer.

Resources