Skip to main content

fs

Andy HsuGuideAPIGuideAbout 11 min

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": "Alist V3.md",
        "size": 1592,
        "is_dir": false,
        "modified": "2024-05-17T13:47:55.4174917+08:00",
        "created": "2024-05-17T13:47:47.5725906+08:00",
        "sign": "",
        "thumb": "",
        "type": 4,
        "hashinfo": "null",
        "hash_info": null
      }
    ],
    "total": 1,
    "readme": "",
    "header": "",
    "write": true,
    "provider": "Local"
  }
}

返回结果

状态码状态码含义说明数据模型
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
»»» createdstringfalsenone创建时间none
»»» hashinfostringfalsenonenone
»»» hash_infonullfalsenonenone
»» totalintegertruenone总数none
»» readmestringtruenone说明none
»» writebooleantruenone是否可写入none
»» providerstringtruenonenone
»» headerstringtruenonenone

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

POST /api/fs/get

Body 请求参数

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

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» pathbodystring路径none
» passwordbodystring密码none
» pagebodyintegernone
» per_pagebodyintegernone
» refreshbodyboolean强制 刷新none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "name": "Alist V3.md",
    "size": 2618,
    "is_dir": false,
    "modified": "2024-05-17T16:05:36.4651534+08:00",
    "created": "2024-05-17T16:05:29.2001008+08:00",
    "sign": "",
    "thumb": "",
    "type": 4,
    "hashinfo": "null",
    "hash_info": null,
    "raw_url": "http://127.0.0.1:5244/p/local/Alist%20V3.md",
    "readme": "",
    "header": "",
    "provider": "Local",
    "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
»» createdstringtruenone创建时间none
»» hashinfostringtruenonenone
»» hash_infonulltruenonenone
»» headerstringtruenonenone

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": "",
  "force_root": 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 添加离线下载

POST /api/fs/add_offline_download

Body 请求参数

{
  "path": "/local",
  "urls": [
    "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png"
  ],
  "tool": "SimpleHttp",
  "delete_policy": "delete_on_upload_succeed"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» urlsbody[string]urlnone
» pathbodystring目标路径none
» toolbodystring工具可选aria2,SimpleHttpqBittorrent
» delete_policybodystring删除策略可选delete_on_upload_succeed,delete_on_upload_failed,delete_never,delete_always

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "tasks": [
      {
        "id": "jwy7BrfZRzbI2xWg7-y",
        "name": "download https://www.baidu.com/img/20d6cf.png to (/local)",
        "state": 0,
        "status": "",
        "progress": 0,
        "error": ""
      }
    ]
  }
}

返回结果

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

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» tasks[object]truenonenone
»»» idstringfalsenonenone
»»» namestringfalsenonenone
»»» stateintegerfalsenonenone
»»» statusstringfalsenonenone
»»» progressintegerfalsenonenone
»»» errorstringfalsenonenone