- 微信公众号, 图文多草稿摘要限制字数120字,为啥没在文档体现?
微信公众号, 图文多草稿摘要限制字数120字,为啥没在文档体现?我就想知道为啥您家的description限制了120个字,为啥没在文档体现,文档地址:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html ;看下是否可以填充,这个东西太坑人了
2022-07-07 - 新增永久素材,报40113错误?为啥社区没有这个错误啊?
申请测试公众号利用测试公重号发布消息,报{"errcode":40113,"errmsg":"unsupported file type hint: [xxa009498677] rid: 6285f41d-0d4c84df-20472d8c"}不支持文件类型,新增永久封面图不支持?thumb //代码如下 public String testUpload(String path, String type) { File file = new File(path); //地址 //String url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE"; url = url.replace("ACCESS_TOKEN", token).replace("TYPE", type); try { URL urlObj = new URL(url); HttpsURLConnection urlConnection = (HttpsURLConnection) urlObj.openConnection(); //设置属性,设置链接的信息 urlConnection.setDoInput(true); urlConnection.setDoOutput(true); urlConnection.setUseCaches(false); //设置请求头信息 urlConnection.setRequestProperty("Connection", "Keep-Alive"); urlConnection.setRequestProperty("Charset", "utf8"); //数据的边界,什么都可以,相对而言设置成随机的 String boundary = "-----" + System.nanoTime(); urlConnection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary); //获取输出流 out = urlConnection.getOutputStream(); //创建文件的输入流 InputStream inputStream = new FileInputStream(file); //第一部分,头部信息 //准备头部信息 StringBuilder sb = new StringBuilder(); sb.append("--");//post表单要求 sb.append(boundary); sb.append("\r\n"); sb.append("Content-Disposition:form-data;name=\"media\";filename=\"" + file.getName() +"\"\r\n"); sb.append("Content-Type:application/octet-stream\r\n\r\n"); System.out.println("stringBuilder is: "+ sb); out.write(sb.toString().getBytes()); //第二部分,文件内容 byte[] b= new byte[1024]; int len; while ((len = inputStream.read(b)) != -1){ out.write(b,0,len); } //第三部分,尾部信息 String foot = "\r\n--"+boundary + "--\r\n"; out.write(foot.getBytes()); //整个写完 out.flush(); out.close(); StringBuilder res = new StringBuilder(); //读取信息 InputStream ins = urlConnection.getInputStream(); while ((len = ins.read(b)) != -1){ res.append(new String(b,0,len)); } return res.toString(); } catch (Exception e) { e.printStackTrace(); } return "no"; } /** * 测试上传临时素材 */ @Test public void testUploadTmpFile(){ String path = "C:\\Users\\34743\\Desktop\\ma.jpg"; String res = testUpload(path, "thumb"); System.out.println(res); }
2022-05-19 - 发布草稿中无效的mediaId,可是mediaId明明是上传上去了啊?
1、首先thumb_media_id在测试工具中上传成功了 2、我用返回结果的thumb_media_id作为图文消息草稿的封面 3、为啥返回无效的media_id? [图片] thumb_media_id是: ZQl8mI2i-3M_NCVrPUbjDRAXA3bTKcoS0KYUQzV7MJFSGC6ycnJUzaGM4N--Rc_K [图片]
2022-05-19