Skip to content

阿里云盘接口清单

来源:backend/internal/drives/aliyun.gobackend/internal/drives/auth/aliyun.go
抓包日志:backend/logs/drive-api-debug/aliyun.txt(当前仅含刷新 Token 与第三方续期请求;分享/列表/OpenAPI 等可在补跑流程后追加日志再完善响应示例)


1. 刷新 AccessToken(官方)

接口概览

项目
方法POST
URLhttps://auth.alipan.com/v2/account/token
作用使用 refresh_token 换取新的 access_tokenrefresh_token 等,供 OpenAPI 与 Web API 调用

请求体参数

参数类型必填说明
grant_typestring固定 refresh_token
refresh_tokenstring用户授权得到的刷新令牌

请求示例

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
URLhttps://api.oplist.org/alicloud/renewapi
作用使用开放态 JWT(refresh_ui)换取续期结果(实现见 auth/aliyun.go

Query 参数

参数类型必填说明
apps_typesstring日志中为 alicloud_go
refresh_uistringJWT 形态令牌
server_usestring日志中为 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/jsonContent-Encoding: br(Brotli)。需在客户端解压后得到 JSON;原文为二进制,此处不粘贴乱码。
  • 实际字段以实现解析为准,补抓时建议 Accept-Encoding: identity 或依赖 HTTP 客户端自动解压后写入日志。

3. 代码中其他接口(本次日志未覆盖响应,待补)

以下 URL 与参数来自 aliyun.go 实现,本次 aliyun.txt 无对应响应体,跑通分享/列表/播放/下载后再从日志摘录即可。

序号方法URL用途摘要
3POSThttps://api.aliyundrive.com/adrive/v3/share_link/get_share_by_anonymous匿名取分享元信息
4POSThttps://api.alipan.com/v2/share_link/get_share_token分享口令换 share_token
5POSThttps://api.alipan.com/adrive/v3/file/list分享目录列表
6POSThttps://user.aliyundrive.com/v2/user/get用户信息
7POSThttps://api.aliyundrive.com/adrive/v4/batch批量查文件信息
8POSThttps://openapi.alipan.com/adrive/v1.0/openFile/getDownloadUrl下载地址
9POSThttps://openapi.alipan.com/adrive/v1.0/openFile/delete删除临时文件