Query Series Live Session Information
Updated: 2026-10-12 15:41: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. It is recommended to use HTTPS to ensure API security. There is a frequency limit for API calls. For details, please see
Request Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId [See Get Key for details] |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is key information for communication data security. It is strictly prohibited to save it on the client for direct use. All APIs must be called through the customer's own server as a relay to the POLYV server to obtain response data. [See Signature Generation Rules for details] |
| 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 Name | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates a successful response; non-200 indicates failure. [See Global Error Description for details] |
| status | String | Response status text information |
| message | String | Response description information. When code is 400 or 500, it provides an auxiliary description of the error cause. |
| data | Object | Empty when the request fails; when the request succeeds, it contains channel session information. [See data Field Description for details] |
data Field Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | Integer | Channel ID |
| createdTime | Long | Session start time |
| diskVideoVO | Object | Hard disk push stream video information [See diskVideoVO Field Description for details] |
| endTime | Long | Session end time |
| interactionScriptVO | Object | Interactive script information [See interactionScriptVO Field Description for details] |
| name | String | Session name |
| planEndTime | Long | Planned end time |
| planStartTime | Long | Planned start time |
| playbackConfig | Object | Session playback configuration [See playbackConfig Field Description for details] |
| playbackEnabled | String | Session playback switch (Y: enabled, N: disabled) |
| pushClient | String | Push stream client type |
| sessionId | String | Session ID |
| splashImg | String | Cover image |
| splashImgBackgroundId | Integer | Background template ID of the cover image |
| splashLargeImg | String | Cover image for portrait and large image mode |
| status | String | Session status (unStart: not started, live: live, end: ended, playback: in playback, expired: expired) |
| streamType | String | Stream type |
| userId | String | POLYV user ID |
| watchUrl | String | Watch URL |
playbackConfig Field Description
| Parameter Name | Type | Description |
|---|---|---|
| playbackEnabled | String | Session playback switch (Y: enabled, N: disabled) |
| playbackOrigin | String | Session playback source (record: recording of this live session, material: material library, vod: VOD) |
| videoId | String | Session playback video ID. When the source is the material library, it is the material ID; when it is VOD, it is the VOD video ID; when the source is the recording of this live session, it is empty. |
diskVideoVO Field Description
| Parameter Name | 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 | Playback type (normal: normal playback, loop: loop playback) |
| startTime | Long | Start time |
| status | String | Status |
| title | String | Title |
| url | String | URL |
| userId | String | User ID |
| videoId | String | Pseudo-live ID |
| videoPoolId | String | Video ID |
interactionScriptVO Field Description
| Parameter Name | Type | Description |
|---|---|---|
| id | Integer | Script ID (primary key) |
| name | String | Script name |
Java Request Example
For quick integration of the basic code, please download the relevant dependency source code, click to download the source code, and add it to your own source project after downloading. The HttpUtil.java and LiveSignUtil.java in the test cases are both included in the downloaded file.
It is strongly recommended that you use the Live Java SDK to complete API integration. The Live Java SDK uniformly encapsulates and optimizes API call logic, exception handling, data signing, and the HTTP request thread pool.
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 the system global error description, 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,
"playbackEnabled": "Y",
"playbackConfig": {
"playbackEnabled": "Y",
"playbackOrigin": "vod",
"videoId": "c81017120b"
},
"watchUrl": "https://live.polyv.net/2588188/e9s2h3jd8f",
"userId": "user123"
}
}
Exception example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
