收藏
回答

为什么后台调用接口敏感词检测msg_sec_check 一直报错errcode:47001?代码如下


回答关注问题邀请回答
收藏

1 个回答

  • 灵芝
    灵芝
    2019-10-08

    你好,可根据以下方式排查问题:

    1、是否采用post请求方式 

    2、是否已经把unicode转为utf-8   

    (参考链接:https://www.jb51.net/article/70251.htm

    3、内容安全监测主要是覆盖涉政,色情,违法这几类



    2019-10-08
    有用
    回复 3
    • 蔚蓝不远
      蔚蓝不远
      2019-10-08
      转utf-8是调用api时,传的参数要utf-8嘛
      2019-10-08
      回复
    • 风起
      风起
      2019-11-04回复蔚蓝不远
      问题解决了吗,遇到同样的问题
      2019-11-04
      回复
    • 更改名字
      更改名字
      2019-11-05
      CloseableHttpClient httpclient = HttpClients.createDefault();
                  CloseableHttpResponse response = null;
                  HttpPost request = new HttpPost("https://api.weixin.qq.com/wxa/msg_sec_check?access_token=" + jo.getString("access_token"));
                  request.addHeader("Content-Type", "application/json");
                  Map map = new HashMap<>();
                  map.put("content",content);
                  String body = com.alibaba.fastjson.JSONObject.toJSONString(map);
                  request.setEntity(new StringEntity(body,ContentType.create("text/json", "UTF-8")));
                  response = httpclient.execute(request);
                  HttpEntity httpEntity = response.getEntity();
                  String result = EntityUtils.toString(httpEntity, "UTF-8");// 转成string
                  com.alibaba.fastjson.JSONObject jso = com.alibaba.fastjson.JSONObject.parseObject(result);
                  String errCode = jso.getString("errcode");//错误码 0正常 87014内容含有错误信息
      2019-11-05
      1
      回复
登录 后发表内容
问题标签