阿里云盘接口清单
来源:
backend/internal/drives/aliyun.go、backend/internal/drives/auth/aliyun.go
抓包日志:backend/logs/drive-api-debug/aliyun.txt(当前仅含刷新 Token 与第三方续期请求;分享/列表/OpenAPI 等可在补跑流程后追加日志再完善响应示例)
1. 刷新 AccessToken(官方)
接口概览
| 项目 | 值 |
|---|---|
| 方法 | POST |
| URL | https://auth.alipan.com/v2/account/token |
| 作用 | 使用 refresh_token 换取新的 access_token、refresh_token 等,供 OpenAPI 与 Web API 调用 |
请求体参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
grant_type | string | 是 | 固定 refresh_token |
refresh_token | string | 是 | 用户授权得到的刷新令牌 |
请求示例
bash
curl --request POST \
--url 'https://auth.alipan.com/v2/account/token' \
--header 'Content-Type: application/json' \
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' \
--data '{"grant_type":"refresh_token","refresh_token":"<你的refresh_token>"}'响应示例(字段截断)
json
{
"token_type": "Bearer",
"access_token": "<JWT 省略>",
"refresh_token": "<新的 refresh_token>",
"expires_in": 7200,
"user_id": "e8b1e405a6f44557a99f0e4d17c7fd0b",
"default_drive_id": "996572",
"default_sbox_drive_id": "996573",
"domain_id": "bj29",
"nick_name": "用户昵称",
"expire_time": "2026-04-03T04:36:57Z",
"status": "enabled"
}关键响应字段
| 字段 | 说明 |
|---|---|
access_token | 后续 OpenAPI / 业务请求 Bearer |
refresh_token | 下次刷新使用(会轮换) |
expires_in | 秒,access_token 有效期 |
default_drive_id | 默认资源盘 ID |
2. 开放 refresh 续期(第三方,项目依赖)
接口概览
| 项目 | 值 |
|---|---|
| 方法 | GET |
| URL | https://api.oplist.org/alicloud/renewapi |
| 作用 | 使用开放态 JWT(refresh_ui)换取续期结果(实现见 auth/aliyun.go) |
Query 参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
apps_types | string | 是 | 日志中为 alicloud_go |
refresh_ui | string | 是 | JWT 形态令牌 |
server_use | string | 是 | 日志中为 true |
请求示例
bash
curl --request GET \
--url 'https://api.oplist.org/alicloud/renewapi?apps_types=alicloud_go&refresh_ui=<JWT>&server_use=true' \
--header 'Accept: */*' \
--header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0'响应说明
- 日志中
Content-Type: application/json,Content-Encoding: br(Brotli)。需在客户端解压后得到 JSON;原文为二进制,此处不粘贴乱码。 - 实际字段以实现解析为准,补抓时建议
Accept-Encoding: identity或依赖 HTTP 客户端自动解压后写入日志。
3. 代码中其他接口(本次日志未覆盖响应,待补)
以下 URL 与参数来自 aliyun.go 实现,本次 aliyun.txt 无对应响应体,跑通分享/列表/播放/下载后再从日志摘录即可。
| 序号 | 方法 | URL | 用途摘要 |
|---|---|---|---|
| 3 | POST | https://api.aliyundrive.com/adrive/v3/share_link/get_share_by_anonymous | 匿名取分享元信息 |
| 4 | POST | https://api.alipan.com/v2/share_link/get_share_token | 分享口令换 share_token |
| 5 | POST | https://api.alipan.com/adrive/v3/file/list | 分享目录列表 |
| 6 | POST | https://user.aliyundrive.com/v2/user/get | 用户信息 |
| 7 | POST | https://api.aliyundrive.com/adrive/v4/batch | 批量查文件信息 |
| 8 | POST | https://openapi.alipan.com/adrive/v1.0/openFile/getDownloadUrl | 下载地址 |
| 9 | POST | https://openapi.alipan.com/adrive/v1.0/openFile/delete | 删除临时文件 |
