curl https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -H "Content-Type: application/json" -d "{ "msgtype": "text","text": {"content": "Hi,oooooooooooooo"}}"
{"errcode":40008,"errmsg":"Warning: wrong json format. invalid message type, hint: [1596191462_51_2a996ad960f4971bf3cdec043b8abd6b], from ip: 220.249.166.153, more info at https://open.work.weixin.qq.com/devtool/query?e=40008"}
求助这个是什么问题呀
您好,看日志是消息类型为空,invalid msgtype, req.msgtype() 看截图也是这样提示,应该是文本内容问题,严格按照文档这个格式进行执输入看看 curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=693axxx6-7aoc-4bc4-97a0-0ec2sifa5aaa' \ -H 'Content-Type: application/json' \ -d ' { "msgtype": "text", "text": { "content": "hello world" } }'
您好,我想问一下这个格式好像没问题吧,为什么发送失败呢?
{"text": {"content": "Zabbix agent 告警恢复 5 mintes has been happened 1 times \n \ntime: 2021-01-21 18:00:08 -- 2021-01-21 18:02:08\n\n114976825\n2021-01-21 17:11:08\n告警恢复: Zabbix agent on vnf-11-0-64-252 is unreachable for 5 minutes\n监控数据: Up (1)\n内蒙古05-内蒙6\nHost: vnf-11-0-64-252\nSeverity: High\n\n"}, "safe": "0", "agentid": 1000002, "msgtype": "text", "toparty": 2}
The send result is {u'errcode': 40008, u'errmsg': u'Warning: wrong json format. invalid message type, hint: [1611223210_157_af1b9ec27fa4e6d37db084fe5742fe66], from ip: 203.57.249.251, more info at https://open.work.weixin.qq.com/devtool/query?e=40008'}