頻道自訂預約回調通知
更新時間: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"
}
