# 视频大纲回调通知说明

## 功能说明

在视频大纲任务相关处理环节（如视频大纲任务分析成功, 分析失败等）触发后，系统会将此时视频大纲任务的状态，通过HTTP方式回调给客户的服务，以便知道任务的处理进度。

[创建视频大纲api](https://git.polyv.net/help-center/document-center/-/blob/master/vod/api/video_management/video_outline/create_video_outline_task.md)

## 其他说明

1. 对回调接口响应http状态码200，视为本次回调成功，后续不会发起回调重试。
2. 对回调接口响应的http状态码非200，视为本次回调失败，后续会发起回调重试，但最多只会重试3次，三次重试仍失败后将不会再触发当前事件的回调。

## 回调配置

请联系保利威客服人员配置回调URL

有配置了回调URL的用户，才会发送回调请求。

## 回调事件类型

### 一、视频大纲任务处理成功

* 事件描述：视频大纲分析完成后，会触发**视频大纲任务处理成功**回调事件。
* HTTP请求方式为：POST。
* HTTP请求参数格式：application/json

#### 回调参数

| 名称           | 类型     | 必填 | 描述                                                                                                                                         |
| ------------ | ------ | -- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| sign         | string | 是  | 详见（[视频大纲回调签名参数说明](https://git.polyv.net/help-center/document-center/-/blob/master/vod/api/video_outline_task_callback.md?id=视频大纲回调签名参数说明)） |
| timestamp    | long   | 是  | 当前事件触发时的时间，格式是13位时间戳                                                                                                                       |
| callbackType | string | 是  | 回调类型，固定值 generate\_success                                                                                                                 |
| taskId       | long   | 是  | 字幕任务id                                                                                                                                     |
| vid          | string | 是  | 视频ID                                                                                                                                       |
| outlineInfo  | List   | 是  | 视频大纲信息                                                                                                                                     |

#### 回调示例

```
https://demo-callback.com/video-outline-task/callback/test

{
    "sign": "02EAD645ED22A87B35A9818BDE24A884125267C7",
    "timestamp": 1683622364265,
    "callbackType": "generate_success",
    "taskId": 30,
    "vid": "c560fac50f0eeab9589e8bfa4e08c2b4_c",
    "outlineInfo": [
        {
            "title": "职业道德基本知识",
            "startTime": "00:00:00,080",
            "endTime": "00:04:07,610",
            "startIndex": 0,
            "endIndex": 110,
            "summary": [
                "道德与职业道德的概念",
                "道德由社会基础决定，高于法律",
                "职业道德是职业行为的反映",
                "职业道德随社会发展而产生",
                "行为规范是自我道德约束"
            ],
            "keyword": [
                "道德",
                "职业道德",
                "社会发展",
                "行为规范"
            ]
        },
        {
            "title": "职业道德与健康管理师",
            "startTime": "00:04:08,180",
            "endTime": "00:08:33,765",
            "startIndex": 111,
            "endIndex": 244,
            "summary": [
                "道德是行为规范",
                "职业道德需遵守规范",
                "普适道德规范",
                "健康管理师职业规范",
                "爱国、遵法、尽责、公正"
            ],
            "keyword": [
                "道德",
                "职业道德",
                "健康管理师",
                "爱国",
                "公正"
            ]
        },
        {
            "title": "健康管理师职业道德规范",
            "startTime": "00:08:33,765",
            "endTime": "00:12:30,600",
            "startIndex": 245,
            "endIndex": 371,
            "summary": [
                "公平公开，一视同仁",
                "精益求精，追求卓越",
                "匠心精神，乐于奉献",
                "提供有价值服务",
                "淡泊名利，成就人生"
            ],
            "keyword": [
                "健康管理师",
                "职业道德",
                "规范",
                "精益求精",
                "匠心精神"
            ]
        }
    ]
}

```

### 二、视频大纲任务处理失败

* 事件描述：在处理视频生成字幕的过程中，某个操作步骤失败会触发此回调。
* HTTP请求方式为：POST。
* HTTP请求参数格式：application/json

#### 回调参数

| 名称           | 类型     | 必填 | 描述                                                                                                                                         |
| ------------ | ------ | -- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| sign         | string | 是  | 详见（[视频大纲回调签名参数说明](https://git.polyv.net/help-center/document-center/-/blob/master/vod/api/video_outline_task_callback.md?id=视频大纲回调签名参数说明)） |
| timestamp    | long   | 是  | 当前事件触发时的时间，格式是13位时间戳                                                                                                                       |
| callbackType | string | 是  | 回调类型，固定值 generate\_fail                                                                                                                    |
| taskId       | long   | 是  | 字幕任务id                                                                                                                                     |
| vid          | string | 是  | 视频ID                                                                                                                                       |

#### 回调示例

```
https://demo-callback.com/video-outline-task/callback/test

{
    "sign": "02EAD645ED22A87B35A9818BDE24A884125267C7",
    "timestamp": 1683622364265,
    "callbackType": "generate_fail",
    "taskId": 30,
    "vid": "c560fac50f0eeab9589e8bfa4e08c2b4_c",
}

```

## 视频大纲回调签名参数说明

校验签名（sign）参数可以有效避免收到伪造的回调请求，请对接了视频大纲任务回调的用户务必校验签名参数是否正确，以免造成不必要的麻烦。

### 签名生成规则

1. 对字符串 (secretKey + timestamp + timestamp + secretKey) 做SHA1加密。如SHA1( mySecretKey16836223642651683622364265mySecretKey)
2. 把SHA1加密后的字符串转成大写

其中timestamp是13位时间戳，会在回调接口的请求参数中拿到，用户的secretKey可以在 **设置** --> **API接口**中查看。

![图片](/files/7jvTRcaxArI7jQKaiFtN)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://polyv.gitbook.io/document/docs/vod/api/video_outline_task_callback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
