---
title: 文件 API
description: 文件 API 的接口路径、方法、参数和返回字段。
slug: developer-api-files
lang: zh
category: 文件 API
category_order: 8
order: 3
hide_in_nav: true
keywords:
  - API
  - 文件 API
  - 开发者
---


# 文件 API

文件列表、元信息、目录、内容传输、版本、回收站与素材库接口。上传分为预上传和二进制传输两步，不要把预上传成功当成文件已经保存。删除、清空及覆盖操作前应确认权限和目标。

## 接口目录

| 方法 | 接口 | 路径 |
| --- | --- | --- |
| `GET` | [获取下载多文件地址](api-get-api-file-downloadmultifiles-do.md) | `/api/file/downloadMultiFiles.do` |
| `GET` | [获取下载文件缩略图地址](api-get-api-file-downloadthumbnail-do.md) | `/api/file/downloadThumbnail.do` |
| `GET` | [获取下载文件地址](api-get-api-file-getfiledownloadurl-do.md) | `/api/file/getFileDownloadUrl.do` |
| `GET` | [预上传文件](api-get-api-file-preuploadfile-do.md) | `/api/file/preUploadFile.do` |
| `GET` | [文件日志](api-get-nd-api-file-file-logs.md) | `/nd/api/file/file_logs` |
| `GET` | [获取文件信息](api-get-nd-api-file-fileinfo.md) | `/nd/api/file/fileinfo` |
| `GET` | [获取文件列表](api-get-nd-api-file-list-dir.md) | `/nd/api/file/list_dir` |
| `GET` | [获取文件的所有版本信息](api-get-nd-api-file-versions.md) | `/nd/api/file/versions` |
| `POST` | [拷贝文件进度](api-post-nd-api-file-copy-progress.md) | `/nd/api/file/copy_progress` |
| `POST` | [拷贝文件](api-post-nd-api-file-copy.md) | `/nd/api/file/copy` |
| `POST` | [创建文件夹](api-post-nd-api-file-create-folder.md) | `/nd/api/file/create_folder` |
| `POST` | [创建素材库分类](api-post-nd-api-file-create-material-class.md) | `/nd/api/file/create_material_class` |
| `POST` | [创建子素材库](api-post-nd-api-file-create-material-folder.md) | `/nd/api/file/create_material_folder` |
| `POST` | [清空回收站](api-post-nd-api-file-empty-trash.md) | `/nd/api/file/empty_trash` |
| `POST` | [移动文件](api-post-nd-api-file-move.md) | `/nd/api/file/move` |
| `POST` | [删除文件(到回收站）](api-post-nd-api-file-remove-file.md) | `/nd/api/file/remove_file` |
| `POST` | [删除文件（从回收站）](api-post-nd-api-file-remove-from-trash.md) | `/nd/api/file/remove_from_trash` |
| `POST` | [修改文件名](api-post-nd-api-file-rename.md) | `/nd/api/file/rename` |
| `POST` | [恢复文件（从回收站）](api-post-nd-api-file-restore-file.md) | `/nd/api/file/restore_file` |
| `POST` | [设置用户是否有权访问素材库](api-post-nd-api-file-set-user-access-material-library.md) | `/nd/api/file/set_user_access_material_library` |
| `POST` | [修改文件信息](api-post-nd-api-file-update-file.md) | `/nd/api/file/update_file` |
| `POST` | [设置文件当前版本](api-post-nd-api-file-version.md) | `/nd/api/file/version` |

## 完成上传

调用 [预上传](api-get-api-file-preuploadfile-do.md) 取得一次性 `url` 和 `upload_token`，向该 URL 发起 `multipart/form-data` POST，包含二进制 `file` 与 `upload_token`。检查返回的 `success`、`code`、`fileId` 与 `version`。传输地址不能写死，过期或已使用后需要重新申请。

## 对接说明

本文依据《Babel 开发 API》整理，单接口页面保留原始路径和字段大小写。源文档未明确或存在类型冲突的字段需在联调中确认，不应假定存在未列出的参数。使用部署方提供的 HTTPS 域名；API 密钥与访问凭证不得写入公开页面。

[开发 API 概览](developer-api-overview.md) · [MCP 快速入门](mcp-integration.md)
