Polyv Help Center

Help Center

Create Series Live Sessions

Updated: 2026-10-12 15:41:28

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. 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 an intermediary to the POLYV server to obtain response data. [See Signature Generation Rules for details]
channelId true Integer Channel ID

Request Body Parameter Description

Parameter Name 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 Interactive script ID
playType false String Playback method (normal: normal playback, loop: loop playback)
splashImg false String Session cover image
splashLargeImg false String Portrait guide large image
splashImgBackgroundId false String Session cover background image ID
streamType false String Stream type (normal live: client / pseudo-live: realDiskVideo)
videoPoolId false String Pseudo-live video ID (required when streamType is realDiskVideo). When the video source is the material library, pass the material ID; when it is VOD, pass the VOD video ID (vid)
videoSource false String Pseudo-live video source (Material: material library, VideoPool: VOD), case-sensitive. If not passed, the default is the material library; when videoPoolId passes a VOD video ID, VideoPool must be passed, otherwise it will prompt that the material does not exist
playbackEnabled false String Session playback switch (Y: enabled, N: disabled). If not passed, it follows the channel playback master switch
playbackOrigin false String Session playback source (record: recording of this live session, material: material library, vod: VOD). If not passed, it is the recording of this live session
playbackVideoId false String Session playback video ID. Required when the playback source is the material library (material) or VOD (vod). For the material library, pass the material ID; for VOD, pass the VOD video ID

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",
  "videoSource": "Material",
  "playbackEnabled": "Y",
  "playbackOrigin": "vod",
  "playbackVideoId": "c81017120b"
}

Response Parameter Description

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

data Field Description

Parameter Name 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 Background template ID of the cover image
pushClient String Push client type
type String Session type (manual: manually created session, auto: automatically created session)
playbackEnabled String Session playback switch (Y: enabled, N: disabled)
playbackConfig Object Session playback configuration [See playbackConfig field description for details]

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

Java Request Example

For quick integration with the basic code, please download the relevant dependency source code. Click to download the source code. After downloading, add it to your own source project. 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 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");
    body.put("videoSource", "Material");
    body.put("playbackEnabled", "Y");
    body.put("playbackOrigin", "vod");
    body.put("playbackVideoId", "c81017120b");

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

Response Example

For system global 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",
    "playbackEnabled": "Y",
    "playbackConfig": {
      "playbackEnabled": "Y",
      "playbackOrigin": "vod",
      "videoId": "c81017120b"
    }
  },
  "success": true
}

Exception example

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