修改子频道信息

接口URL

https://api.polyv.net/live/v2/channelAccount/{channelId}/update

接口说明

1、通过接口可以修改子频道的昵称、密码、角色、头像、翻页权限、公告权限等
2、接口支持https协议

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值
account string 子频道ID(不能以数字类型提交,否则可能去掉ID前的00)
nickname string 昵称
passwd string 子频道密码
actor string 子频道头衔
pageTurnEnabled string 子频道翻页权限
notifyEnabled string 子频道公告权限

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": "success"
}

响应失败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 请求状态响应码
status 请求状态
message 错误信息
data 请求成功时为success, 请求失败为空

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$timestamp = time()*1000;
$nickname = "测试助教";
$actor = "老大";
$account = "0039108888";
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."account$account"."actor$actor"."appId$appId"."nickname$nickname"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://tr.api.polyv.net/live/v2/channelAccount/$channelId/update?appId=$appId&timestamp=$timestamp&sign=$sign&account=$account&nickname=$nickname&actor=$actor";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

account = "0038108888"
actor = "老大"
appId = "egymbtsf38"
nickname = "测试助教"
timestatmp = "1517975875000"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e" + "account" + "0038108888" + "actor" + "老大" + "appId" + "egymbtsf38" + "nickname" + "测试助教" + "timestamp" + "1517975875000"
+ "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

删除某个子频道号

接口URL

http://api.polyv.net/live/v2/channelAccount/{channelId}/delete

接口说明

1、删除某个子频道
2、接口支持https协议

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值
account string 子频道ID(不能以数字类型提交,否则可能去掉ID前的00)

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": true
}

响应失败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 请求状态响应码
status 请求状态
message 错误信息
data 正确请求时为删除结果,删除成功为true,频道已经删除为false

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$timestamp = time()*1000;
$account = "0039108888";
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."account$account"."appId$appId"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/channelAccount/$channelId/delete?appId=$appId&timestamp=$timestamp&sign=$sign&account=$account";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

account = "0039108888"
appId = "egymbtsf38"
timestatmp = "1517971961000"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e"+ "account" + "0039108888" +"appId"+"egymbtsf38"+ "timestamp" + "1517971961000"
+ "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

获取频道号下所有的子频道

接口URL

https://api.polyv.net/live/v2/channelAccount/{channelId}/accounts

接口说明

1、获取频道下所有子频道的具体信息
2、接口支持https协议

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": [
        {
            "account": "003104400",
            "userId": "edvf2fpec9",
            "channelId": 104400,
            "passwd": "991730",
            "nickname": "王老师",
            "stream": "jdchwdsf",
            "status": "Y",
            "createdTime": 1517972947000,
            "lastModified": 1517972947000,
            "channelSessionId": null,
            "sort": 3,
            "avatar": null,
            "actor": null,
            "pageTurnEnabled": "N",
            "notifyEnabled": "Y",
            "checkinEnabled": "Y",
            "voteEnabled": "Y",
            "lotteryEnabled": "Y",
            "role": "Assistant"
        },
        {
            "account": "002104400",
            "userId": "edvf2fpec9",
            "channelId": 104400,
            "passwd": "123",
            "nickname": "测试",
            "stream": "jdbjbjcw",
            "status": "Y",
            "createdTime": 1517914867000,
            "lastModified": 1517914970000,
            "channelSessionId": null,
            "sort": 2,
            "avatar": null,
            "actor": "老大",
            "pageTurnEnabled": "N",
            "notifyEnabled": "Y",
            "checkinEnabled": "Y",
            "voteEnabled": "Y",
            "lotteryEnabled": "Y",
            "role": "Assistant"
        }
    ]
}

响应失败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 请求状态响应码
status 请求状态
message 错误信息
data 用户的分钟数相关信息
account 助教ID
userId 用户ID
channelId 频道ID
passwd 助教密码
nickname 助教名称
stream 助教流名(单独使用无效)
status 助教状态
createdTime 创建助教时间
lastModified 助教最后修改时间
sort 频道中所有助教序号
avatar 助教头像
pageTurnEnabled 助教翻页权限(只能一个助教有)
notifyEnabled 发布公告权限
checkinEnabled 开启签到权限
voteEnabled 发起投票
role 子频道角色

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$timestamp = time()*1000;
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."appId$appId"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/channelAccount/$channelId/accounts?appId=$appId&timestamp=$timestamp&sign=$sign";
//echo $url;
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId = "egymbtsf38"
timestatmp = "1503632521000"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e"+"appId"+"egymbtsf38"+ "timestamp" + "1503632521000"
+ "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

新增子频道

接口URL

https://api.polyv.net/live/v2/channelAccount/{channelId}/add

接口说明

1、新增子频道
2、接口支持https协议

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "account": "004104400",
        "userId": "edvf2fpec9",
        "channelId": 104400,
        "passwd": "150751",
        "nickname": "张老师",
        "stream": "jdci3mre",
        "status": "Y",
        "createdTime": 1517973284858,
        "lastModified": 1517973284858,
        "channelSessionId": null,
        "sort": 4,
        "avatar": null,
        "actor": null,
        "pageTurnEnabled": "N",
        "notifyEnabled": "Y",
        "checkinEnabled": null,
        "voteEnabled": null,
        "lotteryEnabled": null,
        "role": null
    }
}

响应失败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 请求状态响应码
status 请求状态
message 错误信息
account 助教ID
userId 用户ID
channelId 频道ID
passwd 助教密码
nickname 助教名称
stream 助教流名(单独使用无效)
status 助教状态
createdTime 创建助教时间
lastModified 助教最后修改时间
sort 频道中所有助教序号
avatar 助教头像
pageTurnEnabled 助教翻页权限(只能一个助教有)
notifyEnabled 发布公告权限
checkinEnabled 开启签到权限
voteEnabled 发起投票
role 子频道角色

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$timestamp = time()*1000;
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."appId$appId"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/channelAccount/$channelId/add?appId=$appId&timestamp=$timestamp&sign=$sign";
//echo $url;
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId = "egymbtsf38"
timestatmp = "1503632521000"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e"+"appId"+"egymbtsf38"+ "timestamp" + "1503632521000"
+ "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

获取某个子频道的信息

接口URL

https://api.polyv.net/live/v2/channelAccount/{channelId}/account

接口说明

1、获取某个子频道的具体信息
2、接口支持https协议

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值
account string 子频道ID(不能以数字类型提交,否则可能去掉ID前的00)

响应成功JSON示例:

{
    code: 200,
    status: "success",
    message: "",
    data: {
        account: "0039108888",
        userId: "edvf2fpec9",
        channelId: 108888,
        passwd: "508621",
        nickname: "彭老师",
        stream: "jdbh0dv7",
        status: "Y",
        createdTime: 1517910988000,
        lastModified: 1517910988000,
        channelSessionId: null,
        sort: 39,
        avatar: null,
        actor: null,
        pageTurnEnabled: "N",
        notifyEnabled: "Y",
        checkinEnabled: "Y",
        voteEnabled: "Y",
        lotteryEnabled: "Y",
        role: "Assistant"
    }
}

响应失败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 请求状态响应码
status 请求状态
message 错误信息
account 子频道ID
userId 用户ID
channelId 频道ID
passwd 子频道密码
nickname 子频道名称
stream 子频道流名(单独使用无效)
status 子频道状态
createdTime 创建子频道时间
lastModified 子频道最后修改时间
sort 频道中所有子频道序号
avatar 子频道头像
pageTurnEnabled 子频道翻页权限(只能一个子频道有)
notifyEnabled 发布公告权限
checkinEnabled 开启签到权限
voteEnabled 发起投票
role 子频道角色

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$timestamp = time()*1000;
$account = "0039108888";
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."account$account"."appId$appId"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/channelAccount/$channelId/account?appId=$appId&timestamp=$timestamp&sign=$sign&account=$account";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

account = "0039108888"
appId = "egymbtsf38"
timestatmp = "1517971961000"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e"+ "account" + "0039108888" +"appId"+"egymbtsf38"+ "timestamp" + "1517971961000"
+ "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

设置转存成功通知回调地址

接口URL

http://api.polyv.net/live/v2/user/{userId}/set-playback-callback

接口说明

1、设置账号下转存回放视频成功通知回调地址的接口
2、不提交地址参数url,则回调地址为空,表示关闭回调功能,如果要提交的地址参数url,必须以 http:// 或者 https:// 开头
3、接口支持https

具体功能可参考:转存成功回调通知接口

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值
url string 回调地址url,不提交表示关闭回调功能,如果提交,必须以 http:// 或者 https:// 开头

响应成功JSON示例:

{
    "code": 200, 
    "status": "success", 
    "message": "", 
    "data": ""
}

响应失败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": ""
}

userId错误

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

回调地址给是错误(需带协议头)

{
    "code": 400,
    "status": "error",
    "message": "url format error.",
    "data": ""
}

字段说明

参数名 说明
code 请求状态响应码
status 请求状态
message 错误信息
data 暂无作用

php请求示例

<?php
$appId = "egymbtsf38";
$userId = "edvf2fpec9";
$timestamp = time()*1000;
$url = "http://demo.polyv.net/wfy/postDemo1.php";
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."appId$appId"."timestamp$timestamp"."url$url".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/user/$userId/set-playback-callback?appId=$appId&timestamp=$timestamp&sign=$sign&url=$url";
//echo $url;
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId = "egymbtsf38"
timestatmp = 1517221480000
url = "http://demo.polyv.net/wfy/postDemo.php"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e" + "appId" + "egymbtsf38" + "timestamp" + "1517221480000" + "url" + "http://demo.polyv.net/wfy/postDemo.php" + "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

修改倒计时设置

接口URL

http://api.polyv.net/live/v2/channelSetting/{channelId}/set-countdown

接口说明

1、通过接口可以修改频道的倒计时设置。
2、预约功能需开启开关且开启倒计时开关以及设置正确的直播时间才生效
3、之前未设置倒计时直播提示和直播时间的频道号,在开启倒计时开关时,必须提交countTips和startTime
4、接口支持https

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
countEnabled Y 或 N 倒计时开关
bookingEnabled Y或 N 预约观看开关
countTips string(长度不能大于10) 直播倒计时提醒文字
startTime string(yyyy-MM-dd HH:mm:ss) 直播开始时间
sign string 32位大写MD5值

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": ""
}

响应失败JSON示例:

未输入appId

{
    "code": 400,
    "status": "error",
    "message": "appId not found.",
    "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": 400,
    "status": "error",
    "message": "channel not found.",
    "data": ""
}

倒计时开关错误(不是Y或N)

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

开启开关且之前未设置过直播提示时,未提交countTips

{
    "code": 400,
    "status": "error",
    "message": "countTips is requeired under this condition.",
    "data": ""
}

其他情况

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

字段说明

参数名 说明
code 请求结果代码,成功为200
status 请求结果,成功时为"success"错误时为"error"
message 错误信息,请求成功时为空,错误时错误信息

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$countEnabled = "Y";
$bookingEnabled = "Y";
$startTime = "2018-02-15 10:00:00";
$countTips = "精彩值得等待";
$timestamp = time()*1000;
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."appId$appId"."bookingEnabled$bookingEnabled"."countEnabled$countEnabled"."countTips$countTips"."startTime$startTime"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/channelSetting/$channelId/set-countdown?appId=$appId&timestamp=$timestamp&sign=$sign&countEnabled=$countEnabled&bookingEnabled=$bookingEnabled&countTips=$countTips&startTime=$startTime";
echo $url;
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId="egymbtsf38"
bookingEnabled="Y"
countEnabled="Y"
countTips="精彩值得期待"
startTime="2018-02-07 12:00:00"
timestamp="1517899767000"

2、连接字符串 连接参数名与参数值,并在首尾加上appSecret(此处appSecret的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e"+"appId"+"egymbtsf38"+"bookingEnabled"+"Y"+"countEnabled"+"Y"+"countTips"+"精彩值得期待"+"startTime"+"2018-02-07 12:00:00"+"timestamp"+"1517899767000+"6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

获取倒计时设置信息

接口URL

http://api.polyv.net/live/v2/channelSetting/{channelId}/get-countdown

接口说明

通过接口可以获取倒计时设置的相关信息;
接口支持https

支持格式

JSON

请求方式

GET,POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值

响应成功JSON示例:

{
    code: 200,
    status: "success",
    message: "",
    data: {
        bookingEnabled: "N",
        countTips: "不要急,精彩值得等待",
        countEnabled: "N",
        startTime: "2018-12-01 15:00:00"
    }
}

响应失败JSON示例:

未输入appId

{
    "code": 400,
    "status": "error",
    "message": "appId not found.",
    "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": 400,
    "status": "error",
    "message": "channel not found.",
    "data": ""
}

字段说明

参数名 说明
code 请求结果代码,成功为200
status 请求结果,成功时为"success"错误时为"error"
countEnabled 倒计时开关(Y/N)
bookingEnabled 预约开关(Y/N)
countTips 直播提示文字
startTime 直播开始时间

php请求示例

<?php
$appId = "egymbtsf38";
$channelId = "108888";
$timestamp = time()*1000;
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."appId$appId"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/channelSetting/$channelId/get-countdown?appId=$appId&timestamp=$timestamp&sign=$sign";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId = "egymbtsf38"
channelIds="100001,100002"
timestatmp = "1503632521000"

2、连接字符串 连接参数名与参数值,并在首尾加上appSecret(此处appSecret的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e"+"appId"+"egymbtsf38"+"channelIds+"100001,100002"+ "timestamp" + "1503632521000"
+ "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

设置录制通知回调地址

接口URL

http://api.polyv.net/live/v2/user/{userId}/set-record-callback

接口说明

1、设置账号下录制视频通知回调地址的接口
2、不提交地址参数url,则回调地址为空,表示关闭回调功能,如果要提交的地址参数url,必须以 http:// 或者 https:// 开头
3、接口支持https

具体功能可参考:录屏生成回调通知接口

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值
url string 回调地址url,不提交表示关闭回调功能,如果提交,必须以 http:// 或者 https:// 开头

响应成功JSON示例:

{
    "code": 200, 
    "status": "success", 
    "message": "", 
    "data": ""
}

响应失败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": ""
}

userId错误

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

回调地址给是错误(需带协议头)

{
    "code": 400,
    "status": "error",
    "message": "url format error.",
    "data": ""
}

字段说明

参数名 说明
code 请求状态响应码
status 请求状态
message 错误信息
data 暂无作用

php请求示例

<?php
$appId = "egymbtsf38";
$userId = "edvf2fpec9";
$timestamp = time()*1000;
$url = "http://demo.polyv.net/wfy/postDemo.php";
$appSecret = "6ef8d34c08f44e91a18428842ff0ba7e";
$str = $appSecret."appId$appId"."timestamp$timestamp"."url$url".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/user/$userId/set-record-callback?appId=$appId&timestamp=$timestamp&sign=$sign&url=$url";
//echo $url;
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId = "egymbtsf38"
timestatmp = 1517221480000
url = "http://demo.polyv.net/wfy/postDemo.php"

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为6ef8d34c08f44e91a18428842ff0ba7e),如下:

"6ef8d34c08f44e91a18428842ff0ba7e" + "appId" + "egymbtsf38" + "timestamp" + "1517221480000" + "url" + "http://demo.polyv.net/wfy/postDemo.php" + "6ef8d34c08f44e91a18428842ff0ba7e"

3、sign为32位大写的MD5值

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

删除直播暂存中的录制文件接口

接口URL

http://api.polyv.net/live/v2/channel/recordFile/{channelId}/delete-record

接口说明

1、根据开始录制时间删除频道下对应的的录制视频
2、提交的开始录制时间参数(startTime)格式与
【获取频道录制视频信息】接口中获取的返回结果的时间格式一致,为 yyyyMMddHHmmss,如:20180126174943
3、接口支持https

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 用户的应用id,可在直播后台获取
timestamp 13位的时间戳 时间戳
sign string 32位大写MD5值
startTime string 录制视频的开始录制时间,可从 获取频道录制信息接口中获取

响应成功JSON示例:

{
    "code": 200, 
    "status": "success", 
    "message": "", 
    "data": ""
}

响应失败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": ""
}

startTime格式错误

{
    "code": 400,
    "status": "error",
    "message": "startTime format error.",
    "data": ""
}

无对应时间的录制视频

{
    "code": 400,
    "status": "error",
    "message": "record file not exist.",
    "data": ""
}

字段说明

参数名 说明
code 请求状态响应码
status 请求状态
message 错误信息
data 暂无作用

php请求示例

<?php
  $channelId="108888";
  $startTime="20180126174943";
  $appId="emwdquml6d";
  $appSecret="fa1c9932f1ff427080512a510ad1c2e2";
  $timestamp = time()*1000;
  $str = $appSecret."appId".$appId."startTime".$startTime."timestamp".$timestamp.$appSecret;
  $sign=strtoupper(md5($str));

  $url="http://api.polyv.net/live/v2/channel/recordFile/$channelId/delete-record?appId=".$appId."&timestamp=".$timestamp."&sign=".$sign."&startTime=".$startTime;

  $ch = curl_init() or die ( curl_error() );
  curl_setopt( $ch, CURLOPT_URL, $url);
  curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
  $response = curl_exec ( $ch );
  curl_close ( $ch );
  echo $response;
?>

签名规则:

sign生成示例: 

1、将请求参数按照参数名字典顺序排列为

appId = "emwdquml6d"
startTime = 20180126181432
timestatmp = 1516962102000

2、连接字符串 连接参数名与参数值,并在首尾加上secretkey(此处secretkey的值为fa1c9932f1ff427080512a510ad1c2e2),如下:

"fa1c9932f1ff427080512a510ad1c2e2" + "appId" + "egymbtsf38" + "startTime" + "20180126181432" + "timestamp" + "1516962102000" + "fa1c9932f1ff427080512a510ad1c2e2"

3、sign为32位大写的MD5值

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