# security.msgSecCheck

Call this API at the server side. For more information, see Server API.

This API supports Cloud Calls. The WeChat DevTools version must be 1.02.1904090 or later (download the latest stable version here), and the wx-server-sdk version must be 0.4.0 or later.

Checks whether a section of text contains illegal or infringing content.

Use Cases:

  1. Detects infringing words in the personal information of users.
  2. Detects articles and comments posted by media news users.
  3. Detects media (for example, questions and answers uploaded by quiz Mini Game users) edited and uploaded by game users. Frequency limit: Each AppID can be called for a maximum of 4000 times per minute and 2,000,000 times per day.*

Calling methods:

# HTTPS Call

# Request Address

POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN

# Request Parameters

Attribute Type Default Required Description
access_token string Yes Credentials to call API
content string Yes The text content to be detected. It should not exceed 500 KB.

# Return Value

# Object

JSON data package that is returned

Attribute Type Description
errcode number Error code
errMsg string Error message

Valid values of errcode

Value Description Minimum Version
0 Proper content
87014 The picture contains illegal or infringing content.

Valid values of errMsg

Value Description Minimum Version
"ok" Proper content
"risky The content contains illegal or infringing content.

# Calling Example

curl -d '{ "content":"hello world!" }' 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN'

# Test Cases

特3456书yuuo莞6543李zxcz蒜7782法fgnv级
完2347全dfji试3726测asad感3847知qwez到

Developers can test using the above text. If the API returns errcode 87014 (The text contains illegal or infringing content), the call is successful.

# Cloud Call

Cloud call is a capability provided by Mini Program·Cloud Base that allows you to call WeChat APIs in a cloud function. It must be used via wx-server-sdk in the cloud function.

# API Calling Method

openapi.security.msgSecCheck

You need to configure the permissions for the security.msgSecCheck API via config.json. Details

# Request Parameters

Attribute Type Default Required Description
content string Yes The text content to be detected. It should not exceed 500 KB.

# Return Value

# Object

JSON data package that is returned

Attribute Type Description
errCode number Error code
errMsg string Error message

Valid values of errCode

Value Description Minimum Version
0 Succeeded

# Exceptions

# Object

Thrown Exceptions

Property Type Description
errCode number Error code
errMsg string Error message

Valid values of errCode

Value Description Minimum Version
87014 The picture contains illegal or infringing content.

Valid values of errMsg

Value Description Minimum Version
"ok" Proper content
"risky The content contains illegal or infringing content.
点击咨询小助手