钉钉发送通知
钉钉发送通知消息
官方文档 : https://open.dingtalk.com/document/robots/custom-robot-access
API Explorer调试 : https://open-dev.dingtalk.com/apiExplorer
方式一:webhook方式
https://open.dingtalk.com/document/robots/custom-robot-access
使用场景:发送消息到聊天群
前期准备:先创建一个测试群聊,然后在群里添加机器人即可,具体参数见官方文档
# author : heart
# blog_url : https://www.cnblogs.com/ssrheart/
# time : 2024/1/11
import requests
urls = "https://oapi.dingtalk.com/robot/send?access_token="
data = {"msgtype": "text", "text": {"content": "大家好,周五周五敲锣打鼓"}}
res = requests.post(url=urls, json=data)
print(res)