2024年10月9日 星期三

用 webhook 發訊息到 Teams

Reference:
如何設定 Microsoft Teams 的 Webhook 以接收 DSM 系統通知?
 
用 webhook 發訊息到 Teams 頻道
先在 Teams 新增頻道
 
開啟並建立workflows


 

 
 
 


結構描述: 
{ "type": "object", "properties": { "text": { "type": "string" } } }



複製這一串 webhook URL

用Postman測試

到Teams確認有收到

Postman有提供參考的程式碼

2026/8/6 update:
用python script傳送到teams的訊息
{ "@type": "MessageCard", "@context": "https://schema.org/extensions", "summary": "sample_message", "text": "sample_message" }
如果要讓sample_message可以呈現換行,需要加上 "  \n"。
(換行的\n前面要有兩個空白) 
 

沒有留言:

張貼留言