Polyv Help Center

Help Center

Create Series Live Sessions

Updated: 2026-07-27 15:03:24

API Description

1、创建系列直播场次
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/session/new/create

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency 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 key used to generate the signature is critical for communication data security. It must never be saved or used directly on the client side. All APIs must be called through the customer's own server to relay to the POLYV server for response data. See Signature Generation Rules
channelId true Integer Channel ID

Request Body Parameter Description

Parameter Required Type Description
name true String Session name
planStartTime true String Session start time (13-digit timestamp)
planEndTime true Long Session end time (13-digit timestamp)
interactionScriptId false Integer Interaction script ID
playType false String Playback mode (normal for normal playback, loop for loop playback)
splashImg false String Session cover image
splashLargeImg false String Portrait mode guide large image
splashImgBackgroundId false String Session cover background image ID
streamType false String Stream type (client for live stream, realDiskVideo for pseudo live stream)
videoPoolId false String Video pool ID for pseudo live stream (required when streamType is realDiskVideo)

Example

http://api.polyv.net/live/v4/channel/session/new/create?appId=frlr1zazn3&timestamp=1632809855078&channelId=2588188&sign=D02FA683640135D843D485EE84F6632A

Request body JSON parameters:

{
  "name": "专题直播-新品发布会",
  "planStartTime": 1761201943000,
  "planEndTime": 1761201953000,
  "interactionScriptId": 123,
  "playType": "normal",
  "splashImg": "https://example.com/splash.jpg",
  "splashLargeImg": "https://example.com/splash-large.jpg",
  "splashImgBackgroundId": "1",
  "streamType": "client",
  "videoPoolId": "vid_abc123"
}

Response Parameter Description

Parameter Type Description
code Integer Status code, same as HTTP status code, used to determine basic response status
status String Response result, determined by business logic. Returns success on success, error on failure
success Boolean Whether the response was successful
requestId String Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, not for business logic
data Object Session response object See data field description
error Object Error information

data Field Description

Parameter Type Description
channelId Integer Channel ID
userId String POLYV user ID
sessionId String Session ID
name String Session name
endTime Long Session end time
createdTime Long Session start time
planStartTime Long Planned start time
planEndTime Long Planned end time
splashImg String Cover image
splashLargeImg String Cover image for portrait and large image modes
splashImgBackgroundId Integer Cover image background template ID
pushClient String Push stream client type
type String Session type (manual: manually created session, auto: automatically created session)

Java Request Example

For quick integration of basic code, download the relevant dependency source code. Click to download 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(ChannelOperateTest.class);
/**
 * 创建新版场次
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testSessionNewCreateV4() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际
    String appId = super.appId;
    String appSecret = super.appSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v4/channel/session/new/create";

    Map<String, String> query = new HashMap<>();
    query.put("appId", appId);
    query.put("timestamp", timestamp);
    query.put("channelId", "2588188");
    query.put("sign", LiveSignUtil.getSign(query, appSecret));

    Map<String, Object> body = new HashMap<>();
    body.put("name", "专题直播-新品发布会");
    body.put("planStartTime", "1761201943000");
    body.put("planEndTime", "1761201953000");
    body.put("interactionScriptId", 123);
    body.put("playType", "normal");
    body.put("videoPoolId", "vid_abc123");

    String fullUrl = HttpUtil.appendUrl(url, query);
    String response = HttpUtil.postJsonBody(fullUrl, JSON.toJSONString(body), null);
    log.info("返回值:{}", response);
}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
  "code": 200,
  "status": "success",
  "requestId": "847f0716fa76461baf8979aaa4415dc3.67.16342672396023837",
  "data": {
    "channelId": 2588188,
    "userId": "1b448be323",
    "sessionId": "e9s2h3jd8f",
    "name": "专题直播-新品发布会",
    "startTime": 1761201943000,
    "endTime": null,
    "createdTime": 1761201943000,
    "planStartTime": 1761201943000,
    "planEndTime": 1761201953000,
    "splashImg": "https://example.com/splash.jpg",
    "splashLargeImg": "https://example.com/splash-large.jpg",
    "splashImgBackgroundId": 1,
    "pushClient": "client"
  },
  "success": true
}

Error Example

{
  "code": 400,
  "status": "error",
  "requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
  "error": {
    "code": 20001,
    "desc": "application not found."
  },
  "success": false
}
联系客服,在线咨询
在线咨询