多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# msgSecCheck ### msgSecCheck 检查一段文本是否含有违法违规内容。应用场景举例:用户个人资料违规文字检测;媒体新闻类用户发表文章,评论内容检测;游戏类用户编辑上传的素材(如答题类小游戏用户上传的问题及答案)检测等。**频率限制:单个 appId 调用上限为 2000 次/分钟,1,000,000 次/天** #### 请求地址 ``` <pre class="prettyprint"><ol class="linenums"><li class="l"><code class="pcalibre9 pcalibre8 pcalibre7"><span class="pln">GET https</span><span class="pun">:</span><span class="com">//api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN</span></code></li></ol> ``` #### 参数 ##### string access\_token [接口调用凭证](/read/wechat-game-api/297.md) ##### string content 要检测的文本内容,长度不超过 500KB #### 返回值 ##### Object 返回的 JSON 数据包 属性类型说明支持版本errcodenumber错误码errMsgstring错误信息**errcode 的合法值** 值说明0内容正常87014内容含有违法违规内容**errMsg 的合法值** 值说明"ok"内容正常"riskycontent" 内容含有违法违规内容#### 调用示例 ``` <pre class="prettyprint"><ol class="linenums"><li class="l"><code class="pcalibre9 pcalibre8 pcalibre7"><span class="pln">curl </span><span class="pun">-</span><span class="pln">d </span><span class="str">'{ "content":"hello world!" }'</span><span class="pln"> </span><span class="str">'https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN'</span></code></li></ol> ``` #### 测试用例 ``` <pre class="prettyprint"><ol class="linenums"><li class="l"><code class="pcalibre9 pcalibre8 pcalibre7"><span class="pun">特</span><span class="lit">3456</span><span class="pun">书</span><span class="pln">yuuo</span><span class="pun">莞</span><span class="lit">6543</span><span class="pun">李</span><span class="pln">zxcz</span><span class="pun">蒜</span><span class="lit">7782</span><span class="pun">法</span><span class="pln">fgnv</span><span class="pun">级</span><span class="pln"> </span></code></li> <li class="l1"><code class="pcalibre9 pcalibre8 pcalibre7"><span class="pun">完</span><span class="lit">2347</span><span class="pun">全</span><span class="pln">dfji</span><span class="pun">试</span><span class="lit">3726</span><span class="pun">测</span><span class="pln">asad</span><span class="pun">感</span><span class="lit">3847</span><span class="pun">知</span><span class="pln">qwez</span><span class="pun">到</span><span class="pln"> </span></code></li> </ol> ``` 开发者可使用以上两段文本进行测试,若接口errcode返回87014(内容含有违法违规内容),则对接成功。 > 原文: <https://developers.weixin.qq.com/minigame/dev/api/open-api/sec-check/msgSecCheck.html>