1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > python操作钉钉机器人推送消息

python操作钉钉机器人推送消息

时间:2020-06-22 21:57:27

相关推荐

python操作钉钉机器人推送消息

群里面设置

使用关键词,必须要携带这个关键词才能调用这个机器人

下一步,这个就是操作这个钉钉机器人的接口

allure测试报告 关键词一定要写在 content字段里面

import jsonimport requestsdef dd_robot():HEADERS = {"Content-Type": "application/json;charset=utf-8"}# 之前复制的接口地址和token信息url = '/robot/send?xxx'#content里面要设置关键字data_info = {"msgtype": "text","text": {"content": 'allure测试报告:lll'},"isAtAll": False#这是配置需要@的人# ,"at": {"atMobiles": ["15xxxxxx06",'18xxxxxx1']}}value = json.dumps(data_info)response = requests.post(url,data=value,headers=HEADERS)if response.json()['errmsg']!='ok':print(response.text)if __name__ == '__main__':dd_robot()

测试

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。