接口URL
https://api.polyv.net/live/v3/channel/playback/update-title
接口说明
(接口调用有频率限制,详细请查看)
1、接口用于修改回放列表中某个视频的名称(标题)
3、接口支持https
请求方式
POST
请求参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appId | 是 | string | 从API设置中获取,在直播系统登记的appId |
timestamp | 是 | long | 当前13位当前时间戳,3分钟有效 |
sign | 是 | string | 签名值,32位大写MD5值 |
channelId | 是 | int | 频道ID |
videoId | 是 | string | 回放视频ID |
title | 是 | string | 回放视频名称 |
响应成功JSON示例:
// 修改成功
{
"code": 200,
"status": "success",
"message": "",
"data": ""
}
响应失败JSON示例:
// 签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
// 未输入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": 400,
"status": "error",
"message": "illegal channel id: xxx",
"data": ""
}
// 要修改的回放视频不存在
{
"code": 400,
"status": "error",
"message": "playback video not exist",
"data": ""
}
// 修改回放视频失败
{
"code": 400,
"status": "error",
"message": "update playback video info error",
"data": ""
}
字段说明
参数名 | 说明 |
---|---|
code | 响应代码,成功为200,失败为400,签名错误为403,异常错误500 |
status | 成功为success,失败为error |
message | 错误时为错误提示消息 |
data | 成功修改信息 |
php请求示例
<?php
//引用config.php
include 'config.php';
$params = array(
'appId' => "填写获取到的appId",
'timestamp' => "填写13位时间戳",
'channelId' => "填写频道号",
'videoId' => "填写回放视频ID",
'title' => "填写回放视频名称(标题)"
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params["sign"] = $sign;
$url="https://api.polyv.net/live/v3/channel/playback/update-title";
function post($url, $post_data = '', $timeout = 5){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
if($post_data != ''){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HEADER, false);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
}
echo post($url, $params);
?>