【Python】pymsteams を 使って Microsoft Teams に投稿する
![](https://kazupon.org/wp-content/uploads/2020/04/python-logo.png)
目次
テキストを投稿する
import pymsteams
message = pymsteams.connectorcard(<Incoming Webhook URL>)
message.text("text")
message.send()
![](https://kazupon.org/wp-content/uploads/2020/04/image-10.png)
タイトルとテキストを投稿する
import pymsteams
message = pymsteams.connectorcard(<Incoming Webhook URL>)
message.title("title")
message.text("text")
message.send()
![](https://kazupon.org/wp-content/uploads/2020/04/image-11.png)
リンクを追加する
import pymsteams
message = pymsteams.connectorcard(<Incoming Webhook URL>)
message.title("リンクの追加")
message.text("[KAZUPON研究室](https://kazupon.org)")
message.send()
![](https://kazupon.org/wp-content/uploads/2020/04/image-12.png)
リンクボタンを追加する
import pymsteams
message = pymsteams.connectorcard(<Incoming Webhook URL>)
message.text("リンクボタンの追加")
message.addLinkButton("KAZUPON研究室へ.", "https://kazupon.org")
message.send()
![](https://kazupon.org/wp-content/uploads/2020/04/image-13.png)
セクションを追加する
import pymsteams
message = pymsteams.connectorcard(<Incoming Webhook URL>)
message.text("セクションの追加")
Section1 = pymsteams.cardsection()
Section1.text("セクション1")
message .addSection(Section1)
Section2 = pymsteams.cardsection()
Section2.text("セクション2")
message .addSection(Section2)
message.send()
![](https://kazupon.org/wp-content/uploads/2020/04/image-14.png)
※先頭にsummary や text が無いと Summary or Text is required. エラーが出ます。