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

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

相关推荐
wjc12313132 天前
蓝印RPA|企业微信机器人Agent配置说明
机器人·企业微信·rpa
基鑫阁2 天前
Clawdbot机器学习部署:TensorFlow模型服务化
tensorflow·企业微信·图像识别·clawdbot
天空属于哈夫克32 天前
3分钟快速接入!实现企业微信外部群主动调用能力
自动化·企业微信·api·rpa
tianxiaxue12 天前
企业微信飞单私单行为监控与敏感行为监控
企业微信
tianxiaxue12 天前
企业微信聊天敏感词监控、提醒与拦截
企业微信
a752066283 天前
OpenClaw企业微信渠道配置教程|API模式+长连接+全部授权
人工智能·机器人·企业微信·openclaw部署·小龙虾一键安装
2501_941982053 天前
通过 API 实时监听企业微信外部群变更事件并同步本地数据库
android·自动化·企业微信·rpa
qingfeng154154 天前
企业微信机器人开发:如何实现自动化与智能运营?
人工智能·python·机器人·自动化·企业微信
qingfeng154154 天前
企业微信 API 自动化开发指南:从消息回调到智能运营实战
java·开发语言·python·自动化·企业微信
qingfeng154154 天前
企业微信消息监听实战:如何实时接收客户消息回调?
人工智能·python·自动化·企业微信