有奖捉虫:办公协同&微信生态&物联网文档专题 HOT
当您通过上述步骤完成 API 接入后,可通过如下方式验证图片内容检测服务是否接入成功。

接入成功

若 Response 回参没有“Error”字段且正常返回业务参数,则说明 IMS 接口接入成功,示例如下所示:
{
"Response": {
"RequestId": "a61237dd-c2a0-43e7-a3da-d27022d39ba7",
"DataId": "a61237dd-c2a0-43e7-a3da-d27022d39ba7",
"BizType": "test_1001",
"Suggestion": "Block",
"FileMD5": "",
"Label": "Porn",
"SubLabel": "SexBehavior",
"Score": 90,
"LabelResults": [
{
"Scene": "Porn",
"Suggestion": "Block",
"Label": "Porn",
"SubLabel": "SexBehavior",
"Score": 90,
"Details": []
}
],
"ObjectResults": [
{
"Scene": "QrCode",
"Suggestion": "Block",
"Label": "Ad",
"SubLabel": "",
"Score": 100,
"Names": [
"QRCODE"
],
"Details": [
{
"Id": 0,
"Name": "QRCODE",
"Score": 100,
"Location": {
"X": 155.01746,
"Y": 396.01746,
"Width": 769.9824,
"Height": 769.98254,
"Rotate": 0
}
}
]
}
],
"OcrResults": [],
"LibResults": [],
"Extra": ""
}
}

接入失败

若 Response 回参显示“Error”字段,则说明接入失败,以下为 signature 校验失败的示例:
{
"Response": {
"Error": {
"Code": "AuthFailure.SignatureFailure",
"Message": "The provided credentials could not be validated. Please check your signature is correct."
},
"RequestId": "ed93f3cb-f35e-473f-b9f3-0d451b8b79c6"
}
}
其中 Error 中的 Code 表示错误码,Message 表示错误的具体信息,详情请参见 错误码


http://www.vxiaotou.com