频道自定义预约回调通知
更新时间:2025-09-03 18:46:46
作用
针对打开了自定义预约并且设置了预约回调地址的频道,在预约时间段内,用户进入观看页点击观看页的预约或者取消预约按钮都会以* *POST**方式提交到给用户自定义的回调接口。
回调失败重试
- 接口如果没有返回 http status 200 状态码, 会认为用户处理本次回调失败,针对失败的情况, 会重试3次回调
回调参数说明
预约/取消预约回调
- 请求方式: POST
URL参数
| 参数名 | 类型及范围 | 说明 |
|---|---|---|
| timestamp | long | 13位时间戳 |
| sign | string | 签名, 签名生成的规则是MD5(appSecret + timestamp), 为防止回调请求伪造, 请务必校验sign值的正确性 |
BODY参数:
| 参数名 | 类型及范围 | 说明 |
|---|---|---|
| channelId | Integer | 频道号 |
| sessionId | String | 场次ID |
| viewerId | String | 观众ID |
| externalViewerId | String | 外部id (开通用户体系并且使用外部id才会有值) |
| type | String | 用户行为(预约成功:booking/取消预约:cancel) |
| source | String | 预约来源(直播前预约:pre_live/直播中预约:in_live) |
| sourceChannelId | Integer | 来源直播间id |
| operateTime | String | 触发时间,格式:yyyy-MM-dd HH:mm:ss |
| startTime | String | 直播开始时间,格式:yyyy-MM-dd HH:mm:ss |
| promoteId | String | 渠道ID |
回调数据示例
请求地址示例: https://www.example.com/xxx/callback?sign=d5079f2e8ba19e49bfd3d9575866d80f×tamp=1701964858687
预约请求体(body参数: application/json)示例
{
"channelId": 100001,
"sessionId": "100001_20231207140000",
"viewerId": "viewer_123456",
"externalViewerId": "ext_789012",
"type": "booking",
"source": "pre_live",
"sourceChannelId": 100001,
"operateTime": "2023-12-07 10:30:00",
"startTime": "2023-12-07 14:00:00",
"promoteId": "xxxxxxxxx"
}
取消预约请求体示例:
{
"channelId": 100001,
"sessionId": "100001_20231207140000",
"viewerId": "viewer_123456",
"externalViewerId": "ext_789012",
"type": "cancel",
"source": "pre_live",
"sourceChannelId": 100001,
"operateTime": "2023-12-07 10:30:00",
"startTime": "2023-12-07 14:00:00",
"promoteId": "xxxxxxxxx"
}
