跳至主要內容

fs

Andy HsuGuideAPIGuide大约 11 分钟

fs

POST 新建文件夹

POST /api/fs/mkdir

Body 请求参数

{
  "path": "/tt"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
Content-Typeheaderstringnone
bodybodyobjectnone
» pathbodystring新目录路径none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 重命名文件

POST /api/fs/rename

Body 请求参数

{
  "name": "test3",
  "path": "/阿里云盘/test2"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
Content-Typeheaderstringnone
bodybodyobjectnone
» namebodystring目标文件名,不支持'/'none
» pathbodystring源文件名none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

PUT 表单上传文件

PUT /api/fs/form

Body 请求参数

file: []

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
Content-Typeheaderstring需要是multipart/form-data;
Content-Lengthheaderstring文件大小
File-Pathheaderstring经过URL编码的完整文件路径
As-Taskheaderstring是否添加为任务
bodybodyobjectnone
» filebodystring(binary)文件

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "task": {
      "id": "sdH2LbjyWRk",
      "name": "upload animated_zoom.gif to [/data](/alist)",
      "state": 0,
      "status": "uploading",
      "progress": 0,
      "error": ""
    }
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» taskobjecttruenonenone
»»» idstringtruenonenone
»»» namestringtruenonenone
»»» stateintegertruenonenone
»»» statusstringtruenonenone
»»» progressintegertruenonenone
»»» errorstringtruenonenone

POST 列出文件目录

POST /api/fs/list

Body 请求参数

{
  "path": "/t",
  "password": "",
  "page": 1,
  "per_page": 0,
  "refresh": false
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» pathbodystring路径none
» passwordbodystring密码none
» pagebodyinteger页数none
» per_pagebodyinteger每页数目none
» refreshbodyboolean是否强制刷新none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "name": "m",
        "size": 0,
        "is_dir": true,
        "modified": "2023-07-19T09:48:13.695585868+08:00",
        "sign": "",
        "thumb": "",
        "type": 1
      }
    ],
    "total": 1,
    "readme": "",
    "write": true,
    "provider": "unknown"
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» content[object]truenone内容none
»»» namestringtruenone文件名none
»»» sizeintegertruenone大小none
»»» is_dirbooleantruenone是否是文件夹none
»»» modifiedstringtruenone修改时间none
»»» signstringtruenone签名none
»»» thumbstringtruenone缩略图none
»»» typeintegertruenone类型none
»» totalintegertruenone总数none
»» readmestringtruenone说明none
»» writebooleantruenone是否可写入none
»» providerstringtruenonenone

POST 获取某个文件/目录信息

POST /api/fs/get

Body 请求参数

{
  "path": "/t",
  "password": "",
  "page": 1,
  "per_page": 0,
  "refresh": false
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» pathbodystring路径none
» passwordbodystring密码none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "name": "root",
    "size": 0,
    "is_dir": true,
    "modified": "0001-01-01T00:00:00Z",
    "sign": "",
    "thumb": "",
    "type": 0,
    "raw_url": "",
    "readme": "",
    "provider": "unknown",
    "related": null
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» namestringtruenone文件名none
»» sizeintegertruenone大小none
»» is_dirbooleantruenone是否是文件夹none
»» modifiedstringtruenone修改时间none
»» signstringtruenone签名none
»» thumbstringtruenone缩略图none
»» typeintegertruenone类型none
»» raw_urlstringtruenone原始urlnone
»» readmestringtruenone说明none
»» providerstringtruenonenone
»» relatednulltruenonenone

POST 搜索文件或文件夹

POST /api/fs/search

Body 请求参数

{
  "parent": "string",
  "keywords": "string",
  "scope": 0,
  "page": 0,
  "per_page": 0,
  "password": "string"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» parentbodystring搜索目录none
» keywordsbodystring关键词none
» scopebodyinteger搜索类型0-全部 1-文件夹 2-文件
» pagebodyinteger页数none
» per_pagebodyinteger每页数目none
» passwordbodystring密码none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "parent": "/m",
        "name": "4305da1e",
        "is_dir": false,
        "size": 393090,
        "type": 0
      }
    ],
    "total": 1
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» content[object]truenonenone
»»» parentstringtruenone路径none
»»» namestringtruenone文件名none
»»» is_dirbooleantruenone是否是文件夹none
»»» sizeintegertruenone大小none
»»» typeintegertruenone类型none
»» totalintegertruenone总数none

POST 获取目录

POST /api/fs/dirs

Body 请求参数

{
  "path": "/t",
  "password": "",
  "page": 1,
  "per_page": 0,
  "refresh": false
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» pathbodystring路径none
» passwordbodystring密码none
» force_rootbodybooleannone

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": [
    {
      "name": "a",
      "modified": "2023-07-19T09:48:13.695585868+08:00"
    }
  ]
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» data[object]truenonenone
»» namestringtruenone文件名none
»» modifiedstringtruenone修改时间none

POST 批量重命名

POST /api/fs/batch_rename

Body 请求参数

{
  "src_dir": "/m2",
  "rename_objects": [
    {
      "src_name": "test.txt",
      "new_name": "aaas2.txt"
    }
  ]
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
Content-Typeheaderstringnone
bodybodyobjectnone
» src_dirbodystring源目录none
» rename_objectsbody[object]none
»» src_namebodystring原文件名none
»» new_namebodystring新文件名none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» datanulltruenonenone

POST 正则重命名

POST /api/fs/regex_rename

Body 请求参数

{
  "src_dir": "/m2",
  "rename_objects": [
    {
      "src_name": "test.txt",
      "new_name": "aaas2.txt"
    }
  ]
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
Content-Typeheaderstringnone
bodybodyobjectnone
» src_dirbodystring源目录none
» src_name_regexbodystring源文件匹配正则none
» new_name_regexbodystring新文件名正则none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» datanulltruenonenone

POST 移动文件

POST /api/fs/move

Body 请求参数

{
  "src_dir": "string",
  "dst_dir": "string",
  "names": [
    "string"
  ]
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» src_dirbodystring源文件夹none
» dst_dirbodystring目标文件夹none
» namesbody[string]文件名none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 聚合移动

POST /api/fs/recursive_move

Body 请求参数

{
  "src_dir": "string",
  "dst_dir": "string"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» src_dirbodystring源文件夹none
» dst_dirbodystring目标文件夹none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 复制文件

POST /api/fs/copy

Body 请求参数

{
  "src_dir": "string",
  "dst_dir": "string",
  "names": [
    "string"
  ]
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» src_dirbodystring源文件夹none
» dst_dirbodystring目标文件夹none
» namesbody[string]文件名none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 删除文件或文件夹

POST /api/fs/remove

Body 请求参数

{
  "names": [
    "string"
  ],
  "dir": "string"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» namesbody[string]文件名none
» dirbodystring目录none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 删除空文件夹

POST /api/fs/remove_empty_directory

Body 请求参数

{
  "src_dir": "string"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» src_dirbodystring目录none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

PUT 流式上传文件

PUT /api/fs/put

Body 请求参数

string

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
File-Pathheaderstring经过URL编码的完整目标文件路径
As-Taskheaderstring是否添加为任务
Content-Typeheaderstringnone
Content-Lengthheaderstringnone
bodybodystring(binary)none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "task": {
      "id": "sdH2LbjyWRk",
      "name": "upload animated_zoom.gif to [/data](/alist)",
      "state": 0,
      "status": "uploading",
      "progress": 0,
      "error": ""
    }
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» taskobjecttruenonenone
»»» idstringtruenonenone
»»» namestringtruenonenone
»»» stateintegertruenonenone
»»» statusstringtruenonenone
»»» progressintegertruenonenone
»»» errorstringtruenonenone

POST 添加aria2下载

POST /api/fs/add_aria2

Body 请求参数

{
  "urls": [
    "string"
  ],
  "path": "string"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» urlsbody[string]urlnone
» pathbodystring目标路径none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 添加qBittorrent下载

POST /api/fs/add_qbit

Body 请求参数

{
  "urls": [
    "string"
  ],
  "path": "string"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» urlsbody[string]urlnone
» pathbodystring目标路径none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone