素材中心–异步上传视频接口

  1. 视频大小限200M;
  2. 接口同步接受上传视频的请求,异步处理:视频的下载、格式校验、审核等过程;
  3. 视频的审核时间根据素材中心素材数量而定,大部分视频在1分钟内能审核完,小部分视频审核时间会达到天级别,请耐心等待;
    4、上传时需要关注文件夹属性,只有0(文件夹)和2(视频文件夹)才可以上传视频。文件夹属性可通过【/material/getFolderInfo】和【/material/searchFolder】查看。
  4. 审核拒绝的视频将在15日内被定期清理,请慎用。
    其他问题请参考:https://op.jinritemai.com/docs/guide-docs/171/1719

请求URL:

POST https://kf.fw199.com/gateway/dd/material/upload/video/async

公共参数

参数名称 参数类型 是否必须 示例值 参数描述
appid String 合作伙伴AppId
timestamp String 1657525936 当前Unix时间戳,秒
seller_nick String 38173182 抖店的账号,对应蜂巢授权返回doudianseller字段
sign String

业务参数

参数名称 参数类型 是否必须 示例值 参数描述
folder_id String 0 父文件夹id,0为根目录。若需要创建文件夹,请参考:创建文件夹文档
url String https://xxxx.xxx.xx 视频url,url和file_uri二选一,不能同时为空,如果2者都传则取url
name String 视频.mp4 视频名称,不得超过50个字符,最好带上后缀
file_uri - tos-cn-i-7veqoeduo3/9e1df78… 二进制文件对应的uri,获取方式请参考:二进制上传素材指南

2. 请求示例代码(Java)

请求示例代码

    @Test
    public void  DDMaterialUploadvideoAsync() throws Exception {
        Map<String, Object> data = new HashMap<String, Object>();
        data.put("appid",  Config.AppId);
        Long timestamp = System.currentTimeMillis() / 1000;
        data.put("timestamp", timestamp.toString());
        data.put("seller_nick", Config.DDSellerNick);
        data.put("folder_id","73691281073984637961425" );
//        data.put("url","https://www.cheeli.com.cn/wp-content/themes/stratusx-child/img/product/productA1.jpg" );
        data.put("file_uri","tos-cn-i-7veqoeduo3/cc5012c1a9964c3ba74bfd815a916618.mp4");
        data.put("name","test.mp4" );
        data.put("need_distinct","false" );
        data.put("sign", Sign(data,Config.AppSecret));
        // 调用服务API
        String resp = doHttpRequest(Config.DDMaterialUploadVideoAsync, data);
        System.out.println(resp);
    }

3. 返回结果如下:


{
    "code": 0,
    "message": "ok",
    "data": {
    "audit_status": "1",
    "folder_id": "0",
    "is_new": "true",
    "material_id": "7000254886243811628"
  }
}

说明: code为0表示成功,非0为失败,message会包含失败原因。返回字段说明见文档
https://op.jinritemai.com/docs/api-docs/69/1147

文档更新时间: 2024-05-22 10:53   作者:JSL