保利威文档中心

幫助中心

查詢頻道問卷列表

更新時間:2026-01-04 17:52:05

介面描述

1、获取频道的问卷列表
2、接口支持https协议

介面URL

http://api.polyv.net/live/v3/channel/questionnaire/list

線上API呼叫

請求方式

GET

介面限制

1、介面同時支援HTTP、HTTPS,建議使用HTTPS以確保介面安全,介面呼叫有頻率限制,詳細請查看

請求參數描述

參數名 必選 類型 說明
appId true String 帳號appId【詳見取得金鑰
timestamp true Long 當前13位毫秒級時間戳,3分鐘內有效
sign true String 簽名,為32位大寫的MD5值,產生簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在用戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名產生規則
channelId true String 頻道號
startTime false Long 查詢的記錄的開始時間,13位毫秒級時間戳
endTime false Long 查詢的記錄的結束時間,13位毫秒級時間戳
page false Integer 頁號,預設為1
pageSize false Integer 每頁筆數,預設為10

範例

https://api.polyv.net/live/v3/channel/questionnaire/list?appId=frlr1zazn3&sign=21914C8E80403BF527F6061DD79DAE47&channelId=1965681&timestamp=1621843841035

回應參數描述

參數名 類型 說明
code Integer 回應狀態碼,200為成功返回,非200為失敗【詳見全域錯誤說明
status String 回應狀態文字資訊
message String 回應描述資訊,當code為400或500時,輔助描述錯誤原因
data Object 成功回應時為問卷基本資訊 【詳見data欄位說明

data欄位說明

參數名 類型 說明
pageSize Integer 總頁數
pageNumber Integer 當前的頁數
totalItems Integer 總的筆數
contents Array 查詢的結果列表 【詳見contents欄位說明
firstPage Boolean 是否為第一頁,值為:true/false
lastPage Boolean 是否為最後一頁,值為:true/false
nextPageNumber Integer 下一頁編號
prePageNumber Integer 上一頁編號
totalPages Integer 總頁數
startRow Integer 當前頁第一筆記錄在總結果集中的位置
endRow Integer 當前頁最後一筆記錄在總結果集中的位置
limit Integer 當前頁影片個數
offset Integer 分頁起始記錄

contents欄位說明

參數名 類型 說明
questionnaireId String 問卷ID
channelId String 頻道號
userId String 使用者ID
name String 問題題目
name String 問題題目
type String 問卷類型
survey:問卷調查
exam:隨堂測試
status String 問卷狀態
saved:已儲存
published:已發布
forbidden:已禁用
createdTime Long 建立時間,13位毫秒級時間戳
lastModified Long 問卷最後修改時間,13位毫秒級時間戳
publishedTime Long 問卷發布時間,13位毫秒級時間戳
endTime Long 停止提交問卷時間,13位毫秒級時間戳
customQuestionnaireId String 使用者自訂問卷ID

Java請求範例

快速接入基礎程式碼請下載相關依賴原始碼點擊下載原始碼 ,下載後加入到自己的原始碼工程中即可。測試用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下載檔案中。

強烈建議您使用直播Java SDK完成API的功能對接,直播Java SDK 對API呼叫邏輯、異常處理、資料簽名、HTTP請求執行緒池進行了統一封裝和最佳化。

private static final Logger log = LoggerFactory.getLogger(LiveInteractionTest.class);

/**
 * 查询频道问卷列表
 * @throws IOException
 */
@Test
public void testListQuestionaire() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId=super.appId;
    String appSecret=super.appSecret;
    String userId = super.userId;
    String timestamp=String.valueOf(System.currentTimeMillis());
    //业务参数
    String channelId = "1965681";
    String questionnaireId = "fwndt7vq4x";
    String url = "http://api.polyv.net/live/v3/channel/questionnaire/list";

    //http 调用逻辑
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);
    requestMap.put("channelId",channelId);
    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url,requestMap);
    log.info("测试查询频道问卷列表接口返回值:{}",response);
    //do somethings
}

回應範例

系統全域錯誤說明詳見全域錯誤說明

成功範例

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageSize": 10,
        "pageNumber": 1,
        "totalItems": 1180,
        "contents": [{
            "questionnaireId": "fwnf2sbpf5",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "问卷标题啊啊啊啊啊啊啊啊",
            "status": "saved",
            "createdTime": 1615510062000,
            "lastModified": 1615515862000,
            "endTime": null,
            "customQuestionnaireId": "6a3ff44289f94a5fb1dd8341ac1c0100"
        }, {
            "questionnaireId": "fwndt7vq4x",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1175)",
            "status": "saved",
            "createdTime": 1615507307000,
            "lastModified": 1615507307000,
            "endTime": null,
            "customQuestionnaireId": "30231311ed334a7f80e4db520b3bec99"
        }, {
            "questionnaireId": "fwndsuurwg",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1174)",
            "status": "saved",
            "createdTime": 1615507286000,
            "lastModified": 1615507286000,
            "endTime": null,
            "customQuestionnaireId": "c73351a8ea524b889d9034e2ad9783aa"
        }, {
            "questionnaireId": "fwmqno940c",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1173)",
            "status": "saved",
            "createdTime": 1615456906000,
            "lastModified": 1615456906000,
            "endTime": null,
            "customQuestionnaireId": "f7ca11536c424756a0e80c74536b31db"
        }, {
            "questionnaireId": "fwmqnbvbse",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1172)",
            "status": "saved",
            "createdTime": 1615456885000,
            "lastModified": 1615456885000,
            "endTime": null,
            "customQuestionnaireId": "9c0ad9042085449d99a08dfa435a33d3"
        }, {
            "questionnaireId": "fwmgqghdop",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1171)",
            "status": "saved",
            "createdTime": 1615435307000,
            "lastModified": 1615435307000,
            "endTime": null,
            "customQuestionnaireId": "b52d64b0ff7541a898baf3ee58a0ddb7"
        }, {
            "questionnaireId": "fwmgq40os8",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1170)",
            "status": "saved",
            "createdTime": 1615435286000,
            "lastModified": 1615435286000,
            "endTime": null,
            "customQuestionnaireId": "1b76b6d7d6d841c3b859ad40b81b69f8"
        }, {
            "questionnaireId": "fwmbdvg8vq",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1169)",
            "status": "saved",
            "createdTime": 1615423662000,
            "lastModified": 1615423662000,
            "endTime": null,
            "customQuestionnaireId": "9fd4d52c684645529859d1941a56bdea"
        }, {
            "questionnaireId": "fwma472twi",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1168)",
            "status": "saved",
            "createdTime": 1615420900000,
            "lastModified": 1615420900000,
            "endTime": null,
            "customQuestionnaireId": "ac9598b8492e4a3b81a8eab8ba81f678"
        }, {
            "questionnaireId": "fwma3v7hjn",
            "channelId": 1965681,
            "userId": "1b448be323",
            "name": "测试试卷,明天会更好调查2 (1167)",
            "status": "saved",
            "createdTime": 1615420880000,
            "lastModified": 1615420880000,
            "endTime": null,
            "customQuestionnaireId": "04be6a81d35f4c78a90d7d0f80ea6655"
        }],
        "startRow": 1,
        "firstPage": true,
        "lastPage": false,
        "prePageNumber": 1,
        "limit": 10,
        "totalPages": 118,
        "nextPageNumber": 2,
        "endRow": 10,
        "offset": 0
    }
}

異常範例

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询