通过企业微信群机器人 发送群消息

1、添加群机器人,复制的webhook地址

2、

public static void main(String[] args) {

String reqUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=6xdexxxxxxxxxxxxxxxxxxxxxxxxxxx";

String title = "填写日志提醒";

String dateTime = DateUtil.formatDateTime(new Date());

String content = "记得写日志哟";

String reqJson = "{\n" +

" \"markdown\": {\n" +

" \"content\": \"> " +

"告警通知:<font color=\\\"info\\\">"+title+"</font>\\n> " +

"告警时间:<font color=\\\"info\\\">"+dateTime+"</font>\\n> " +

"告警原因:<font color=\\\"warning\\\">"+content+"</font>\"\n" +

" },\n" +

" \"msgtype\": \"markdown\"\n" +

"}";

String body = cn.hutool.http.HttpRequest.post(reqUrl).body(reqJson).timeout(5000).execute().body();

System.out.println("请求结果:\n"+body);

}

3、效果

相关推荐
无心水2 天前
【Hermes:多平台接入】19、钉钉/飞书/企业微信:国内办公场景接入指南 —— 将 Honcho 智能体部署到你的工作聊天软件
人工智能·钉钉·飞书·企业微信·openclaw·hermes·honcho
天空属于哈夫克33 天前
企业微信API常见的错误和解决方案
java·数据库·企业微信
wzl202612133 天前
企微私域新客 AI 运营实战:轻量化工具落地指南
大数据·人工智能·企业微信
tianxiaxue13 天前
企微永久有效无限建群的群活码
企业微信
wzl202612133 天前
企微 5.0.8 “记录面聊” 深度解读:AI 打通线下私域最后一公里
人工智能·企业微信
byoass4 天前
企业云盘权限管理深度对比:巴别鸟、联想Filez、腾讯企微云盘
网络·安全·云计算·企业微信
tianxiaxue14 天前
企业微信超时未回复如何进行语音提醒?
企业微信
小白跃升坊5 天前
OpenClaw 集成企业微信:功能应用解析大全
企业微信
tianxiaxue15 天前
企微群内超时提醒通知到飞书/钉钉?
钉钉·飞书·企业微信
小白跃升坊6 天前
OpenClaw集成企业微信:功能应用解析大全
企业微信·ai agent·智能体·ai办公·openclaw