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

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 天前
源雀AI SCRM开源版重磅升级:AI智能标签库
人工智能·企业微信·流量运营
梦想的旅途23 天前
企业微信API:外部群自动化推送实战指南
大数据·机器人·自动化·企业微信·rpa
vx-bot5556663 天前
企业微信ipad协议的事件驱动架构与实时监听实践
架构·企业微信·ipad
天空属于哈夫克33 天前
基于 Webhook 的企业微信外部群自动化推送集成
运维·自动化·企业微信
JZC_xiaozhong3 天前
企业微信对接泛微OA:实现审批进度实时同步与自动催办
企业微信·etl工程师·泛微oa·数据集成与应用集成·业务流程管理系统·异构系统集成·跨系统流程管理
天空属于哈夫克34 天前
Java 开发|企微外部群主动发送小程序消息实战
开发语言·python·小程序·自动化·企业微信·rpa
vx-bot5556664 天前
企业微信ipad协议的标签管理机制与自动化打标实践
自动化·企业微信·ipad
梦想的旅途24 天前
Python 实现企业微信外部群主动消息发送
机器人·自动化·企业微信·rpa
风笑谷8 天前
openclaw+ollama+企业微信 实操记录
企业微信·ollama·openclaw
ipad协议开发9 天前
企业微信iPad协议接口深度解析:技术原理、应用场景与开发实战
ios·企业微信·ipad