May 19, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
Asynchronously verify that the image/audio contains illegal content.
Examples of scenarios:
POST https://api.weixin.qq.com/wxa/media_check_async?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
media_url | string | Is | The multimedia url to detect | |
media_type | number | Is | 1: Audio; 2: Pictures |
The returned JSON packet
Property | Type | Description |
---|---|---|
trace_id | string | Task id, used to match asynchronous push results |
errcode | number | Error code |
errmsg | string | The error message |
The legal value of errcode
Value | Description | The lowest version |
---|---|---|
0 | The detection request has been received |
Asynchronous detection results are pushed to your message receiving server within 30 minutes. The returned JSON packet
Property | Type | Description |
---|---|---|
ToUserName | string | Username |
FromUserName | string | Platform push service username |
CreateTime | number | Send time |
MsgType | string | Default: Event |
Event | string | Default: wxa_media_check |
isrisky | number | Detection results, 0: No risk is detected, 1: Risk |
extra_info_json | string | Additional information, default is empty |
appid | string | AppID of a small program |
trace_id | string | Task ID |
status_code | number | Default is: 0, 4294966288 (-1008) Can't download for link |
curl -d '{ "media_url":"https://developers.weixin.qq.com/miniprogram/assets/images/head_global_z_@all.png","media_type":2 }' 'https://api.weixin.qq.com/wxa/media_check_async?access_token=ACCESS_TOKEN'
media_type need to fill in the url corresponding to the multimedia type, media_url need to ensure that the detection server can be downloaded
{
"errcode" : 0,
"errmsg" : "ok",
"trace_id" : "967e945cd8a3e458f3c74dcb886068e9"
}
{
"ToUserName" : "gh_38cc49f9733b",
"FromUserName" : "oH1fu0FdHqpToe2T6gBj0WyB8iS1",
"CreateTime" : 1552465698,
"MsgType" : "event",
"Event" : "wxa_media_check",
"isrisky" : 0,
"extra_info_json" : "",
"appid" : "wxd8c59133dfcbfc71",
"trace_id" : "967e945cd8a3e458f3c74dcb886068e9",
"status_code" : 0
}
If you encounter problems during the call, you can post an exchange in the Coral Safe Community.