Skip to content

Instantly share code, notes, and snippets.

@artturik
Created July 30, 2024 13:31
Show Gist options
  • Save artturik/4d838edc74897968d91a549798889e89 to your computer and use it in GitHub Desktop.
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
# 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
}
]
}}]}'
@artturik
Copy link
Author

image

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