Created
July 30, 2024 13:31
-
-
Save artturik/4d838edc74897968d91a549798889e89 to your computer and use it in GitHub Desktop.
Microsoft Teams Workflow Webhook (Post to a channel when a webhook request is received) curl bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# when creating new Teams webhooks via workflows, old incoming webhook format is not working | |
# as Microsoft Power Automate workflow looks for "attachments" key in JSON body | |
# here is an example how to make it work: | |
curl -X POST $TEAMS_WEBHOOK_URL \ | |
-H 'Content-Type: application/json' \ | |
-d '{"attachments": [{"contentType": "application/vnd.microsoft.card.adaptive","content": | |
{ | |
"type": "AdaptiveCard", | |
"msteams": { | |
"width": "Full" | |
}, | |
"version": "1.2", | |
"body": [ | |
{ | |
"type": "TextBlock", | |
"text": "Hello!", | |
"weight": "Bolder", | |
"size": "Medium" | |
}, | |
{ | |
"type": "TextBlock", | |
"text": "This is Microsoft Teams Workflow Webhook (Post to a channel when a webhook request is received)", | |
"isSubtle": true, | |
"wrap": true | |
} | |
] | |
}}]}' |
Author
artturik
commented
Jul 30, 2024

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment