Skip to content

Instantly share code, notes, and snippets.

@wataash
Last active February 13, 2024 14:48
Show Gist options
  • Save wataash/abf1adbfcb48b521003ae6dcbf8c7de7 to your computer and use it in GitHub Desktop.
Save wataash/abf1adbfcb48b521003ae6dcbf8c7de7 to your computer and use it in GitHub Desktop.
Microsoft Teams incoming webhook example
@wataash
Copy link
Author

wataash commented Nov 4, 2019

To post this markdown with Incoming Webhook, first serialize it as a JSON string. There are many online serializing tools:

Then post it as "text":

curl -X POST https://outlook.office.com/webhook/4fae0905-... \
  -d '{"text": "# Heading\n\n- list 1\n  - list 1.1\n- *Italic*\n- **Bold**\n- ~~Strike-through~~ (not work)\n- [link](http://example.com)\n- `inline code`\n\nenumarate\n\n1. a\n1. b\n1. c\n\nquote\n\n> quote\n> quote\n\ncode blocks\n\n```\ndef fn():\n    pass\n```\n\nimage\n\n![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/167409/dc34f53f-7003-9dce-2fd6-a58aa53013fb.png)\n\n[Mention (@General) doesn\'t work yet](https://microsoftteams.uservoice.com/forums/555103-public/suggestions/17153099-webhook-needs-to-support-forced-notification-a-la)\n"}'

image

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