May 19, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the service side API.
This interface supports cloud calls. The developer tool version is required to be 1.02.1904090 (latest stable download), wx-server-sdk, and 0.4.0
Check that a piece of text contains illegal content.
Examples of scenarios:
How to call:
POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
content | string | Is | The text content to be detected is no longer than 500KB long |
The returned JSON packet
Property | Type | Description |
---|---|---|
errcode | number | Error code |
errMsg | string | The error message |
The legal value of errcode
Value | Description | The lowest version |
---|---|---|
0 | The content is OK | |
87014 | Content contains illegal and illegal content |
The legal value of err Msg
Value | Description | The lowest version |
---|---|---|
"ok" | The content is OK | |
"risky | Content content contains illegal and illegal content |
curl -d '{ "content":"hello world!" }' 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN'
特3456书yuuo莞6543李zxcz蒜7782法fgnv级
完2347全dfji试3726测asad感3847知qwez到
Developers can test with the above two paragraphs of text, and if the interface errcode returns 87014 (content contains illegal content), the docking is successful.
If you encounter problems during the call, you can post and communicate in the Coral Safe Community.
Cloud calling is the ability provided by the small program Cloud Development to invoke WeChat's open interface in cloud functions and needs to be used in cloud functions via wx-server-sdk.
openapi.security.msgSecCheck
Permissions for the security.msgSecCheck API need to be configured in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
content | string | Is | The text content to be detected is no longer than 500KB long |
The returned JSON packet
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | The error message |
The legal value of errCode
Value | Description | The lowest version |
---|---|---|
0 | Success |
The exception thrown
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | The error message |
The legal value of errCode
Value | Description | The lowest version |
---|---|---|
87014 | Content contains illegal and illegal content |
The legal value of err Msg
Value | Description | The lowest version |
---|---|---|
"ok" | The content is OK | |
"risky | Content content contains illegal and illegal content |