# Text Content Security Detection
This interface should be invoked on the server side, seeService API。
This interface supportsCloud callDeveloper Tools Version Required >=
1.02.1904090
(Latest[Stable Download](https://developers.weixin.qq.com/miniprogram/dev/devtools /stable.html)),wx-server-sdk
>=0.4.0
Check whether a text contains illegal content.
Examples of application scenarios:
- User Profile Violation Text Detection
- Media news users published articles, comments content detection
- Game users edit and upload material(Questions and answers uploaded by users of quiz games)Detection, etc. Frequency Limit: Single appId The call upper limit is 4000 second/Minutes, 2,000,000 second/day*
Call Mode:
# HTTPS call
# Request address
POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN
# Request parameters
attribute | type | Default value | Required | Introductions |
---|---|---|---|---|
access_Token / cloudbase_access_Token | string | yes | [Interface call credential]((auth.getAccessToken )) | |
content | string | yes | The text content to be detected, no longer than 500KB |
# Return value
# Object
Returned JSON Data packet
attribute | type | Introductions |
---|---|---|
Errcode | number | Error code |
errmsg | string | Error message |
trace_id | string | Unique Request Identification, marking a single request |
result | object | Comprehensive results |
detail | array | Detailed test results |
Errcode The legal value of
value | Introductions | Minimum version |
---|---|---|
0 | Normal content | |
-1 | The system is busy, please try again later. | |
40001 | Token invalid | |
40003 | OpenID is invalid | |
40129 | Scene value error (currently supported scene 1 data2 Comment3 forum4 Social Journal) | |
43104 | Appid doesn't match with openid | |
43302 | Method invocation error, please call with post method | |
44002 | The passed parameter is empty | |
47001 | The parameters passed are in the wrong format | |
61010 | User access log timeout (the user has not accessed the Mini Program in the last two hours) | |
Other | System error |
errmsg The legal value of
value | Introductions | Minimum version |
---|---|---|
"ok" | Normal content | |
"Other Tips" | Error message |
# Call Example
curl -d '{ "content":"hello world!" }' 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN'
# Test case
Special 3456 book yuuo guan 6543 li zxcz garlic 7782 fa fgnv grade
Finished 2347 all dfji test 3726 test asad feeling 3847 know qwez to
Developers can use the above two paragraphs of text to test, if the interface errcode returns 87014(Content contains illegal content)"The connection was successful.
If you encounter problems during the call, you can use the[The official community](https://developers.weixin.qq.com/community/Minihome /mixflow/1591986099080445956)Post exchange.
# Cloud call
Cloud callWeChat cloud development provides the ability to call the WeChat open interface in the cloud function, which needs to be passed in the cloud function.
wx-server-sdk
Use.
# Interface method
openapi.security.msgSecCheck-v1
Required in
config.json
In Configurationsecurity.msgSecCheck-v1
API Of the permissions,details
# Request parameters
attribute | type | Default value | Required | Introductions |
---|---|---|---|---|
content | string | yes | The text content to be detected, no longer than 500KB |
# Return value
# Object
Returned JSON Data packet
attribute | type | Introductions |
---|---|---|
errCode | number | Error code |
errMsg | string | Error message |
traceId | string | Unique Request Identification, marking a single request |
result | object | Comprehensive results |
detail | array | Detailed test results |
errCode The legal value of
value | Introductions | Minimum version |
---|---|---|
0 | success |
# abnormal
# Object
Exception thrown
attribute | type | Introductions |
---|---|---|
errCode | number | Error code |
errMsg | string | Error message |
errCode The legal value of
value | Introductions | Minimum version |
---|---|---|
-1 | The system is busy, please try again later. | |
40001 | Token invalid | |
40003 | OpenID is invalid | |
40129 | Scene value error (currently supported scene 1 data2 Comment3 forum4 Social Journal) | |
43104 | Appid doesn't match with openid | |
43302 | Method invocation error, please call with post method | |
44002 | The passed parameter is empty | |
47001 | The parameters passed are in the wrong format | |
61010 | User access log timeout (the user has not accessed the Mini Program in the last two hours) | |
Other | System error |
errMsg The legal value of
value | Introductions | Minimum version |
---|---|---|
"ok" | Normal content | |
"Other Tips" | Error message |