Polyv Help Center

Help Center

Query Single Live Temporary Storage Information for a Channel

Updated: 2023-02-22 18:17:04

API Description

1、通过文件ID查询频道内录制视频文件信息
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/record/get

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API 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 key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See Signature Generation Rules
channelId true String Channel ID
fileId true String File ID Can be obtained via Query Channel Recording Video Information

Example

https://api.polyv.net/live/v3/channel/record/get?appId=frlr1zazn3&sign=697FE70BFEDEED1FB424A30557C8459C&channelId=2191532&timestamp=1621840860506&fileId=94ea693e1733389ae2e7693ebdacbd43

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, assists in describing error reasons when code is 400 or 500
data Object Empty on request failure, contains recording video file information on success See data field description

data Field Description

Parameter Type Description
fileId String File ID
userId String POLYV user ID, consistent with the Polyv official website. Retrieval path: Official website -> Login -> Live (Development Settings)
channelId String Channel ID
startTime String Recording start time, format: yyyyMMddHHmmss
endTime String Recording end time, format: yyyyMMddHHmmss
fileName String Recording file name
fileSize Long Recording file size (unit: bytes)
createdTime Long Creation time, 13-digit millisecond timestamp
width Integer Video width (pixels)
height Integer Video height (pixels)
duration Integer Duration (unit: seconds)
bitrate Integer Recording file bitrate (unit: bytes)
mp4 String MP4 file URL
m3u8 String M3U8 file URL
channelSessionId String Live session ID
liveType String Live type
alone: Event live
ppt: Three-screen
topclass: Large class
seminar: Seminar
daysLeft Integer Remaining days of the recording file. Greater than 0: remaining days, 0: expired, -1: permanent
originSessionId String Original session ID

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 code project. HttpUtil.java and LiveSignUtil.java in the test cases are included 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(ChannelPlayBackTest.class);
/**
 * 查询指定文件ID的录制文件信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testGetRecordFile() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.appId;
    String appSecret = super.appSecret;
    String userId = super.userId;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "https://api.polyv.net/live/v3/channel/record/get";
    String channelId = "2191532";
    String fileId = "94ea693e1733389ae2e7693ebdacbd43";
    
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("channelId", channelId);
    requestMap.put("fileId", fileId);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url, requestMap);
    log.info("测试查询指定文件ID的录制文件信息,返回值:{}", response);
    //do somethings
    
}

Response Example

For system global error descriptions, see Global Error Description

Success Example

{
    "code":200,
    "status":"success",
    "message":"",
    "data":{
        "fileId":"94ea693e1733389ae2e7693ebdacbd43",
        "userId":"1b448be323",
        "channelId":2191532,
        "startTime":"20210311161313",
        "endTime":"20210311161507",
        "filename":"Spring 知识精讲1111",
        "filesize":9200637,
        "createdTime":1615450629000,
        "width":1280,
        "height":720,
        "duration":114,
        "bitrate":0,
        "mp4":"https://oss-live-1.videocc.net/record/record/recordf/1b448be323161536226913173df/2021-03-12-16-13-14_2021-03-12-16-15-07.mp4",
        "m3u8":"https://oss-live-1.videocc.net/record/record/recordf/1b448be323161536226913173df/2021-03-12-16-13-14_2021-03-12-16-15-07.m3u8",
        "channelSessionId":"fwmnnydr06",
        "liveType":"ppt",
        "daysLeft":165
    }
}

Error Example

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