Polyv Help Center

Help Center

Retrieve Watch Duration Change Data by Person

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 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 never be saved or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server and retrieve response data. See Signature Generation Rules
channelId true String Channel ID
sessionId true String Session ID
viewerId true String Viewer/Student ID

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
viewerId String Viewer/Student 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 basic 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 from the test cases are included in the downloaded file.


Response Example

For global error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "",
    "data": {
        "viewerId": "",
        "channelId": "",
        "sessionId": "",
        "shouldStudyTime": 0,
        "grandTotalTime": 0,
        "studyStatus": "N"
    },
    "success": true
}

Error Example

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