接入后验证

最近更新时间:2024-09-10 14:22:11

我的收藏
当您通过上述步骤完成 API 接入后,可通过如下方式验证文本内容检测服务是否接入成功。

接入成功

若 Response 回参没有“Error”字段且正常返回业务参数,则说明 TMS 接口接入成功,示例如下所示:
{
"Response": {
"DataId": "123",
"Extra": "xx",
"BizType": "0",
"RiskDetails": [
{
"Level": 2,
"Label": "RiskAccount"
}
],
"DetailResults": [
{
"LibName": "Porn",
"Score": 72,
"Label": "Porn",
"LibId": "12",
"Suggestion": "Review",
"Keywords": [
"色情"
],
"LibType": 0
},
{
"LibName": "Porn",
"Score": 0,
"Label": "",
"LibId": "1",
"Suggestion": "Block",
"Keywords": [
"色情"
],
"LibType": 2
}
],
"Label": "Ad",
"Score": 87,
"RequestId": "x2123-123123-123",
"Suggestion": "Block",
"Keywords": [
"加我好友,给你发优惠券"
]
}
}

接入失败

若 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 表示错误的具体信息,详情请参见 错误码
如您仍无法定位接入错误的原因,可以 提交工单 联系技术工程师,我们会7*24小时响应和解决您的问题。