Forum Discussion
nidheeshbabu96
Jul 30, 2024Copper Contributor
Error while running Teams workflow for sending message to a channel by triggering webhook
Hi, I was using the incoming webhook connectors for sending messages to channels via webhooks. Recently heard that these connectors are no longer supported and need to use workflows. I had setup a w...
- Aug 29, 2024
@basharh190 , StoneE1085, sushantp1105 ,BrianA1775, MattJ1810, nidheeshbabu96, RCFTech
We tried to test this by creating a workflow and then by POSTing a payload to the webhook URL. The workflow sent the message successfully in desired team's channel.
Workflow:
Step:1Step:2
Step:3
Running cURL command:
Result:
nidheeshbabu96
Aug 29, 2024Copper Contributor
Prasad_Das-MSFTI have been invoking workflows via HTTP requests, and while the requests return a success output (202 response), the message is not being delivered to the channel. Upon checking the run history of the workflow in Teams, I noticed that the runs are showing a failed status. Please find the screenshot attached for reference.
I would greatly appreciate your assistance in resolving this issue at the earliest, as it is having a significant impact on our operations. Your prompt attention to this matter would be highly valued.
Prasad_Das-MSFT
Microsoft
Aug 29, 2024@basharh190 , StoneE1085, sushantp1105 ,BrianA1775, MattJ1810, nidheeshbabu96, RCFTech
We tried to test this by creating a workflow and then by POSTing a payload to the webhook URL. The workflow sent the message successfully in desired team's channel.
Workflow:
Step:1
Step:2
Step:3
Running cURL command:
Result:
- psrujanSep 20, 2024Copper Contributor
Prasad_Das-MSFT How do i render the html content in a message card while posting to a channel using webhooks it's ignoring the html and treating it as plain text
- Prasad_Das-MSFTSep 23, 2024
Microsoft
psrujan , instead of using "Post message in a chat or channel", we used "Post card in a chat or channel " action by using below JSON and the card got posted successfully in card format.
Card JSON:
("When a Teams webhook request is received" trigger does not support actionable messages, unlike deprecated Office Webhooks.)
{ "type": "message", "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.4", "body": [ { "type": "TextBlock", "text": "Test Report", "weight": "bolder", "size": "large", "wrap": true, "color": "accent", "horizontalAlignment": "center" }, { "type": "ColumnSet", "columns": [ { "type": "Column", "width": "auto", "items": [ { "type": "TextBlock", "text": "**Record:** Basics\n**TestCases:** PassOrFail", "wrap": true } ] }, { "type": "Column", "width": "stretch", "items": [ { "type": "TextBlock", "text": "**Test Results:**\n\n**Passed:** <testsPassed>\n**Failed:** <testsFailed>\n**Total:** <totalTests>", "wrap": true } ] } ] }, { "type": "FactSet", "facts": [ { "title": "Records:", "value": "Basic" }, { "title": "TestCases:", "value": "PassOrFail" }, { "title": "Passed:", "value": "<testsPassed>" }, { "title": "Failed:", "value": "<testsFailed>" }, { "title": "Total:", "value": "<totalTests>" } ] } ] } } ] }
Result:
- MattJ1810Sep 04, 2024Copper Contributor
Thank you Prasad_Das-MSFT I also confirmed it works correctly when using your template. Much appreciated!
- Prasad_Das-MSFTSep 05, 2024
Microsoft
MattJ1810 , glad to hear that it worked. Could you please share your valuable feedback via Microsoft Teams Developer Community Response Feedback link?
- nidheeshbabu96Sep 01, 2024Copper Contributor
Prasad_Das-MSFT basharh190 sushantp1105 kidhexa Tried this via postman as you shown and it is working as expected. Thanks much for your time.
- basharh190Aug 30, 2024Copper ContributorPrasad_Das-MSFT Thank you, I can confirm its working by following Prasad_Das-MSFT 's guide, if you used the ready to go template you need to open the workflow, click edit and replicate what Prasad_Das-MSFT did. I'm able to send messages via postman.
- kidhexaAug 29, 2024Copper Contributor
I have configured the Workflow in the exact way you have - and the flow is showing as 'failed' and the message does not go to the teams channel.
1:
2.
3.
4.
5.
6.
- Victord1250Oct 10, 2024Copper Contributorthis worked for me. but it should be better documented
- kindzmaOct 16, 2024Copper Contributor
Still doesn't work for me - same "cannot be installed" error. Anything obvious I am doing wrong?
- Prasad_Das-MSFTAug 30, 2024
Microsoft
kidhexa , can you please share the exact error message you are getting? In which action the flow is failing?
- kidhexaAug 30, 2024Copper Contributor
Turns out it was failing due to processing the flow as 'bot' - have changed the post to user and the curl is now working successfully. I will test in our dev environment now.
Many thanks for your time on this!