Polyv Help Center

Help Center

Get Attendee Statistics for a Webinar Room

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

API Description

1、获取研讨会直播间参会者统计数据
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/seminar/statistics/listViewLogs

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for 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 used to generate the signature is critical for communication data security. It must never be used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server for response data. See Signature Generation Rules
channelId true String Channel ID
startTime true Long Start time, 13-digit millisecond timestamp
endTime true Long End time, 13-digit millisecond timestamp (maximum query range is 60 days)
pageSize false Integer Number of items per page, default 10; minimum 10; maximum 1000
pageNumber false Integer Current page number, default 1

Example

http://api.polyv.net/live/v3/channel/seminar/statistics/listViewLogs?appId=fyirmfdak4&timestamp=1638174506033&sign=8796F9B1CB8F000654DF5F84C43532A0&startTime=1635696000000&endTime=1638288000000&channelId=2665820

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See Global Error Description
status String Response status text
message String Response description, auxiliary error reason when code is 400 or 500
data Object Response data

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 Current page content See contents Field Description

contents Parameter Description

Parameter Type Description
viewerId String UID
nickName String Nickname
country String Country
province String Region
city String City
ipAddress String Attendee IP
startTime number Entry time, 13-digit millisecond timestamp
endTime number Exit time, 13-digit millisecond timestamp
stayDuration number Duration of stay (in seconds)
micCount number Number of times connected to microphone
micDuration number Microphone connection duration (in seconds)
showCount number Number of presentations
showDuration number Presentation duration (in seconds)
isMobile String Whether mobile device, value Y for mobile; N for PC

Java Request Example

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

It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.

private static final Logger log = LoggerFactory.getLogger(GetSeminarViewLog.class);
/**
 * 获取研讨会直播间参会者统计数据
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testGetSeminarViewLog() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.appId;
    String appSecret = super.appSecret;
    String userId = super.userId;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v3/channel/seminar/statistics/listViewLogs";
    String channelId = "2377623";
    long startTime = 1633017600000L;
    long endTime = 1635696000000L;
    int pageSize = 1;
    int pageNumber = 10;

    //http 调用逻辑
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);
    requestMap.put("channelId",channelId);
    requestMap.put("startTime",String.valueOf(startTime));
    requestMap.put("endTime",String.valueOf(endTime));
    requestMap.put("pageSize",String.valueOf(pageSize));
    requestMap.put("startTime",String.valueOf());
    requestMap.put("pageNumber",String.valueOf(pageNumber));
    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url, requestMap);
    log.info("测试获取研讨会直播间参会者统计数据返回值:{}",response);
    //do somethings
    
}

Response Example

For global error descriptions, see Global Error Description

Success Example

{
  "code": 200,
  "status": "success",
  "message": "",
  "data": {
    "pageSize": 10,
    "pageNumber": 1,
    "totalItems": 2,
    "contents": [
      {
        "id": 11065,
        "userId": "43f5f9caa2",
        "channelId": 2640448,
        "viewerId": "7882988f70",
        "nickName": "bbb",
        "startTime": 1635407075000,
        "endTime": 1635409962000,
        "stayDuration": 2887,
        "micCount": 1,
        "micDuration": 2886,
        "showCount": 0,
        "showDuration": 0,
        "currentDay": "2021-10-28",
        "browser": "Chrome",
        "isMobile": "N",
        "ipAddress": "61.144.147.168",
        "country": "中国",
        "province": "广东",
        "city": "广州",
        "status": 1,
        "createdTime": 1635410039000,
        "lastModified": 1635410039000
      },
      {
        "id": 11064,
        "userId": "43f5f9caa2",
        "channelId": 2640448,
        "viewerId": "5c4b866249",
        "nickName": "陈",
        "startTime": 1635407049000,
        "endTime": 1635408507000,
        "stayDuration": 1458,
        "micCount": 1,
        "micDuration": 1457,
        "showCount": 0,
        "showDuration": 0,
        "currentDay": "2021-10-28",
        "browser": "Chrome",
        "isMobile": "N",
        "ipAddress": "61.144.147.168",
        "country": "中国",
        "province": "广东",
        "city": "广州",
        "status": 1,
        "createdTime": 1635410039000,
        "lastModified": 1635410039000
      }
    ],
    "limit": 2,
    "totalPages": 1,
    "endRow": 2,
    "nextPageNumber": 1,
    "lastPage": true,
    "prePageNumber": 1,
    "startRow": 1,
    "firstPage": true,
    "offset": 0
  }
}

Error Example

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