当您通过上述步骤完成 API 接入后,可通过如下方式验证音频内容检测服务是否接入成功。
接入成功
若 Response 回参没有“Error”字段且正常返回业务参数,则说明 AMS 接口接入成功,示例如下所示:
{"Response": {"Results": [{"DataId": "0a782332-c9db-4cf5-a66e-20d60b4ea469","TaskId": "c933aca1-90d2-4ab8-b045-f1b08069d76f","Code": "OK","Message": "Success"}],"RequestId": "c933aca1-90d2-4ab8-b045-f1b08069d76f"}}
异步回调结果示例
{"TaskId": "w-audio-ZSS_LFTB3lSvDHmP","DataId": "test","BizType": "default","Name": "","Status": "RUNNING","Type": "AUDIO","Suggestion": "Block","Labels": [],"InputInfo": null,"MediaInfo": null,"AudioText": "","ImageSegments": [],"AudioSegments": [{"Result": {"HitFlag": 1,"Url": "https://cos.ap-guangzhou.myqcloud.com/yunyingpingtai-xxxx/_cms_segments/cms/vod/w-audio-ZSS_LFTB3lSvDHmP/audio_120_1696907088.mp3","Suggestion": "Block","Label": "Terror","Text": "xxxxxxxxxxxxxxxxxxxx","TextResults": [{"Label": "Illegal","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Spam","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Terror","Score": 0,"Keywords": [],"Suggestion": "Block","LibId": "","LibType": 0,"LibName": "","SubLabel": "Crowd"},{"Label": "Porn","Score": 2,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Ad","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Abuse","Score": 1,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""}],"MoanResults": [{"Label": "Moan","Score": 1,"StartTime": 0,"EndTime": 15,"Suggestion": "Pass","SubLabel": ""}],"LanguageResults": [{"Label": "yue","Score": 99,"StartTime": 0,"EndTime": 15}],"Duration": "15000","Score": 98,"Extra": "","SpeakerResults": [],"LabelResults": [],"TravelResults": [],"SubLabel": "ReactionaryDivision","RecognitionResults": []},"OffsetTime": "120","CreatedAt": null}],"TryInSeconds": 0,"CreatedAt": null,"UpdatedAt": null,"ErrorType": "","ErrorDescription": "","Asrs": [],"Label": "","SegmentCosUrlList": null}
{"TaskId": "w-audio-ZSS_LFTB3lSvDHmP","DataId": "test","BizType": "default","Name": "测试音频","Status": "FINISH","Type": "AUDIO","Suggestion": "Block","Labels": [{"Label": "Terror","Suggestion": "Review","Score": 99,"SubLabel": "Crowd"}],"InputInfo": null,"MediaInfo": {"Codecs": "","Duration": 144,"Width": 0,"Height": 0,"Thumbnail": ""},"AudioText": "xxxxxxxxxxxxxxxxxxxx","ImageSegments": [],"AudioSegments": [{"Result": {"HitFlag": 1,"Url": "https://cos.ap-guangzhou.myqcloud.com/yunyingpingtai-xxxx/_cms_segments/cms/vod/w-audio-ZSS_LFTB3lSvDHmP/audio_60_1696907073.mp3","Suggestion": "Block","Label": "Polity","Text": "xxxxxxxxxxxxxxxxxxxx","TextResults": [{"Label": "Terror","Score": 0,"Keywords": [],"Suggestion": "Block","LibId": "","LibType": 0,"LibName": "","SubLabel": "Crowd"},{"Label": "Porn","Score": 2,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Ad","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Abuse","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Illegal","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""},{"Label": "Spam","Score": 0,"Keywords": [],"Suggestion": "Pass","LibId": "","LibType": 0,"LibName": "","SubLabel": ""}],"MoanResults": [{"Label": "Moan","Score": 3,"StartTime": 0,"EndTime": 15,"Suggestion": "Pass","SubLabel": ""}],"LanguageResults": [{"Label": "yue","Score": 90,"StartTime": 0,"EndTime": 15},{"Label": "dialect","Score": 9,"StartTime": 0,"EndTime": 15}],"Duration": "15000","Score": 99,"Extra": "","SpeakerResults": [],"LabelResults": [],"TravelResults": [],"SubLabel": "NationalInstitution","RecognitionResults": []},"OffsetTime": "60","CreatedAt": "2023-10-10T11:04:34Z"}],"TryInSeconds": 0,"CreatedAt": "1970-01-01T00:00:00Z","UpdatedAt": null,"ErrorType": "","ErrorDescription": "","Asrs": [{"text": "xxxxxxxxxxxxxxxxxxxx","CreatedAt": "2023-10-10T11:04:34Z"},{"text": "xxxxxxxxxxxxxxxxxxxx","CreatedAt": "2023-10-10T11:04:38Z"}],"Label": "Porn","SegmentCosUrlList": null}
接入失败
若 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"}}