Polyv Help Center

Help Center

Retrieve Viewing Records for a Specific Channel ID

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. Click for details

Request Parameters

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 not 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 for response data. [See Signature Generation Rules]
channelId true String Channel ID
sessionIds false String Session IDs, multiple values separated by commas
viewerIds false String Viewer IDs, multiple values separated by commas
pageSize false Integer Number of records per page, default is 10, maximum is 200
token false String Token for the next page, obtained from the current page's response data. Not required for the first page

Example


Response Parameters

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 on successful response [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 debugging and troubleshooting, should not be tied to business logic

Error Parameter Description

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

Data Parameter Description

Parameter Type Description
pageSize Integer Number of records per page
token String Token for querying the next page
contents Array Content of the current page [See Contents Field Description]

Contents Parameter Description

Parameter Type Description
viewerId String 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": {
        "pageSize": 10,
        "token": "",
        "contents": [
            {
                "viewerId": "",
                "channelId": "",
                "sessionId": "",
                "shouldStudyTime": 0,
                "grandTotalTime": 0,
                "studyStatus": "N"
            }
        ]
    },
    "success": true
}

Error Example

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