Alist的官方文档提供了V2版本的API说明,但对于最新的V3版本并没有,这里个人整理了一些V3版本的常用API

获取文件或目录信息

POST /api/fs/get

Body 请求参数

{
  "path": "/阿里云盘/test/sw.jpg",
  "password": ""
}

请求参数

名称 位置 类型 必选 说明
Authorization header string token
Content-Type header string none
body body object none
» password body string 密码
» path body string 文件路径

返回示例

{
  "code": 200,
  "message": "success",
  "data": {
    "name": "sw.jpg",
    "size": 169918,
    "is_dir": false,
    "modified": "2022-11-26T12:54:54.534Z",
    "sign": "xxxx",
    "thumb": "",
    "type": 5,
    "raw_url": "https://cn-beijing-data.aliyundrive.net/xxxx",
    "readme": "",
    "provider": "Aliyundrive",
    "related": null
  }
}

返回结果

状态码 状态码含义 说明 数据模型
200 OK 成功 Inline

返回数据结构

状态码 200

名称 类型 必选 约束 说明
» code integer true none 状态码
» message string true none 信息
» data object true none data
»» name string true none 文件名
»» size integer true none 文件大小
»» is_dir boolean true none 是否是目录
»» modified string true none 修改时间
»» sign string true none 文件密钥
»» thumb string true none 缩略图地址
»» type integer true none 类型
»» raw_url string true none 源文件下载地址
»» readme string true none none
»» provider string true none 驱动类型
»» related null true none none

获取文件列表

POST /api/fs/list

Body 请求参数

{
  "page": 3,
  "password": "",
  "path": "/阿里云盘",
  "per_page": 30,
  "refresh": false
}

请求参数

名称 位置 类型 必选 说明
Authorization header string 用户token
Content-Type header string none
body body object none
» page body integer 当前页数
» password body string 密码
» path body string 路径
» per_page body integer 每页文件数
» refresh body boolean 强制刷新

返回示例

{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "name": "201311",
        "size": 0,
        "is_dir": true,
        "modified": "2021-11-30T15:41:43.004Z",
        "sign": "",
        "thumb": "",
        "type": 1
      },
      {
        "name": "201312",
        "size": 0,
        "is_dir": true,
        "modified": "2021-11-30T15:42:26.839Z",
        "sign": "",
        "thumb": "",
        "type": 1
      },
      {
        "name": "201401",
        "size": 0,
        "is_dir": true,
        "modified": "2021-11-30T15:42:37.344Z",
        "sign": "",
        "thumb": "",
        "type": 1
      },
      {
        "name": "201402",
        "size": 0,
        "is_dir": true,
        "modified": "2021-11-30T15:41:35.053Z",
        "sign": "",
        "thumb": "",
        "type": 1
      },
      {
        "name": "201403",
        "size": 0,
        "is_dir": true,
        "modified": "2021-11-30T15:41:51.271Z",
        "sign": "",
        "thumb": "",
        "type": 1
      }
    ],
    "total": 77,
    "readme": "",
    "write": true,
    "provider": "Aliyundrive"
  }
}

返回结果

状态码 状态码含义 说明 数据模型
200 OK 成功 Inline

返回数据结构

状态码 200

名称 类型 必选 约束 说明
» code integer true none 状态码
» message string true none 信息
» data object true none none
»» content [object] true none none
»»» name string true none 文件名
»»» size integer true none 文件大小
»»» is_dir boolean true none 是否为目录
»»» modified string true none 修改时间
»»» sign string true none 访问密钥
»»» thumb string true none 缩略图地址
»»» type integer true none none
»» total integer true none 总文件数
»» readme string true none none
»» write boolean true none 写入权限
»» provider string true none 存储类型