视频禁播与解禁

接口URL

https://api.polyv.net/v2/video/{userid}/forbidden

接口说明

(接口调用有频率限制,详细请查看)

用于禁止、解禁播放视频,禁播后会将视频状态(status)设置成53,一次最多只能操作500个vid
支持https
注意点:
  只能修改“已发布”状态的视频为禁播状态,
  只能修改“已禁播”状态的视频为已发布状态,
  当请求中的vid包含多种状态时,只对符合条件的vid进行状态修改操作,并返回成功;若没有符合条件的vid则返回错误。

返回结果支持格式

JSON

请求方式

POST,GET

请求数限制

TRUE

请求参数

参数名 必选 类型及范围 说明
ptime true long 13位的当前时间毫秒级时间戳
sign true string 签名
userId true string userId,路径参数
vids true string 视频vid,多个视频以英文逗号分隔,如xxx,xxx,一次最多只能传500个vid
forbidden true int 1:禁播,0:解禁

返回结果

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

请求失败返回json示例

签名错误
{
    "code": 400,
    "status": "error",
    "message": "the sign is not right.",
    "data": ""
}
时间戳过期
{
    "code": 400,
    "status": "error",
    "message": "ptime is too old",
    "data": ""
}

一次最多只能操作500个vid
{
    "code": 400,
    "status": "error",
    "message": "vid count can't over 500",
    "data": ""
}

只能修改“已发布”状态的视频为禁播状态
{
    "code": 400,
    "status": "error",
    "message": "只能修改“已发布”状态的视频为禁播状态",
    "data": ""
}

只能修改“已禁播”状态的视频为已发布状态
{
    "code": 400,
    "status": "error",
    "message": "只能修改“已禁播”状态的视频为已发布状态",
    "data": ""
}

字段说明

字段 类型 说明
code int 请求返回状态码
status string 请求返回状态
message string 请求返回信息
data string 请求返回数据

Java示例代码

public class Test {

    public static void main(String[] args) throws Exception {
        String userId = "xxxxxx";
        String secretkey = "xxxxxxx";
        String url = "https://api.polyv.net/v2/video/%s/forbidden";

        Map<String, String> maps = new HashMap<>();
        maps.put("vids", "xxxxxx,xxxxxx");
        maps.put("forbidden", String.valueOf(1));
        maps.put("sign", getSign(maps, secretkey));

        url += "?" + buildUrl(maps);
        url = String.format(url, userId);
        HttpClient client = new HttpClient();
        GetMethod getMethod = new GetMethod(url);
        client.executeMethod(getMethod);
        System.out.println(url);
        System.out.println(getMethod.getResponseBodyAsString());
    }

    public static String buildUrl(Map<String, String> maps) {
        List<String> tmp = new ArrayList<>();
        for (Map.Entry<String, String> key : maps.entrySet()) {
            tmp.add(key.getKey() + "=" + key.getValue());
        }
        return String.join("&", tmp);
    }
}

sign的生成规则

签名规则

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

查询视频信息

接口URL

https://api.polyv.net/v3/video/get-video-info

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于查询视频信息
2、接口支持https

请求方式

GET,POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
vids long 视频ID,多个视频ID用英文逗号分隔
filter string 选择需要返回的视频信息,多个以英文逗号分隔,取值:basicInfo,metaData,transcodeInfo,snapshotInfo, 分别代表基础信息、元数据、转码信息、截图信息,为空则返回基础信息

响应成功JSON示例:

// 请求成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": "",
    "data": [
    {
          "vid": "",
          "basicInfo": {
            "title": "",
            "description": "",
            "duration": 0.00,
            "coverURL": "",
            "creationTime": "",
            "updateTime": "",
            "size": 0,
            "status": 0,
            "cateId": 0,
            "cateName": "",
            "tags": "",
            "uploader": ""
          },
          "metaData": {
            "size": 0,
            "format": "",
            "duration": 0.00,
            "bitrate": 0,
            "fps": 0,
            "height": 0,
            "width": 0,
            "codec": ""
          },
          "transcodeInfos": [
            {
              "playUrl": "",
              "definition": "",
              "bitrate": 0,
              "duration": 0.00,
              "encrypt": false,
              "format": "",
              "fps": 0,
              "height": 0,
              "width": 0,
              "status": ""
            }
          ],
          "snapshotInfo": {
            "imageUrl": [
              ""
            ]
          }
        }
    ]
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 视频vid错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 2000,
        "desc": "invalid vid"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据
data[0].vid 视频id
data[0].basicInfo.title 视频标题
data[0].basicInfo.description 视频描述
data[0].basicInfo.duration 源视频时长,单位:秒
data[0].basicInfo.coverURL 首图地址,大图
data[0].basicInfo.creationTime 创建时间
data[0].basicInfo.updateTime 更新时间
data[0].basicInfo.size 源文件大小,单位:Bytes
data[0].basicInfo.status 视频状态码
data[0].basicInfo.cateId 分类id, 如1为根目录
data[0].basicInfo.cateName 分类名称
data[0].basicInfo.tags 标签
data[0].basicInfo.uploader 上传者
data[0].transcodeInfos.playUrl 播放地址
data[0].transcodeInfos.definition 清晰度,SOURCE:原清晰度,LD:普清,SD:标清,HD:高清
data[0].transcodeInfos.duration 时长,秒
data[0].transcodeInfos.encrypt 加密视频为1,非加密为0
data[0].transcodeInfos.format 转码格式,如mp4、flv、pdx、hls
data[0].transcodeInfos.fps 视频帧率
data[0].transcodeInfos.bitrate 码率kbps
data[0].transcodeInfos.height 分辨率高,单位:px
data[0].transcodeInfos.width 分辨率宽,单位:px
data[0].transcodeInfos.status 视频状态, normal:可以正常播放,unavailable:不能正常播放
data[0].metaData.size 源文件大小,单位:Bytes
data[0].metaData.format 视频容器类型,如mp4、flv等
data[0].metaData.duration 源视频时长,单位:秒
data[0].metaData.bitrate 视频码率,单位:bps
data[0].metaData.fps 视频帧率
data[0].metaData.height 分辨率高,单位:px
data[0].metaData.width 分辨率宽,单位:px
data[0].metaData.codec 编码格式,如h264、h265等
data[0].snapshotInfo.imageUrl 截图url数组
视频状态码 含义
60/61 已发布
10 等待编码
20 正在编码
50 等待审核
51 审核不通过
-1 已删除

java请求示例

public void testGetVideoInfo() {
        String url = "https://api.polyv.net/v3/video/get-video-info";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";

        Map<String, String> params = new HashMap<>();
        params.put("vids", "abc,def");
        params.put("filters", "basicInfo,metaData,,transcodeInfo,snapshotInfo");
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" +  PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

修改视频信息

接口URL

https://api.polyv.net/v3/video/update-info

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于修改视频信息
2、接口支持https

请求方式

POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
vid string 视频ID
title string 视频标题
describ string 视频描述
tag string 视频标签信息
publishUrl string 外链地址

响应成功JSON示例:

// 修改成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": null,
    "data": null
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 视频vid错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 2000,
        "desc": "invalid vid"
    },
    "data": null
}
// 视频正在上传中
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3100,
        "desc": "上传中不允许修改"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据

java请求示例

public void testUpdateInfo() {
        String url = "https://api.polyv.net/v3/video/update-info";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";

        Map<String, String> params = new HashMap<>();
        params.put("vid", "xxx");
        params.put("title", "标题");
        params.put("describ", "描述");
        params.put("tag", "视频标签");
        params.put("publishUrl", "外链地址");

        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url, params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

查询视频分类

接口URL

https://api.polyv.net/v3/category/get

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于查询视频分类
2、接口支持https

请求方式

GET,POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
cateId long 分类id
page int 页码
pageSize int 每页大小

响应成功JSON示例:

// 获取成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": "",
    "data": {
        "category": {
            "cateId": 0,
            "cateName": "",
            "parentId": 0
        },
        "subCategoryTotal": 0,
        "subCategories": [
            {
                "cateId": 0,
                "cateName": "",
                "parentId": 0
            }
        ]
    }
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 分类不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3001,
        "desc": "category not exist"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据
data.category 当前分类
data.category.cateId 分类id
data.category.cateName 分类名称
data.category.parentId 父分类id
data.subCategoryTotal 下一级子分类个数
data.subCategories 下一级子分类列表

java请求示例

public void testGetCategory() {
        String url = "http://api.polyv.net/v3/category/get";
        // appId和加密串
        String appId = "xxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxxxxxxx";
        long cateId = 1594482470001L;

        Map<String, String> params = new HashMap<>();
        params.put("cateId", String.valueOf(cateId));
        params.put("page", String.valueOf(1));
        params.put("pageSize", String.valueOf(10));
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

删除视频

接口URL

https://api.polyv.net/v3/video/delete-video

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于删除视频信息
2、接口支持https

请求方式

GET,POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
vid string 视频ID

响应成功JSON示例:

// 删除成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": null,
    "data": null
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 视频vid错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 2000,
        "desc": "invalid vid"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据

java请求示例

public void testDeleteVideo() {
        String url = "https://api.polyv.net/v3/video/delete-video";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        String vid = "xx";
        Map<String, String> params = new HashMap<>();
        params.put("vid", vid);
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url,params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

搜索视频

接口URL

https://api.polyv.net/v3/video/list-video

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于搜索视频
2、接口支持https

请求方式

GET,POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
cataId long 视频分类ID
title string 按标题搜索
uploader string 上传者
status string 视频状态
containSubCate string 是否包含子分类, Y 包含, N 不包含
startTime long 按创建时间范围查询,起始时间戳,13位时间戳
endTime long 结束时间戳,13位时间戳
page int 页码,默认为1
pageSize int 页面大小,默认为10
sort string 排序creationTimeDesc或creationTimeAsc

响应成功JSON示例:

// 请求成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": null,
    "data": {
        "pageNumber": 5,
        "totalPages": 2,
        "pageSize": 7,
        "contents": [
              "vid": "",
              "basicInfo": {
                "title": "",
                "description": "",
                "duration": 0.00,
                "coverURL": "",
                "creationTime": "",
                "updateTime": "",
                "size": 0,
                "status": 0,
                "cateId": 0,
                "cateName": "",
                "tags": "",
                "uploader": ""
              }
        ],
        "totalItems": 4
      }
    }
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 无法操作此分类,权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 106,
        "desc": "category limited"
    },
    "data": null
}
// 分类id不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3001,
        "desc": "category not exist"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回结果集
data.pageNumber 当前的页数
data.pageSize 每页条数
data.totalItems 总的条数
data.contents 查询的结果列表
data.content[0].vid 视频id
data.contents[0].basicInfo.title 视频标题
data.contents[0].basicInfo.description 视频描述
data.contents[0].basicInfo.duration 源视频时长,单位:秒
data.contents[0].basicInfo.coverURL 首图地址,大图
data.contents[0].basicInfo.creationTime 创建时间
data.contents[0].basicInfo.updateTime 更新时间
data.contents[0].basicInfo.size 源文件大小,单位:Bytes
data.contents[0].basicInfo.status 视频状态码
data.contents[0].basicInfo.cateId 分类id, 如1为根目录
data.contents[0].basicInfo.cateName 分类名称
data.contents[0].basicInfo.tags 标签
data.contents[0].basicInfo.uploader 上传者
视频状态码 含义
60/61 已发布
10 等待编码
20 正在编码
50 等待审核
51 审核不通过
-1 已删除

java请求示例

public void testListVideo() {
        String url = "https://api.polyv.net/v3/video/list-video";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";

        long cataId = 1594482470001L;
        Map<String, String> params = new HashMap<>();
        params.put("cateId", String.valueOf(cataId));
        params.put("title", "标题1");
        params.put("uploader", "xxx");
        params.put("status", "60");
        params.put("containSubCate", "Y");
        params.put("page", String.valueOf(1));
        params.put("pageSize", String.valueOf(10));
        params.put("sort", "creationTimeDesc");
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" +  PolyvTool.mapJoinEncode(params));
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

新增视频分类

接口URL

https://api.polyv.net/v3/category/add

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于新增视频分类
2、接口支持https

请求方式

POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
name string 分类名
parentId long 父分类id, 默认位1, 放在根目录下

响应成功JSON示例:

// 添加分类成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": null,
    "data": 1594807635977
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 分类名称不能为空
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3000,
        "desc": "没有填写栏目名称"
    },
    "data": null
}
// 父分类不能为空
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3001,
        "desc": "category not exist"
    },
    "data": null
}
// 子账号没有权限在该目录下创建分类
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3002,
        "desc": "子账号没有权限在该目录下创建分类"
    },
    "data": null
}
{
    "requestId": "df5750d9-27b0-4390-ad7c-f0d1f86d0d14",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3003,
        "desc": "已存在同名的视频分类"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据,创建好的分类id

java请求示例

public void testAddCategory() {
        String url = "https://api.polyv.net/v3/category/add";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";

        long cataId = 1594482470001L;
        Map<String, String> params = new HashMap<>();
        params.put("name", "name");
        params.put("parentId", String.valueOf(cataId));

        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url, params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

修改视频分类信息

接口URL

https://api.polyv.net/v3/category/update-info

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于更新视频分类信息
2、接口支持https

请求方式

POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
cateId long 分类id
cateName string 分类名称

响应成功JSON示例:

// 修改成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": null,
    "data": null
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 无法操作此分类,权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 106,
        "desc": "category limited"
    },
    "data": null
}
// 分类id不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3001,
        "desc": "category not exist"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据

java请求示例

public void testUpdateCategory() {
        String url = "https://api.polyv.net/v3/category/update-info";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        long cataId = 1594482470001L;
        Map<String, String> params = new HashMap<>();
        params.put("cateId", String.valueOf(cataId));
        params.put("cateName", "好的呢");

        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url,params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

删除视频分类

接口URL

https://api.polyv.net/v3/category/delete

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于删除视频信息
2、接口支持https

请求方式

POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
cateId string 视频分类ID

响应成功JSON示例:

// 删除成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": "",
    "data": null
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 无法操作此分类,权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 106,
        "desc": "category limited"
    },
    "data": null
}
// 删除分类失败,原因有:cataid不合法、顶层分类不允许删除...
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3004,
        "desc": "delete category failed"
    },
    "data": null
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据

java请求示例

public void testDeleteVideoCategory() {
        String url = "https://api.polyv.net/v3/category/delete";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        long cateId = 1594807635977L;
        Map<String, String> params = new HashMap<>();
        params.put("cateId", String.valueOf(cateId));
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url,params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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

修改视频分类属性设置

接口URL

https://api.polyv.net/v3/category/update-profile

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于修改视频分类属性设置
2、接口支持https

请求方式

POST

请求参数

参数名 必选 类型 说明
appId string 子账号appId
timestamp long 当前13位当前时间戳,3分钟有效
sign string 签名值,32位大写MD5值
cateId long 分类id
userId string 用户id
enabled string 是否启用分类设置 Y:启用, N:关闭
keepSource int 1:源文件播放为,0:非源文件播放,如果为源文件播放,encrypt、encryptLevel、isEdu、encodeAAC参数不生效
encrypt int 1:开启视频加密,0:不加密
encryptLevel string 加密等级,取值有: open、web、app、wxa_app,分别代表非加密授权,Web授权,APP授权,小程序授权
isEdu int 1:启用录屏优化, 0:关闭
encodeAAC int 1:生成aac, 0:不生成,默认为0

响应成功JSON示例:

// 修改成功
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 200,
    "status": "success",
    "error": null,
    "data": null
}

响应失败JSON示例:

// 时间戳错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 100,
        "desc": "invalid timestamp"
    },
    "data": null
}
// appId不正确
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 101,
        "desc": "application not exist"
    },
    "data": null
}
// 子账号不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 102,
        "desc": "user children not exist"
    },
    "data": null
}
// 子账号过期
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 103,
        "desc": "user children expired"
    },
    "data": null
}
// 签名错误
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 104,
        "desc": "invalid signature"
    },
    "data": null
}
// 账号权限不足
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 403,
    "status": "error",
    "error": {
        "code": 105,
        "desc": "permission limited"
    },
    "data": null
}
// 分类id不存在
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3001,
        "desc": "category not exist"
    },
    "data": null
}
// 不允许修改此分类设置,只能修改根目录下的一级目录
{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3005,
        "desc": "category could not be modified"
    },
    "data": true
}

字段说明

字段 说明
requestId 本次请求的ID
code 响应http状态码
status 状态
error.code 错误码
error.desc 错误描述
data 返回数据

java请求示例

public void testUpdateCategoryProfile() {
        String url = "https://api.polyv.net/v3/category/update-profile";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        long cataId = 1594482470001L;
        Map<String, String> params = new HashMap<>();
        params.put("cateId", String.valueOf(cataId));
        params.put("userId", "abc");
        params.put("enabled", "Y");
        params.put("encrypt", String.valueOf(1));
        params.put("keepSource", String.valueOf(0));
        params.put("encryptLevel", "open");
        params.put("isEdu", String.valueOf(0));
        params.put("encodeAAC", String.valueOf(0));

        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url,params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

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