Send Teams v2
"Send teams v2" lets you send messages to Teams using Teams workflow webhooks URL.
Url
You must enter your Team's Workflow URL POST HTTP. The URL is available in the first box (the trigger) of your Teams Workflow.
Adaptive Card
The JSON schema of the adaptive card you want to send. Here is a link to Microsoft's Adaptive Card Designer. Once you are satisfied with your card, copy the JSON payload from the designer and paste it here, and adjust for Python (ex : true -> True).
If you need to mention user in your card, simply insert <at>user@mail.com</at>
in your text. It sadly won't look like normal mentions, but the user will be notified. Using Microsoft's documented way of mentioning users will result in a failure of your Teams Workflow.
Buttons
You can add sequence buttons to view a job, restart a sequence, accept a job or reject a job.
You can also add your own buttons with your own URL.
Making the Teams Workflow
First you need to add "Workflows" to your Microsoft Teams by going to "Apps". Search and add "Workflows" so that you can start building the needed workflow for this task.
Once you open the Workflow app, create a new flow from blank. Then search for "webhook" and add the "When a Teams webhook request is received" trigger. Make sure "Who can trigger the flow ?" is set to "Anyone".
Next click "New Step", search "Data Operation", select it and then "Compose". You should now see an empty "inputs" field, click on it and select "Body", be careful there is another "body" in lowercase, this is not what you are looking for.
Now add a new step and search for "Post card in a chat or channel". Here are the settings required for this step :
- Post as "User"
- Adaptive Card "Outputs"
The rest is up to you. When you are done your workflow should now look like this, with a selected team and channel or chat if you choose group chat instead of channel.
The only thing missing is to save the workflow to obtain the URL and start using it in our task.