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

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

相关推荐
金融Tech趋势派19 小时前
Hermes Agent开源45天登顶GitHub,深度解析其记忆机制与部署方案
人工智能·微信·开源·github·企业微信·openclaw·hermes agent
金融Tech趋势派1 天前
OpenClaw本地部署完整流程:从环境搭建到企微接入
企业微信·openclaw
王者鳜錸1 天前
企业解决方案二-企业微信+扣子智能体宣传方案
企业微信·扣子智能体
道一云2 天前
企业微信CLI开源项目发布,支持通过CLI使用接口能力
开源·编程·企业微信·软件开发
wzl202612132 天前
企微与CRM系统数据集成:双向同步方案
企业微信
企微增长观察2 天前
企业微信怎么注册?2026年完整注册流程
java·人工智能·企业微信
A_QXBlms2 天前
企微获客自动化落地——从手动内耗到API集成的技术实现
大数据·自动化·企业微信
金融Tech趋势派2 天前
企业微信收费吗?2026年最新收费标准
人工智能·企业微信
A_QXBlms2 天前
企微获客数据可视化——无工具数据黑盒vs工具化数据追溯的技术实现
信息可视化·企业微信
wzl202612133 天前
企微工具对比:多账号并发管理与消息分发
企业微信