requetsでSlackにメッセージ送信 [Python]
Incoming Webhookをチャンネルにインストールし、TOKENとCHANNEL IDを取得していることが前提条件。
import requests
TOKEN = "xxxxxxxxxxxxxxxxxxx"CHANNEL = "yyyyyyyyyyyyyyyy"
param = { "token":TOKEN, "channel":CHANNEL, "text":"hello world!" }
requests.post(url="https://slack.com/api/chat.postMessage",\ headers={'Content-Type': 'application/json'},\ params=param)