框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|
小程序 | Bug | msgSecCheck | 微信iOS客户端 | 7.0.13 | 2.4.0 |
珊瑚文本内容安全检测接口:
https://developers.weixin.qq.com/community/servicemarket/detail/00040275a14468e0e689194b251015
中给的服务端调用示例:
服务端调用demo
http://api.weixin.qq.com/wxa/servicemarket?access_token={access_token}
{
"service": "wxee446d7507c68b11",
"api": "msgSecCheck",
"client_msg_id" : "client_msg_id_1",
"data": {
"Action": "TextApproval",
"Text": "hello world!"
}
}
然而在实际使用中
小程序的APPID:wxdb94f760ef2c06bf
使用的开发语言为PHP,具体代码如下:
$minApp = new \model\MinApp(config('appid'));
$content = '测试文本';
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.weixin.qq.com/wxa/servicemarket?access_token=' . $minApp->access_token(), [
'json' => [
"service" => config('appid'),
"api" => "msgSecCheck",
"client_msg_id" => unique_id(),
"data" => [
"Action" => "TextApproval",
"Text" => $content
]
]
]);
p(json_decode($response->getBody()->getContents(), true));
接口返回结果:
Array
(
[errcode] => 9301007
[errmsg] => invalid api config hint: [eGnBcMylRa-.J1] request id:[MLyup6dXXnUce5JUdPDIo2c48sc5kNEUmKmE6A0_xRLeS0tbtvaV3kcQhv7ffNjIZRk]
)
尝试了各种参数调用,终究是没有调用成功,请问官方可以给个解决方法吗?