Simple application shell micro channel alarm

A micro-channel company registered address:.
Https://work.weixin.qq.com/?from=openApi
. Two request formats
method of obtaining the token
curl -s' https://qyapi.weixin.qq.com/cgi ? -bin / GetToken corpid = $ corpid & corpsecret = $ corpsecret '| awk -F "\" "' Print {$ 10} '
2. normal request format:
(1) requires token and a member of the account, department ID
curl -s -m 300 -H "Context-type: application /"XueFeng", "toparty":Get time: 20190813' \ n 'network address : 1.0.0.0 '\ n' host name: product-zabbix '\ n "
(2) the department ID is not required, remove the alarm can still be sent, but must be developed member account, token timeliness
curl -s -m 300 -H "Context- type: application / json" -X 'POST' 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$access_token' -d '{ "touser": "XueFeng ", "msgtype": "text", "agentid": "1000002", "text": { "content": "' Get time: 20190813 '\ n' network addresses: 1.0 .0.0 '\ n' host name: product-zabbix '\ n " }," safe ":" 0 "}'
three related reference.
the API test address: https: //work.weixin.qq.com/api/devtools /devtool.php
production look interface parameters address: https: //work.weixin.qq.com/api/doc#90000/90135/90250/ text message
to see the return error codes address: https: //work.weixin. qq.com/api/doc#90002/90156/90475

Guess you like

Origin www.cnblogs.com/jinxf/p/11349988.html