This article shows how to configure and send messages in Microsoft Teams via an Elipse E3/Elipse Power application.
Microsoft Teams is the team collaboration hub from 365. With it, you can connect and collaborate with virtually anyone, anywhere. Keep close, continuous connection and access shared contents at any time in order to learn, plan, and innovate with your team.
Use your Elipse E3/Power application to send messages and collaborate with colleagues via Microsoft Teams. For this integration, the Power Automate Workflows app — available directly within Microsoft Teams — will be used to receive external HTTP requests and automatically post messages to channels or chats. This approach provides greater flexibility, control, and security for the communication between Elipse E3/Power and Teams.
Configuring Power Automate Workflows in Microsoft Teams:
- Open the Microsoft Teams application and navigate to the desired channel.
- Click the three dots (…) next to the channel name and select “Workflows”.
- In the Workflows window, search for the template “Post to a channel when a webhook request is received”.
- Click the template, enter a name for the flow, and confirm the target channel.
- Click “Add workflow” to create the flow.
- Once created, a webhook URL will be generated automatically. Copy this URL — it will be used as the endpoint in your Elipse E3/Power script. Example of a generated URL:
https://default.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows//triggers/manual/paths/invoke?api-version=1&sp=/triggers/manual/run&sv=1.0&sig=
Sending messages from Elipse E3/Power via Power Automate Workflows:
The URL variable in the script must point to the new URL generated by Power Automate Workflows (as obtained in step 6 of the previous section).
Dim objXmlHttpMain , URL
strJSONToSend = "{""type"":""message"",""attachments"":[{""contentType"":""application/vnd.microsoft.card.adaptive"",""contentUrl"":null,""content"":{""$schema"":"_
&"""http://adaptivecards.io/schemas/adaptive-card.json"",""type"":""AdaptiveCard"",""version"":""1.2"",""body"":[{""type"": ""TextBlock"",""text"":"_
& """For Samples and Templates, see [https://adaptivecards.io/samples](https://adaptivecards.io/samples)""},{""type"": ""Image"",""url"": ""https://adaptivecards.io/content/cats/3.png""}]}}]}"
'Texto Simples
'strJSONToSend ="{""text"":""Hello World""}"
URL = "https://default.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows//triggers/manual/paths/invoke?api-version=1&sp=/triggers/manual/run&sv=1.0&sig="
Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP")
On Error Resume Next
objXmlHttpMain.open "POST",URL, False
If Err Then 'handle errors
Msgbox Err.Description & " [0x" & Hex(Err.Number) & "]"
End If
On Error Goto 0
objXmlHttpMain.setRequestHeader "Content-Type", "application/json"
objXmlHttpMain.send strJSONToSend
strResponse = objXmlHttpMain.responseText
msgbox strResponse
