修改视频分类属性设置

接口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...