敏感图片检测接口
发布于 6 年前 作者 mingyan 19961 次浏览 来自 问答

调用敏感图片检测接口

https://api.weixin.qq.com/wxa/img_sec_check?access_token=

总是返回

{“errcode”:41005,“errmsg”:“media data missing hint: [yccPpa00088***]”}

参数:@C:\phpStudy\WWW\test\upload_cut_tempimg\15246560060977.jpg

10 回复

我是内测用户

我也遇到这个问题了,不过经过不断尝试解决了,特来分享一下

php版本:7.1.1

function img_check($img_path){
    $access_token = get_user_access_token();
    $url = 'https://api.weixin.qq.com/wxa/img_sec_check?access_token='.$access_token;
 
    $post_data = [
        'media'=>new CURLFile($_SERVER['DOCUMENT_ROOT'].$img_path)
    ];
 
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 100);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}

{“errcode”:87014,“errmsg”:“risky content hint: [1J7CIa04481548]”}传了一张非法图片,返回:

传正常的图片,返回:

{“errcode”:0,“errmsg”:“ok”}

你好,接口错误意思是我们在文档约定的字段(表单当中key=media)没有找到图片内容。

请检查你的调用方式,或者提供http请求包。

我也遇到了同样的问题.崩溃死

截图即可。

你好我也是遇到这个问题,是怎么回事 ,下面是传的buffer图片

@徐金金,请问你是怎么解决的?能贴下代码吗?谢谢,我现在用这个接口,一直报

{"errcode":47001,"errmsg":"data format error hint}错误

这是什么意思啊。。。

问一下这个接口文档在哪里呢

回到顶部