// 这是java代码可以直接用的参考 import org.apache.commons.codec.digest.DigestUtils;// 重要依赖 @Test public void Test2() throws Exception { String purl = "图片url地址"; URL url = new URL(purl); // 打开连接 URLConnection connection = url.openConnection(); try ( // 获取输入流 InputStream inputStream = connection.getInputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ){ StreamUtils.copy(inputStream, outputStream); // 发送post请求 String rurl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=机器人key"; // 设置请求头 HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); // 创建请求体 Map<String, Object> image = new HashMap<>(); //关键步骤 image.put("base64", Base64.getEncoder().encodeToString(outputStream.toByteArray()).replaceAll("[\r\n]", "")); image.put("md5", DigestUtils.md5Hex(outputStream.toByteArray())); Map<String, Object> requestBody = new HashMap<>(); requestBody.put("msgtype", "image"); requestBody.put("image", image); // 创建 HttpEntity 对象,包含请求头和请求体 HttpEntity<Map<String, Object>> entity = new HttpEntity<>(requestBody, headers); // 发送 POST 请求 ResponseEntity<String> response = restTemplate.postForEntity(rurl, entity, String.class); // 打印响应信息 System.out.println("Response Status Code: " + response.getStatusCode()); System.out.println("Response Body: " + response.getBody()); } catch (RestClientException e) { throw new RuntimeException(e); } }
企业微信机器人发送图片报media md5 not match?media md5 not match, hint: [1589186279_51_26e4b408a53bf40d91d5ccd88d1c6d18], from ip: 223.68.196.14, more info at https://open.work.weixin.qq.com/devtool/query?e=301019
07-02同样的表情包微信能正常显示,企微只能显示[微笑],怎么兼容两个平台的emoji
企业微信emoji表情是否有对应接口,目前做SCRM系统,群发时候需要使用到emoji表情,做模拟测需求为,通过三方应用调用微信emoji表情,目前系统api可否实现,需要指导
2021-12-22我也遇到这种情况,企业微信版本3.1.18(75051)手机是iphoneXR,ios系统版本15.1,一直白屏
企业微信打不开小程序?在部分手机。企业微信点击小程序,无法打开或打开超时
2021-12-16