---
title: 开发 API 概览
description: 介绍企业开发账号、认证方式、API 目录、调用规范和开发者索引。
slug: developer-api-overview
lang: zh
category: API概览
category_order: 8
order: 1
keywords:
  - API
  - 开发者
  - OAuth
  - JWT
  - 文件接口
---

# 开发 API 概览

巴别鸟开发 API 用于把企业网盘的认证、文件、分享、组织、消息和登录能力接入第三方业务系统。左侧栏按接口作用分组，组内直接列出可调用端点。

## 调用总览

- 企业管理员在私有云企业管理后台创建开发者账号，获得 `client_id`、`client_secret` 和 JWT 相关密钥。
- OAuth 回调方式使用 `/api/authorize.do` 获取授权码，再用 `/api/token.do` 获取 `access_token`。
- JWT 免登录方式使用 `/api/authorizeByJWT.do` 或 `/account/tokenLogin.do`，私有化部署需开启对应配置。
- 文件访问 API 请求需要在 HTTP Header 中携带 `Authorization: Bearer <access_token>`。
- POST、PUT、DELETE 请求通常使用 `Content-Type: application/json`。

## API 分组

| 分组 | 主要用途 | 典型入口 |
| --- | --- | --- |
| 认证 API | 开发者账号、OAuth 回调、JWT 免登录、Token 获取和刷新 | [获取 token](api-post-api-token-do.md) |
| 文件 API | 文件列表、文件信息、上传下载、版本、移动复制、回收站、素材库分类 | [获取文件列表](api-get-nd-api-file-list-dir.md) |
| 分享 API | 分享链接、分享权限、参与人、关注提醒 | [获取文件的分享 url](api-get-nd-api-share-shareurl.md) |
| 企业 API | 企业信息、部门、成员、企业日志 | [获取当前企业信息](api-get-nd-api-enterprise-current.md) |
| 消息与登录 API | 公告、部门讨论、JWT token 登录、通用状态码 | [JWT token 登录](api-get-account-tokenlogin-do.md) |

## 单接口页面

每个 API 条目均有独立页面，便于开发者按接口查阅路径、方法、参数和返回信息。

- [GET 认证接口一（登录回调方式）](api-get-api-authorize-do.md)：`/api/authorize.do`
- [GET 认证接口二（免登录 JWT token 方式）](api-get-api-authorizebyjwt-do.md)：`/api/authorizeByJWT.do`
- [POST 获取 token](api-post-api-token-do.md)：`/api/token.do`
- [POST 刷新 token](api-post-api-refreshtoken-do.md)：`/api/refreshToken.do`
- [GET 获取文件列表](api-get-nd-api-file-list-dir.md)：`/nd/api/file/list_dir`
- [GET 获取文件信息](api-get-nd-api-file-fileinfo.md)：`/nd/api/file/fileinfo`
- [POST 创建文件夹](api-post-nd-api-file-create-folder.md)：`/nd/api/file/create_folder`
- [GET 预上传文件](api-get-api-file-preuploadfile-do.md)：`/api/file/preUploadFile.do`
- [GET 获取下载文件地址](api-get-api-file-getfiledownloadurl-do.md)：`/api/file/getFileDownloadUrl.do`
- [GET 获取下载多文件地址](api-get-api-file-downloadmultifiles-do.md)：`/api/file/downloadMultiFiles.do`
- [GET 获取下载文件缩略图地址](api-get-api-file-downloadthumbnail-do.md)：`/api/file/downloadThumbnail.do`
- [POST 修改文件信息](api-post-nd-api-file-update-file.md)：`/nd/api/file/update_file`
- [POST 修改文件名](api-post-nd-api-file-rename.md)：`/nd/api/file/rename`
- [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-empty-trash.md)：`/nd/api/file/empty_trash`
- [POST 恢复文件（从回收站）](api-post-nd-api-file-restore-file.md)：`/nd/api/file/restore_file`
- [GET 获取文件的所有版本信息](api-get-nd-api-file-versions.md)：`/nd/api/file/versions`
- [POST 设置文件当前版本](api-post-nd-api-file-version.md)：`/nd/api/file/version`
- [POST 移动文件](api-post-nd-api-file-move.md)：`/nd/api/file/move`
- [POST 拷贝文件](api-post-nd-api-file-copy.md)：`/nd/api/file/copy`
- [POST 拷贝文件进度](api-post-nd-api-file-copy-progress.md)：`/nd/api/file/copy_progress`
- [GET 文件日志](api-get-nd-api-file-file-logs.md)：`/nd/api/file/file_logs`
- [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-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`
- [GET 获取文件的分享 url](api-get-nd-api-share-shareurl.md)：`/nd/api/share/shareurl`
- [GET 获取分享的权限列表](api-get-nd-api-share-share-roles.md)：`/nd/api/share/share_roles`
- [GET 获取用户对于单个文件有权设置的分享角色](api-get-nd-api-share-share-role-forfile.md)：`/nd/api/share/share_role_forfile`
- [POST 创建链接分享](api-post-nd-api-share-open-link-share.md)：`/nd/api/share/open_link_share`
- [POST 关闭链接分享](api-post-nd-api-share-close-link-share.md)：`/nd/api/share/close_link_share`
- [POST 设置链接分享密码](api-post-nd-api-share-set-share-password.md)：`/nd/api/share/set_share_password`
- [POST 邀请人员参与分享](api-post-nd-api-share-invite-share.md)：`/nd/api/share/invite_share`
- [GET 获取所有分享参与人](api-get-nd-api-share-share-participants.md)：`/nd/api/share/share_participants`
- [POST 设置分享参与人的权限角色](api-post-nd-api-share-set-participant-role.md)：`/nd/api/share/set_participant_role`
- [POST 删除分享参与人](api-post-nd-api-file-remove-share-participant.md)：`/nd/api/file/remove_share_participant`
- [POST 提醒关注](api-post-nd-api-file-focus-file.md)：`/nd/api/file/focus_file`
- [POST 移除某人的关注](api-post-nd-api-file-unfocus-file.md)：`/nd/api/file/unfocus_file`
- [GET 获取关注文件的用户列表](api-get-nd-api-file-user-focusfile.md)：`/nd/api/file/user_focusfile`
- [GET 获取可以关注文件的用户列表，并且标记已关注文件的用户](api-get-nd-api-file-user-can-focusfile.md)：`/nd/api/file/user_can_focusfile`
- [GET 获取当前企业信息](api-get-nd-api-enterprise-current.md)：`/nd/api/enterprise/current`
- [GET 获取企业所有部门信息](api-get-nd-api-enterprise-departments.md)：`/nd/api/enterprise/departments`
- [POST 创建企业部门](api-post-nd-api-enterprise-create-department.md)：`/nd/api/enterprise/create_department`
- [GET 获取部门角色列表](api-get-nd-api-enterprise-dep-role.md)：`/nd/api/enterprise/dep_role`
- [POST 添加部门人员](api-post-nd-api-enterprise-add-dep-mem.md)：`/nd/api/enterprise/add_dep_mem`
- [POST 删除部门人员](api-post-nd-api-enterprise-remove-dep-mem.md)：`/nd/api/enterprise/remove_dep_mem`
- [GET 获取自己所在部门信息](api-get-nd-api-enterprise-mydeparments.md)：`/nd/api/enterprise/mydeparments`
- [GET 获取部门人员](api-get-nd-api-enterprise-departmentmembers.md)：`/nd/api/enterprise/departmentmembers`
- [POST 添加企业成员](api-post-nd-api-enterprise-add-ent-mem.md)：`/nd/api/enterprise/add_ent_mem`
- [POST 更新成员信息](api-post-api-updateuserinfo-do.md)：`/api/updateUserInfo.do`
- [GET 获取企业成员信息](api-get-api-getenterprisemember-do.md)：`/api/getEnterpriseMember.do`
- [POST 获取企业所有成员](api-post-nd-api-enterprise-enterprise-members.md)：`/nd/api/enterprise/enterprise_members`
- [POST 获取企业日志](api-post-nd-api-enterprise-enterprise-logs.md)：`/nd/api/enterprise/enterprise_logs`
- [POST 发布公告](api-post-nd-api-enterprise-broadcast.md)：`/nd/api/enterprise/broadcast`
- [GET 获取发布的公告](api-get-nd-api-enterprise-broadcast.md)：`/nd/api/enterprise/broadcast`
- [POST 发送部门讨论](api-post-nd-api-file-send-dep-discussion.md)：`/nd/api/file/send_dep_discussion`
- [POST 获取部门讨论](api-post-nd-api-file-dep-discussion.md)：`/nd/api/file/dep_discussion`
- [GET 获取企业日志](api-get-nd-api-enterprise-enterprise-logs.md)：`/nd/api/enterprise/enterprise_logs`
- [GET JWT token 登录](api-get-account-tokenlogin-do.md)：`/account/tokenLogin.do`
