回调查询接口

2022.06.24 10:49:28

    回调查询接口用于通过taskId来查询机器检测结果或人工审核结果,主要为了避免在使用轮询模式或推送模式获取结果的过程中由于网络错误等原因导致的数据丢失。

    接口说明

    提供通过taskId来查询机器检测结果或人工审核结果的功能,需要客户根据taskId主动调用接口来获取结果。支持最近7天范围内的检测数据结果查询。

    鉴权说明

    易盾内容安全服务使用签名方法对接口进行鉴权,所有接口每一次请求都需要包含签名信息(signature 参数),以验证用户身份,防止信息被恶意篡改。目前支持MD5,SHA1,SHA256,SM3几种加密算法,详细信息,请参见接口鉴权

    结果说明

    • 支持最近7天范围内的数据查询
    • 接口一次最多支持100个taskId的查询
    • 接口请求频率限制为1s不超过100个taskId的查询,过快服务器会拒绝处理,客户可以根据业务需求进行适当调整

    接口耗时

    结果获取接口的响应很快,正常100ms内返回结果,业务方根据需求适当调整超时时间,建议为1s

    请求

    请求地址

    名称
    HTTP URL https://as.dun.163.com/v2/mediasolution/callback/query
    HTTP Method POST

    请求头

    名称 类型 必填 描述
    Content-Type String 固定值:"application/x-www-form-urlencoded"

    请求参数

    请求参数由公共参数和业务参数两部分组成,公共参数见请求公共参数

    名称 类型 必填 最大长度 描述
    version String Y 4 接口版本,当前版本为v2
    taskIds String[] Y 单次查询支持最多查询100条数据

    请求体示例

    version=v2
    &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"
                },
                "valueAddService": {
                    "emotionAnalysis": {
                        "texts": [
                            {
                                "dataId": "192470",
                                "field": "image1",
                                "details": [
                                    {
                                        "sentiment": "positive",
                                        "positiveProb": 0.7576994299888611,
                                        "negativeProb": 0.24208970367908478
                                    }
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr"
                            }
                        ]
                    },
                    "face": {
                        "images": [
                            {
                                "dataId": "792707",
                                "field": "image1",
                                "details": [
                                    {
                                        "faceContents": [
                                            {
                                                "maskType": "normal",
                                                "expression": "happy",
                                                "gender": "male",
                                                "y1": 0.1756,
                                                "name": "张三",
                                                "y2": 0.7165,
                                                "x1": 0.1711,
                                                "x2": 0.8457,
                                                "type": "normal",
                                                "category": "normal",
                                                "beautyScore": 0.49,
                                                "age": 50
                                            }
                                        ],
                                        "faceNumber": 1
                                    }
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr"
                            }
                        ]
                    },
                    "imageDiscern": {
                        "images": [
                            {
                                "dataId": "792707",
                                "field": "image1",
                                "details": [
                                    {
                                        "rate": 0.9593,
                                        "type": 3,
                                        "discernName": "张三"
                                    },
                                    {
                                        "rate": 0.755,
                                        "type": 3,
                                        "discernName": "人物特写"
                                    },
                                    {
                                        "rate": 0.4752,
                                        "type": 3,
                                        "discernName": "人脸"
                                    }
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr"
                            }
                        ]
                    },
                    "logo": {
                        "images": [
                            {
                                "dataId": "792707",
                                "field": "image1",
                                "details": [
                                    
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr"
                            }
                        ]
                    },
                    "language": {
                        "texts": [
                            {
                                "dataId": "192470",
                                "field": "image1",
                                "details": [
                                    {
                                        "type": "zh"
                                    }
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr"
                            }
                        ]
                    },
                    "imageQuality": {
                        "images": [
                            {
                                "dataId": "792707",
                                "field": "image1",
                                "details": [
                                    {
                                        "metaInfo": {
                                            "byteSize": 124343,
                                            "format": "png",
                                            "width": 267,
                                            "height": 333
                                        },
                                        "sharpnessRate": 0.7394,
                                        "aestheticsRate": 0.6262,
                                        "boarderInfo": {
                                            "hit": false,
                                            "top": false,
                                            "left": false,
                                            "bottom": false,
                                            "right": false
                                        },
                                        "backgroundInfo": {
                                            "pureBackground": false
                                        }
                                    }
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr"
                            }
                        ]
                    },
                    "ocr": {
                        "images": [
                            {
                                "dataId": "792707",
                                "field": "image1",
                                "width": 267,
                                "details": [
                                    
                                ],
                                "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr",
                                "height": 333
                            }
                        ]
                    }
                },
                "anticheat": {
                    "suggestion": 2,
                    "taskId": "81uoe1igu601b2v2wfoik3fg05009pgr",
                    "hitInfo": {
                        "hitType": 3
                    }
                },
                "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"
                                        }
                                    ]
                                }
                            ],
                            "files": [
                                {
                                    "censorResult": 2,
                                    "dataId": "855180",
                                    "field": "content",
                                    "texts": [
                                        {
                                            "censorLabels": [
                                                
                                            ],
                                            "reason": "违规文本",
                                            "text": "异常的的异常"
                                        }
                                    ],
                                    "images": [
                                        {
                                            "censorLabels": [
                                                
                                            ],
                                            "reason": "违规图片",
                                            "url": "https://image.jpg"
                                        }
                                    ]
                                }
                            ],
                            "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接入方法

    为方便 JAVA 开发者调试和接入API,我们提供了配套的开发工具集(SDK),用于简化API接入流程。SDK中各接口调用方式基本相同,接入方式统一,并提供了一些接口调用过程中常见的异常处理方案。以下介绍了SDK的使用流程,以及首次使用SDK的简单示例。

    如果您使用的是其他语言,请参考各语言示例demo

    • 准备工作

    准备步骤详见通用步骤

    • 使用方法

    使用方法可参考使用SDK

    Online Chat Tel:95163223