Polyv Help Center

Help Center

Query Multi-Channel Viewing Records within a Time Range

Updated: 2022-09-02 18:08:07

API Description

1、根据时间范围获取多频道下用户学习时长表
2、接口支持https协议

API URL


Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls are subject to rate limits. See details

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See Get Secret Key
timestamp true Long Current 13-digit millisecond timestamp, valid for 3 minutes
sign true String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server and obtain response data. See Signature Generation Rules
startTime true String Start time, format: yyyy-MM-dd HH:mm:ss
endTime true String End time, format: yyyy-MM-dd HH:mm:ss
channelIds false String Channel IDs, multiple IDs separated by commas, e.g., 100000,100001
pageNumber false Integer Page number, defaults to 1
pageSize false Integer Number of items per page, defaults to 10, maximum 1000

Example


Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure
status String Response result, determined by business logic: success returns "success", failure returns "error"
success Boolean Response result, determined by business logic: success returns true, failure returns false
data Object Distribution list information returned on success See Data Field Description
error Object Error information when status code is non-200 See Error Field Description
requestId String Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic

Error Parameter Description

Parameter Type Description
code Integer Error code, used to identify the specific error reason
desc String Error description, corresponds to error.code

Data Parameter Description

Parameter Type Description
pageNumber Integer Current page number
pageSize Integer Number of items per page
totalPages Long Total number of pages
totalItems Long Total number of items
contents Array Content of the current page See Contents Field Description

Contents Parameter Description

Parameter Type Description
viewerId String Student viewer ID
channelId String Channel ID
sessionId String Session ID
shouldStudyTime Integer Required study duration
grandTotalTime Integer Completed study duration
studyStatus String Study status. If the study duration is not less than 90%, the status is "Completed"
Y: Completed
N: Not completed

Java Request Example

For quick integration of the base code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.


Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "",
    "data": {
        "pageNumber": 1,
        "pageSize": 10,
        "totalPages": 1,
        "totalItems": 1,
        "contents": [
            {
                "viewerId": "",
                "channelId": "",
                "sessionId": "",
                "shouldStudyTime": 0,
                "grandTotalTime": 0,
                "studyStatus": "N"
            }
        ]
    },
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "error": {
        "code": 10003,
        "desc": "时间戳过期"
    },
    "success": false
}
联系客服,在线咨询