简要描述:

  • 获取下载文件列表
    通过本接口可以帮助您创建下载任务。支持通过文件ID和文件夹ID,获取可下载文件的递归目录信息。
    返回值中的 path 为对应当前文件目录的相对位置。需要在您设计的软件中,本地自动创建文件夹,并把文件下载至对应的文件夹内。这样可以保持与服务端一样的文件结构。

接口版本:

版本号 制定人 制定日期 修订日期
1.0 Joe 2020-05-20 2020-05-20

请求URL:

请求参数:

参数名 是否必须 类型 说明
ids array(string) 需要下载的文件/文件夹ID,文件以f开头,文件夹以d开头
xtlink string 小通链接

请求示例:

POST /v1/browser/file/download HTTP/1.1
HOST: rest.ctfile.com
content-type: application/json
content-length: 107

{
  "xtlink": "ctfile://1232132131232132132132132",
  "session": "41e20167a3b05a21c47265dd3c262c92",
  "ids": [
    "f229307016",
    "d31688206"
  ]
}

返回示例:

正常返回:

{"code":200,"results":[{"key":"f229307016","icon":"file","userid":10741048,"name":"DELL 3050 Win7 64 IE8.gho","size":12954629366,"path":"\/"},{"key":"f326430232","icon":"mp4","userid":10741048,"name":"\u6ca1\u6709\u4f60\u966a\u4f34\u771f\u7684\u597d\u5b64\u5355 \u5192\u6d3e\u97f3\u4e50\u5f00\u4e1a\u76db\u5178 \u73b0\u573a\u7248 -- \u68a6\u7136.mp4","size":215076467,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430235","icon":"mkv","userid":10741048,"name":" \u9f99\u5144\u864e\u5f1f.Armour.of.God.1986.1080p.BluRay.x264.AAC-TYZH.\u56fd\u7ca4\u53cc\u8bed.mkv","size":4182380342,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430238","icon":"flv","userid":10741048,"name":"\u767d\u65e5\u5973\u9b3c\uff081994\uff09.flv","size":303006294,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430241","icon":"wmv","userid":10741048,"name":"seirref001_00 (1).wmv","size":314822899,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430244","icon":"3gp","userid":10741048,"name":"VID_20171224_112129.3gp","size":49430949,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430247","icon":"file","userid":10741048,"name":"\u4e8c\u9a6c.f4v","size":1641145,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430250","icon":"avi","userid":10741048,"name":"\u7b2c26\u8bfe\u7b2c\u4e8c\u5341\u516d\u8bb2.avi","size":83080632,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430253","icon":"file","userid":10741048,"name":"\u90c1\u6b22-\u70df\u706b\u91cc\u7684\u5c18\u57c3.mpg","size":72138756,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430256","icon":"mov","userid":10741048,"name":"5 (2).MOV","size":46505044,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430259","icon":"rm","userid":10741048,"name":"\u8179\u8154\u955c\u4fee\u8865\u5d4c\u987f\u6027\u5207\u53e3\u759d.rm","size":27812629,"path":"\/\u89c6\u9891\u683c\u5f0f\/"},{"key":"f326430268","icon":"file","userid":10741048,"name":"\u52a8\u7684\u4eba.mpeg","size":2123322,"path":"\/\u89c6\u9891\u683c\u5f0f\/"}]}

错误时返回:

{"code":403,"message":"错误描述"}

返回参数说明:

参数名 类型 说明
key string 文件ID
icon string 文件图标
name string 文件名称
size long 文件大小(bytes)
path string 为对应当前文件目录的相对位置。需要自动创建文件夹,并把文件下载至对应的文件夹内。

备注:

  • 更多返回错误代码请看首页的错误代码描述
文档更新时间: 2020-08-13 13:31   作者:admin