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

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、效果

相关推荐
A_QXBlms1 天前
企微私域工具SOP自动化实战:3条核心流程配置教程
大数据·自动化·企业微信
beyond阿亮1 天前
OpenClaw接入企业微信
人工智能·ai·企业微信·openclaw
wzl202612133 天前
企业微信多账号管理:如何用技术手段实现“矩阵运营”?
智能手机·企业微信
wzl202612134 天前
从0到1搭建私域数据中台——公域引流的数据采集与分析
python·自动化·企业微信
vx-bot5556664 天前
企业微信ipad协议的性能压测与调优实践
企业微信
wechatbot8884 天前
【企业通信】基于IPAD协议的企业微信群聊管理API:群操作功能接口设计与实现
java·ios·微信·企业微信·ipad
wzl202612134 天前
《基于企微会话存档的精准发送策略:从互动数据分析到防折叠群发》
java·数据分析·企业微信
wzl202612134 天前
《从协议层对抗折叠:iPad协议脚本在企微批量群发中的集成与优化》
ios·企业微信·ipad
ifeng03104 天前
OpenClaw-企业微信支持多bot
企业微信·openclaw
A_QXBlms5 天前
私域运营数据化:从埋点到看板的完整实践
企业微信