代码拉取完成,页面将自动刷新
#!/bin/bash
#要发送的消息
msg=$1
content=$msg
#企业id
qywx_corpid=
#企业应用的secret
qywx_corpsecret=
#指定接收消息的成员
touser=
#指定接收消息的部门
toparty=
#企业应用的id
agentid=1000004
response_token="$(curl -s "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$qywx_corpid&corpsecret=$qywx_corpsecret")"
other_token="{\"errcode\":0,\"errmsg\":\"ok\",\"access_token\":\""
other_token2="\",\"expires_in\":7200}"
response_token=${response_token/$other_token/}
access_token=${response_token/$other_token2/}
msg_body="{\"touser\":\"$touser\",\"toparty\":\"$toparty\",\"msgtype\":\"text\",\"agentid\":$agentid,\"text\":{\"content\":\"$content\"}}"
req_send_msg_url=https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$access_token
req_msg=$(curl -s -H "Content-Type: application/json" -X POST -d $msg_body $req_send_msg_url)
echo $req_msg
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。