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

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 小时前
【企业微信】群机器人自动消息配置
数据库·机器人·企业微信
bjshinegood3 小时前
企业微信AI社群助手:赋能企业私域运营的新引擎
人工智能·企业微信
2401_856654516 天前
员工疯狂打CALL!解锁企业微信新玩法,2024年必学秘籍来啦!
安全·微服务·微信·电脑·企业微信
bjshinegood9 天前
企微无限群发:精准营销与合规边界的探索
人工智能·企业微信
Looper03319 天前
企业微信应用消息收发实施记录
企业微信
soso19689 天前
10分钟在企业微信中集成一个 AI 助手
人工智能·企业微信
蜜蜜不吃糖13 天前
企业微信如何利用群聊机器人定时推送消息
数据库·机器人·企业微信
hookserver17 天前
企业微信hook协议接口,聚合群聊客户管理工具开发
java·c语言·http·微信·企业微信·ipad·企微
欢迎来到祖安!22 天前
企业微信dll,最新版dll
企业微信