import json
import requests
def robotMessage(message):
url = 'https://oapi.dingtalk.com/robot/send?access_token=b46c26dd24cc3c96d21773a7d8f3a41f4ac49da270f14ae9411111111111111111'
headers = {
"Content-Type": "application/json ;charset=utf-8 "
}
msg = {
"msgtype": "text",
"text": {"content": message},
"at": {
"atMobiles": [
"18506811111",
"135646111111"
],
"isAtAll": 1
}
}
response = requests.post(url, data=json.dumps(msg), headers=headers)
print(response.text)
if __name__ == '__main__':
message = "监控报警提示"
robotMessage(message)