This new extension provides support for:
Post Message to MS Teams
The Message data structure is discussed here: https://docs.microsoft.com/en-us/graph/api/resources/chatmessage?view=graph-rest-1.0
The only Teams inputs we will support in this first version are Subject and Body. They should be string inputs on the action.
Verify that rich text entered into a Flow Text Template can be passed by reference into the Body of this action and the formatting is retained in the posting on Teams.
If an error is returned extract the most readable part of the error text and return it in the ErrorText output attribute
Create Teams Channel
same as for ‘Post Message’, above, except call it ‘ChannelId’
This Teams API takes a huge User object, but we’ll just have our action take an id String initially. Convert it to the expected User structure
setting up authentication to make calls to the Microsoft Graph API is challenging but anyone who administers Teams will probably be familiar with the process. Currently, the only tokens we’ve tested this with are developer tokens that last for 1 hour and have to be refreshed, and the tokens are generated through a complex process involving HTTP and a rig like Postman.
Here’s the Postman configuration that I use to generate valid auth tokens:
All access to Teams starts with an Azure App. This produces the clientID and TenantID
You combine that app id info with a client secret to create an environment that you use to get a temporary access token:
You can generate Client Secrets from the Azure App management UI:
This gives you the access token. Teams actions also usually require IDs for the Team and Channel:
You can generally extract these values from the URLs found in Teams:
However, you have to watch out for the encoding. In the example above, the channelID that Flow would expect is
and the teamsID is referred to here as the groupID and Flow would expect;
There is certainly a better way to extract these ID’s! This is an area where I’m sadly ignorant, and Teams experts are encouraged to comment on this post with improvements to these docs.
Step 1) Install Required Support Packages
This extension requires the following extensions, which should be installed first, in order. If you already have these extensions then you may not need to install them. However, you may need to upgrade them.
Install: Flow Actions Base Pack minimum version 2.16
Install: Flow Screen Components Base Pack minimum version 2.2
Install: Datatable minimum version 3.0.10
Step 2) Install MSTeamsActions
Version 1.0.0 Unmanaged 4/1