Query Series Live Session Information
Updated: 2026-07-27 15:03:28
API Description
1、查询系列直播场次信息
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/session/new/get
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: 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 stored on the client side for direct use. All APIs must be relayed through the customer's own server to call the POLYV server for response data. See details: Signature Generation Rules |
| channelId | false | Integer | Channel ID |
| sessionId | false | String | Session ID |
Example
http://api.polyv.net/live/v4/channel/session/new/get?appId=frlr1zazn3×tamp=1632809855078&channelId=2588188&sessionId=e9s2h3jd8f&sign=D02FA683640135D843D485EE84F6632A
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure See details: Global Error Description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, provides additional error details |
| data | Object | Empty on failure. On success, contains channel session information See details: data field description |
data Field Description
| Parameter | Type | Description |
|---|---|---|
| channelId | Integer | Channel ID |
| createdTime | Long | Session start time |
| diskVideoVO | Object | Hard disk push streaming video information See details: diskVideoVO field description |
| endTime | Long | Session end time |
| interactionScriptVO | Object | Interactive script information See details: interactionScriptVO field description |
| name | String | Session name |
| planEndTime | Long | Planned end time |
| planStartTime | Long | Planned start time |
| pushClient | String | Push streaming client type |
| sessionId | String | Session ID |
| splashImg | String | Cover image |
| splashImgBackgroundId | Integer | Cover image background template ID |
| splashLargeImg | String | Cover image for portrait and large image modes |
| status | String | Session status (unStart: not started, live: live streaming, end: ended, playback: replaying, expired: expired) |
| streamType | String | Stream type |
| userId | String | POLYV user ID |
| watchUrl | String | Watch URL |
diskVideoVO Field Description
| Parameter | Type | Description |
|---|---|---|
| channelId | Integer | Channel ID |
| createdTime | Long | Creation time |
| duration | String | Duration (format: HH:mm:dd) |
| durationSecond | Integer | Duration (seconds) |
| endTime | Long | End time |
| fileSize | Long | File size |
| firstImage | String | First frame image |
| playType | String | Play type (normal: normal play, loop: loop play) |
| startTime | Long | Start time |
| status | String | Status |
| title | String | Title |
| url | String | URL |
| userId | String | User ID |
| videoId | String | Pseudo-live video ID |
| videoPoolId | String | Video ID |
interactionScriptVO Field Description
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Script ID (primary key) |
| name | String | Script name |
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 packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 获取新场次信息
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void getTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
//API请求地址
String url = "http://api.polyv.net/live/v4/channel/session/new/get";
String timestamp = String.valueOf(System.currentTimeMillis());
//请求参数
Map<String, String> params = new HashMap<String, String>();
params.put("appId", appId);
params.put("timestamp", timestamp);
params.put("channelId", "2588188");
params.put("sessionId", "e9s2h3jd8f");
//生成签名
String sign = LiveSignUtil.getSign(params, appSecret);
params.put("sign", sign);
//发送请求
String result = HttpUtil.sendGet(url, params);
//打印结果
log.info("返回值:{}", response);
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": {
"channelId": 2588188,
"sessionId": "e9s2h3jd8f",
"name": "测试场次1",
"endTime": 1761201953000,
"status": "end",
"createdTime": 1761201953000,
"planStartTime": 1761201953000,
"planEndTime": 1761201953000,
"streamType": "client",
"pushClient": "web",
"splashImg": "https://example.com/image1.jpg",
"splashLargeImg": "https://example.com/large-image1.jpg",
"splashImgBackgroundId": 1,
"watchUrl": "https://live.polyv.net/2588188/e9s2h3jd8f",
"userId": "user123"
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
