素材库集成接口


可以实现客户自有素材库系统对接(数据复制模式)

  • 对应事件类型
    素材添加事件:material_add
    素材命名事件:material_rename
    素材删除事件:material_delete

新增素材

  • 接口描述:新增素材。注意该接口单次最大支持保存1000条,并且同一个企业同时只允许执行一个导入任务

  • 接口地址:/api/v1/biz/material/third/add?token=TOKEN&openId=OPENID

  • 方法类型:POST

  • 接口入参:application/json 格式

    参数 是否必须 参数类型 参数说明
    arr Array item如下
    iterm属性如下
    name String 素材名称
    bizType Integer 业务分类 2:企业素材、3:员工素材
    type Integer 素材类型:1:图片 2:音频 3:视频 4:文本
    uploadType Integer 上传类型-0:pc;1:app;2:手机扫码;3:小程序
    path String 素材链接
    tmbPath String 素材封面缩率图
    width Integer 素材宽度(图片素材时为图片宽度,视频素材时为视频宽度,其他类型传0)
    height Integer 素材高度(图片素材时为图片高度,视频素材时为视频高度,其他类型传0)
    size Integer 素材大小(Byte)
    durationTime Integer 时长(单位:秒),音频,视频素材使用,其他类型传0
    createTime String 创建日期(2021-09-08 18:02:01)
    content String 文本内容,type=4时
    tagIds String 绑定tagId 例:1,2,3
  • 请求参数示例:

    [
      {
          "name": "示例视频.mp4",
          "bizType": 2,
          "type": 3,
          "uploadType": 0,
          "path": "https://asset.eqxiu.cn/file/示例视频.mp4",
          "tmbPath": "https://asset.eqxiu.cn/file/示例视频.jpg",
          "width": 750,
          "height": 1334,
          "size": 13642478,
          "durationTime": 7
      }
    ]
    
  • 返回值:

    {
    "success": true,
    "code": "200",
    "msg": null,
    "obj": null,
    "map": null,
    "list": [
      {
       "id": 2502,
       "name": "xxx.jpg",
       "bizType": 3,
       "type": 1,
       "corpId": "6b0efe8c048d40d3bfa293f015d4369b",
       "uploadType": 0,
       "path": "1e5a65a5fa614848bbdd32bc7d3ef2af/795c25c6a38a499280bd9b55306b022a",
       "tmbPath": "1e5a65a5fa614848bbdd32bc7d3ef2af/795c25c6a38a499280bd9b55306b022a",
       "height": null,
       "width": null,
       "size": 30,
       "durationTime": 0,
       "keywords": null,
       "status": 1,
       "createUser": "管理员",
       "createTime": "2022-01-25 14:45:00",
       "updateUser": null,
       "updateTime": "2022-01-25 14:45:00",
       "content": null,
       "tagId": null,
       "transcodePath": null,
       "coverPath": null
     }
    ]
    }
    

素材列表

  • 接口描述:查询素材列表

  • 接口地址:/api/v1/biz/material/third/list?token=TOKEN&openId=OPENID

  • 方法类型:GET

  • 接口入参:x-www-form-ulrencoded 格式

    参数 是否必须 参数类型 参数说明
    name String 素材名字(模糊匹配)
    pageNo Integer 分页查询,默认第一页
    pageSize Integer 分页查询,默认每页10条
    type Integer 素材类型:1:图片 2:音频 3:视频 4:文本
    tagIds String 绑定tagId 例:id1,id2,id3
    bizType Integer 业务分类 2:企业素材、3:员工素材
    startTime Long 开始时间戳(例:1639584000000)
    endTime Long 结束时间戳(例:1639584000000)
  • 返回去值:

    {
     "success": true,
     "code": 200,
     "msg": "操作成功",
     "obj": null,
     "map": {
         "pageNo": 1,
         "count": 14,
         "pageSize": 10,
         "end": false
     },
     "list": [
         {
             "id": 2725,
             "name": "测试下",
             "bizType": 3,
             "type": 1,
             "corpId": "43c5a5c1149c4206bb7089b755975382",
             "uploadType": 0,
             "path": "/material/h2/9f03cddc9d664869a086b181011e22ef/95b370bfa277714d0db8595ee3802513b376/d81e4b8930d74e4fa148564fa5f0fff8f6fe",
             "tmbPath": "/material/h2/9f03cddc9d664869a086b181011e22ef/95b370bfa277714d0db8595ee3802513b376/d81e4b8930d74e4fa148564fa5f0fff8f6fe",
             "height": 643.0,
             "width": 358.0,
             "size": 290573,
             "durationTime": 0,
             "keywords": null,
             "status": 1,
             "createUser": "管理员",
             "createTime": "2022-02-11 11:23:22",
             "updateUser": "9f03cddc9d664869a086b181011e22ef",
             "updateTime": "2022-02-17 21:31:18",
             "content": null,
             "tagId": null,
             "transcodePath": null,
             "coverPath": null
         }
     ]
    }
    

素材元信息查询

  • 接口描述:根据id查询素材

  • 接口地址:/api/v1/biz/material/third/listByIds?token=TOKEN&openId=OPENID

  • 方法类型:GET

  • 接口入参:x-www-form-ulrencoded 格式

    参数 是否必须 参数类型 参数说明
    materialIds String 素材id列表 例:1,2,3
  • 返回值:

    {
    "success": true,
    "code": "200",
    "msg": null,
    "obj": null,
    "map": {
     "pageNo": 1,
     "count": 1,
     "pageSize": 20,
     "end": true
    },
    "list": [
      {
       "id": 2502,
       "name": "src=http___img.gr512.com_KESchoolImage_64_jpg_20180913214331_3221.jpg&refer=http___img.gr512.jpg",
       "bizType": 3,
       "type": 1,
       "corpId": "6b0efe8c048d40d3bfa293f015d4369b",
       "uploadType": 0,
       "path": "1e5a65a5fa614848bbdd32bc7d3ef2af/795c25c6a38a499280bd9b55306b022a",
       "tmbPath": "1e5a65a5fa614848bbdd32bc7d3ef2af/795c25c6a38a499280bd9b55306b022a",
       "height": null,
       "width": null,
       "size": 30,
       "durationTime": 0,
       "keywords": null,
       "status": 1,
       "createUser": "管理员",
       "createTime": "2022-01-25 14:45:00",
       "updateUser": null,
       "updateTime": "2022-01-25 14:45:00",
       "content": null,
       "tagId": null,
       "transcodePath": null,
       "coverPath": null
     }
    ]
    }
    

批量重命名素材

  • 接口描述:批量重命名素材
  • 接口地址:/api/v1/biz/material/third/rename?token=TOKEN&openId=OPENID
  • 方法类型:POST
  • 接口入参:application/json 格式
    参数 是否必须 参数类型 参数说明
    arr Array item如下
    iterm属性
    name String 素材名称
    materialId String 素材id
  • 返回值:
    {
    "success": true,
    "code": "200",
    "msg": null,
    "obj": null,
    "map": null,
    "list": null
    }
    

批量删除素材

  • 接口描述:批量删除素材

  • 接口地址:/api/v1/biz/material/third/delete?token=TOKEN&openId=OPENID

  • 方法类型:POST

  • 接口入参:application/json 格式

    参数 是否必须 参数类型 参数说明
    materialIds String 素材唯一标识 例:1,2
  • 返回值:

    {
    "success": true,
    "code": "200",
    "msg": null,
    "obj": null,
    "map": null,
    "list": null
    }
    

will 2025年4月9日 09:18 3367 收藏文档