查詢互動監聽事件列表
更新時間:2026-05-22 10:16:23
介面描述
由业务服务端调用,查询指定频道下当前仍挂在监听队列中的互动监听任务列表;
接口支持 HTTPS 协议。
介面URL
https://api.polyv.net/live/v5/chat/redirect/channel/interaction_event/list
請求方式
GET
介面約束
1、介面同時支援 HTTP、HTTPS,建議使用 HTTPS 確保介面安全。
2、**status** 由服務端根據當前時間與任務的 startTime、endTime 計算:waiting(未開始)、running(進行中)、ended(已結束)。
3、列表按頻道維度查詢;同一頻道可能存在歷史活動遺留的其他有效任務,聯調時建議結合 save/remove 或管理端清理。
請求參數描述
| 參數名 | 必選 | 類型 | 說明 |
|---|---|---|---|
| appId | true | String | 帳號appId【詳見取得金鑰】 |
| timestamp | true | Long | 當前13位毫秒級時間戳,3分鐘內有效 |
| sign | true | String | 簽名,為32位大寫的MD5值,生成簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁保存在客戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名生成規則】 |
| roomId | true | String(1,100) | 頻道號(query 參數) |
範例
請求範例:
GET https://api.polyv.net/live/v5/chat/redirect/channel/interaction_event/list?roomId=412738
回應體 JSON(成功):
{
"code": 200,
"status": "success",
"message": "获取成功",
"data": {
"list": [
{
"taskId": "task_sign_001",
"activityId": "activity_20250521_001",
"type": "signCount",
"startTime": 1747785600000,
"endTime": 1747785660000,
"status": "running",
"signCount": 1
}
]
}
}
無有效任務時 data.list 為空陣列 []。
回應參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| code | Integer | 200 表示成功;400 多為參數校驗失敗;500 多為業務錯誤或服務端異常 |
| status | String | success / fail / error |
| message | String | 如「獲取成功」或具體錯誤說明 |
| data | Object | 含 list(任務物件陣列) |
data.list 元素欄位
| 參數名 | 類型 | 說明 |
|---|---|---|
| taskId | String | 任務 ID |
| activityId | String | 活動 ID |
| type | String | 任務類型,見 save 介面 taskList.type |
| startTime | Number | 開始時間(毫秒時間戳) |
| endTime | Number | 結束時間(毫秒時間戳) |
| status | String | waiting | running | ended |
| userTags | String[] | 使用者標籤 ID 列表(可選) |
| payload | String | 自訂 payload(可選) |
| onlineTime | Number | type 為 onlineTime 時返回 |
| signCount | Number | type 為 signCount 時返回 |
| likesCount | Number | type 為 likesCount 時返回 |
| speakCount | Number | type 為 speakCount 時返回 |
| speakContent | String | type 為 speakCount 時返回 |
| customCount | Number | type 為 customCount 時返回 |
| eventType | String | type 為 customCount 時返回 |
| loginDays | Number | type 為 loginDays 時返回 |
| minOnlineTimePerDay | Number | type 為 loginDays 時返回 |
| logicType | String | AND | OR(可選) |
| allDone | String | Y | N(可選) |
| isUnlock | String | Y | N(可選) |
| parentTaskId | String | 父任務 ID(可選) |
異常範例
參數校驗失敗:
{
"code": 400,
"status": "fail",
"message": "缺少参数roomId"
}
頻道與帳號不匹配:
{
"code": 400,
"status": "fail",
"message": "roomId非法"
}
未傳 x-auth-user-id:
{
"code": 400,
"status": "fail",
"message": "accountId is required"
}
服務端異常:
{
"code": 500,
"status": "error",
"message": "获取失败"
}
(具體 message 以實際錯誤資訊為準。)
