查询接口
2024.08.29 10:06:43
查询接口通过taskId来查询异步检测结果或人工审核结果,主要为了避免在使用轮询模式或推送模式获取结果的过程中由于网络错误等原因导致的数据丢失。
接口说明
提供通过taskId来查询异步检测结果或人工审核结果的功能,需要客户根据taskId主动调用接口来获取结果。支持最近30天范围内的检测数据结果查询。
鉴权说明
易盾内容安全服务使用签名方法对接口进行鉴权,所有接口每一次请求都需要包含签名信息(signature 参数),以验证用户身份,防止信息被恶意篡改。目前支持MD5,SHA1,SHA256,SM3几种加密算法,详细信息,请参见接口鉴权
结果说明
- 支持最近30天范围内的数据查询
- 接口一次最多支持100个taskId的查询
- 接口请求频率限制为1s不超过100个taskId的查询,过快服务器会拒绝处理,客户可以根据业务需求进行适当调整
接口耗时
结果获取接口的响应很快,正常100ms内返回结果,业务方根据需求适当调整超时时间,建议为1s
请求
请求地址
名称 | 值 |
---|---|
HTTP URL | https://as.dun.163.com/v1/report/callback/query |
HTTP Method | POST |
请求头
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值:"application/x-www-form-urlencoded" |
请求参数
请求参数由公共参数和业务参数两部分组成
公共参数
公共参数包含密钥信息和参数签名信息,公共参数详细见请求公共参数
业务参数
名称 | 类型 | 必填 | 最大长度 | 描述 |
---|---|---|---|---|
version | String | Y | 4 | 接口版本,当前版本为v1 |
taskIds | String[] | Y | 单次查询支持最多查询100条数据 |
请求体示例
version=v1
&taskIds=['13asfda','adsfafd464']
&signature=xxx&secretId=xxx&businessId=xxx
响应
该接口返回举报解决方案异步检测结果或人工审核结果,两类结果响应字段有一定区分。
响应通用字段,详细见 响应公共字段。
举报解决方案响应结果与轮询模式中响应结果一致,详见轮询模式响应结果格式说明。
响应示例
{
"code": 200,
"msg": "ok",
"result": [
{
"antispam": {
"checkStatus": 2,
"dataId": "123",
"suggestion": 2,
"callback": "i am callback",
"evidences": {
"images": [
{
"dataId": "525875",
"field": "content",
"suggestion": 2,
"censorType": 0,
"name": "mp84l9cwy8eqfxydqnx53vug05009pgw",
"resultType": 1,
"labels": [
{
"subLabels": [
{
"subLabel": "50003",
"rate": 1.0,
"details": {
"hitInfos": [
{
"y1": 0.1756,
"y2": 0.7165,
"x1": 0.1711,
"x2": 0.8457,
"value": "李四"
}
]
}
}
],
"level": 2,
"rate": 1.0,
"label": 500
},
{
"level": 0,
"rate": 1.0,
"label": 300
}
],
"status": 2
}
],
"texts": [
{
"dataId": "216292",
"field": "content",
"suggestion": 2,
"censorType": 0,
"isRelatedHit": false,
"resultType": 1,
"labels": [
{
"subLabels": [
{
"subLabel": "100080",
"details": {
"hitInfos": [
{
"positions": [
{
"fieldName": "content",
"startPos": 0,
"endPos": 2
}
],
"value": "测试"
}
],
"keywords": [
{
"word": "测试"
}
]
}
},
{
"subLabel": "100002"
}
],
"level": 2,
"label": 100
},
{
"subLabels": [
{
"subLabel": "500001",
"details": {
"hitInfos": [
{
"positions": [
{
"fieldName": "content",
"startPos": 15,
"endPos": 18
}
],
"value": "测试"
}
]
}
},
{
"subLabel": "500015"
}
],
"level": 2,
"label": 500
},
{
"level": 0,
"label": 200
}
]
}
],
"audios": [
{
"duration": 25000,
"checkTime": 1630485845599,
"dataId": "330957",
"field": "content",
"suggestion": 2,
"resultType": 1,
"segments": [
{
"startTime": 0,
"endTime": 25,
"type": 0,
"content": "测试文本测试文本",
"labels": [
{
"subLabels": [
{
"subLabel": "500013",
"details": {
"hitInfos": [
{
"value": "测试"
},
{
"value": "测,测试"
}
]
}
}
],
"level": 2,
"label": 500
}
]
}
],
"status": 2
}
],
"audiovideos": [
{
"duration": 71339,
"checkTime": 1630485848287,
"dataId": "709664",
"field": "content",
"suggestion": 2,
"evidences": {
"audio": {
"duration": 71,
"suggestion": 2,
"resultType": 1,
"segments": [
{
"startTime": 12,
"endTime": 17,
"type": 1,
"content": "命中声纹检测",
"labels": [
{
"subLabels": [
{
"subLabel": "13000",
"details": {
"hitInfos": [
{
"value": "1.00"
}
]
}
}
],
"level": 2,
"label": 100
}
]
},
{
"startTime": 15,
"endTime": 20,
"type": 1,
"content": "命中声纹检测",
"labels": [
{
"subLabels": [
{
"subLabel": "13000",
"details": {
"hitInfos": [
{
"value": "1.00"
}
]
}
}
],
"level": 2,
"label": 100
}
]
}
],
"status": 2
},
"video": {
"duration": 71,
"suggestion": 2,
"resultType": 1,
"pictures": [
{
"backPics": [
{
"url": "https://123.jpg"
}
],
"frontPics": [
{
"url": "https://456.jpg"
}
],
"startTime": 5000,
"endTime": 5000,
"type": 1,
"url": "789.jpg",
"labels": [
{
"subLabels": [
{
"subLabel": "10007",
"rate": 0.926,
"details": {
"hitInfos": [
{
"value": "卡通色情",
"group": "色情部位分组"
}
]
}
}
],
"level": 2,
"rate": 0.95157,
"label": 100
}
]
}
],
"status": 2
}
},
"resultType": 1,
"status": 2
}
]
},
"resultType": 1,
"taskId": "mp84l9cwy8eqfxydqnx53vug05009pgw"
},
"censor": {
"censorLabels": [
{
"code": "1600759147543",
"name": "变形金刚",
"desc": "变形金刚/地球"
},
{
"code": "1600762076926",
"name": "地球",
"desc": ""
}
],
"suggestion": 2,
"censorRound": 0,
"censorTime": 1630549946549,
"reviewEvidences": {
"reason": "其他",
"remark": "",
"detail": {
"images": [
{
"censorResult": 0,
"reasons": [
{
"censorLabels": [
],
"reason": "违规图片",
"url": "https://image.jpg"
}
],
"dataId": "809577",
"field": "content"
}
],
"texts": [
{
"censorResult": 2,
"reasons": [
{
"censorLabels": [
],
"reason": "违规文本",
"text": "异常的的异常"
}
],
"dataId": "427331",
"field": "content"
},
{
"censorResult": 1,
"dataId": "8114",
"field": "content"
}
],
"audios": [
{
"censorResult": 2,
"dataId": "855180",
"field": "content",
"reasons": [
{
"censorLabels": [
],
"reason": "音频违规",
"startTime": 0,
"endTime": 0,
"url": "https://audio.mp3"
}
]
}
],
"videos": [
{
"censorResult": 2,
"dataId": "855180",
"field": "content",
"reasons": [
{
"censorLabels": [
],
"reason": "视频中图片违规",
"startTime": 0,
"endTime": 0,
"url": "https://video.mp4"
}
]
}
],
"audiovideos": [
{
"censorResult": 2,
"dataId": "855180",
"field": "content",
"audios": [
{
"censorLabels": [
],
"reason": "音频违规",
"startTime": 0,
"endTime": 0,
"url": "https://video.mp4"
}
],
"videos": [
{
"censorLabels": [
],
"reason": "视频中图片违规",
"startTime": 0,
"endTime": 0,
"url": "https://video.mp4"
}
]
}
]
}
},
"skipCensor": 0,
"censorSource": 0,
"resultType": 2,
"taskId": "x4vo2xy2whrd3ovnsb7dplhg05009phe"
}
}
]
}
示例代码
服务端 SDK 接入
推荐使用我们提供的服务端 SDK 进行接入(目前支持 Java 和 Go 两种语言),不但可以节省接入成本,实现更快速的集成,并享有灵活的请求配置选项,同时 SDK 内置了错误重试、熔断降级等功能,提升服务可用性。点击 服务端 SDK 接入指引 了解更多。