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. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0
Check to see if a picture contains illegal content.
Examples of scenarios:
How to call:
POST https://api.weixin.qq.com/wxa/img_sec_check?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
media | FormData | Is | The image files to be detected are in PNG, JPEG, JPG, GIF, and the picture size does not exceed 750px x 1334px |
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 -F media=@test.jpg 'https://api.weixin.qq.com/wxa/img_sec_check?access_token=ACCESS_TOKEN'
If you encounter problems during the call, you can post and communicate in the Coral Safe Community.
Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.
openapi.security.imgSecCheck
Permissions for the security.imgSecCheck API need to be configured in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
media | FormData | Is | Media file data |
The structure of the media
Property | Type | The default | Required | Description |
---|---|---|---|---|
contentType | string | Is | Data type, incoming MIME Type | |
value | Buffer | Is | File Buffer |
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 |
// cloud = require('wx-server-sdk')
// ...
// 方法返回 Promise
cloud.openapi.security.imgSecCheck({
media: {
contentType: 'image/png',
value: Buffer
}
})