创建webhook,在翻译、配音达到特定节点的时候调用该接口,如果一次调用失败,系统会自动重试两次,一共请求三次;发送的内容中新增字符串字段 delivery_id,其他字段、结构和类型保持不变;同一次投递的 3 次请求复用同一个 ID。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
Action | String | 是 | WebhooksCreate | 要执行的操作,取值:WebhooksCreate。 |
Version | String | 是 | 2021-05-21 | API的版本,取值:2021-05-21。 |
hookIds | Array of Integer | 是 | [37, 38] | hooksIds,当流程达到这些节点的时候会给配置的url发送post请求; |
name | String | 是 | 创建任务的hooks | hook的名称 |
type | String | 是 | 用于判断给什么类型的项目创建,视频类型传值为 video | { |
projectId | String | 是 | 10450295321856 | 项目id |
url | String | 是 | https://yoururl.com/api | webhook回调地址。,注意是post请求。 |
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
message | String | success | 接口返回信息 |
POST /?Action=WebhooksCreate&Version=2021-05-21&name=bbEa&projectId=RiWjIbUbn&url=Jhw HTTP/1.1 Host: open.volcengineapi.com Content-Type: application/json; charset=UTF-8 X-Date: 20251108T103237Z X-Content-Sha256: 287e874e******d653b44d21e Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251108/cn-beijing/i18n_openapi/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f { "hookIds": [ 0 ], "type": "用于判断给什么类型的项目创建,视频类型传值为 video" }
{ "ResponseMetadata": { "RequestId": "202511081832430480351340531884B8", "Action": "WebhooksCreate", "Version": "2021-05-21", "Service": "i18n_openapi", "Region": "cn-beijing" }, "Result": { "message": "DvS" } }
您可访问公共错误码,获取更多错误码信息。
// video.task.created 示例 {"event":"video.task.created", "projectId":"26573440770", "operator":"2100332519", "timestamp":1764145716380, "operationType":0, "type":2, "taskId":"26800504322"} // video.task.finished 示例 { "event": "video.task.finished", "projectId": "25949905666", "operator": "2100332519", "timestamp": 1763703132450, "operationType": 0, "type": 2, "taskId": "25949874946", "subtasks": [ { "subtaskId": 25949876226, "episodeNum": 1, "suppressionVideoUrl": "xxxxx" }, { "subtaskId": 25949876482, "episodeNum": 2, "suppressionVideoUrl": "xxxxx" } ] } //video.subtask.product.updated 返回示例 { "event": "video.subtask.product.updated", "projectId": "331325223170", "operator": "67132380", "timestamp": 1784192090181, "operationType": 0, // 操作类型,系统平台触发时为 0 "type": 2, // 消息分类,视频类固定为 2 "taskId": 331325223682, "taskType": 4, "taskStatus": 2, "subtaskId": 331325227522, "subtaskType": 2, "subtaskStatus": 3, "episodeNum": 3, "processType": 2, // 产物所属流程类型,2 表示 target_process "processId": 24801748, "productType": 4, // 更新的产物类型:2 表示argetSubtitles(译文字幕);4 表示FinishedVideo(成品视频);5 表示FinishedAudio(成品音频) "msg": "子任务产物更新" } // video.term.translate.finished 返回示例 { "event": "video.term.translate.finished", "project_id": 387157295106, "operatorName": "operator", "timestamp": 1785501210336, "operationType": 0, // 操作类型,系统平台触发时为 0 "type": 2, // 消息分类,视频类固定为 2 "msg": "术语翻译已完成" } // video.subtask.material_quality.issue 返回示例 { "event":"video.subtask.material_quality.issue", "project_id":631026985474, "operatorName":"operator", "timestamp":1793959895532, "operationType":0, "type":2, "demand_id":"631857447682", "taskType":1, "taskStatus":9, "subtaskId":631857447938, "subtaskType":0, "subtaskStatus":1, "episodeNum":1, "processType":2, "processId":60209719, "materialIssues":[{ "reportId":631857457154, "projectId":631026985474, "taskId":631857447682, "subtaskId":631857447938, "episodeNum":1, "startTime":0, "endTime":0, "inspectionType":9, "inspectionLevel":1, "subInspectionType":31, "videoName":"", "reason":"字幕结束时间超过原视频时长,请重新上传正确的视频文件或字幕文件", "reasonCode":"Error_211381", "resourceType":1, "resourceId":"v0234dg10001dbmqfhq7dld00vfa18v0" }], "msg":"子任务存在素材问题", "delivery_id":"ef65ae9cfc79cb5d8322590f8066b6da" }