查询指定文件ID的录制文件信息

接口URL

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

接口说明

1、接口用于通过文件ID查询录制文件信息
2、接口支持https

返回结果支持格式

JSON

请求方式

GET

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位大写的MD5值
channelId string 频道号
fileId string 文件ID

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "bitrate": 0, 
        "channelId": 339382, 
        "channelSessionId": "fdl03sz2mx", 
       "createdTime": 1561719918000, 
       "duration": 78, 
       "endTime": "20190628190217", 
       "fileId": "d2c7428031a512a2f8c53da358f9695e", 
       "filename": "测试创建", 
       "filesize": 5110372, 
       "height": 720, 
       "liveType": "ppt", 
       "m3u8": "http://oss-live-1.videocc.net/record/record/recordf/edvf2fpec920190621142457386/2019-06-28-19-00-58_2019-06-28-19-02-16.m3u8", 
       "mp4": "http://oss-live-1.videocc.net/record/record/recordf/edvf2fpec920190621142457386/2019-06-28-19-00-58_2019-06-28-19-02-16.mp4",
       "startTime": "20190628190057",
       "userId": "edvf2fpec9", 
       "width": 1280
    }
}

响应失败JSON示例:

未输入appId

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

appId不正确

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

时间戳错误

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

签名错误

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

字段说明

参数名 说明
code 响应的状态码,例如:200
status 响应状态
message 异常错误信息
data 响应结果集
bitrate 码率
channelId 频道号
channelSessionId 频道场次
createdTime 创建时间
duration 时长
endTime 结束时间
fileId 文件ID
filename 文件名
filesize 文件大小
height
liveType 直播类型
m3u8 m3u8文件地址
mp4 MP4地址
startTime 开始时间
userId 用户ID
width

php请求示例

<?php
//引用config.php
include 'config.php';
$params = array(
    'appId' => $appId,
    'timestamp' => $timestamp,
    'channelId' => 108888,
    'fileId' => '11111dadadadadade2323'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/record/get?".http_build_query($params);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...