Search

PythonReactSEOPDF
OpenClaw

Feishu Drive

飞书云空间文件管理

autogame-170 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install autogame-17/feishu-drive

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

飞书云空间文件管理

你是飞书云空间文件管理专家,负责通过 API 实现文件的上传、下载、移动、搜索和元数据管理。


一、API 基础信息

项目 值
Base URL https://open.feishu.cn/open-apis/drive/v1
认证方式 Authorization: Bearer {tenant_access_token}
Content-Type application/json(文件上传用 multipart/form-data)

二、文件夹操作

1. 创建文件夹
POST /open-apis/drive/v1/folders
{ "name": "文件夹名", "folder_token": "root" }

实测心法:

  1. folder_token 为父文件夹 ID,root 表示根目录。
  2. 可见性保障 (重要):通过 API 创建的文件夹默认只对机器人可见。强烈建议在创建后立即调用权限接口 (Skill 8),将用户(如管理员)添加为 full_access 协作者,这样文件夹才会出现在用户的「我的空间」列表中。
  3. 权限继承:一旦您被添加为父文件夹的管理员,AI 机器人在该文件夹下创建的所有子文件夹和文档,您都将自动拥有管理权限,无需重复授权。

三、文件上传

2. 上传文件(小文件一次性上传)
POST /open-apis/drive/v1/files/upload_all
Content-Type: multipart/form-data

表单字段:

字段 说明
file 文件二进制内容
file_name 文件名(如 report.pdf)
parent_type 父节点类型(explorer = 云空间,bitable_file = 多维表格附件)
parent_node 父节点 token(文件夹 token 或 app_token)
size 文件大小(字节)

实测心法:大文件建议使用分片上传接口。

3. 分片上传(大文件)

第 1 步:准备上传

POST /open-apis/drive/v1/files/upload_prepare
{
  "file_name": "large_file.zip",
  "parent_type": "explorer",
  "parent_node": "fldcnXXX",
  "size": 104857600
}

返回 upload_id 和分片信息。

第 2 步:逐片上传

POST /open-apis/drive/v1/files/upload_part
Content-Type: multipart/form-data

第 3 步:完成上传

POST /open-apis/drive/v1/files/upload_finish

四、文件下载

4. 下载文件
GET /open-apis/drive/v1/files/:file_token/download

实测心法:流式读取响应体,注意保存路径。返回的是...

Source information

Source
github
Repository
openclaw/skills
Path
skills/autogame-17/feishu-drive
Version
—
Commit
dc28063d70334a00e375c7f150752273fd180b3e
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# 飞书云空间文件管理

你是飞书云空间文件管理专家,负责通过 API 实现文件的上传、下载、移动、搜索和元数据管理。

---

## 一、API 基础信息

| 项目 | 值 |
|------|---|
| Base URL | `https://open.feishu.cn/open-apis/drive/v1` |
| 认证方式 | `Authorization: Bearer {tenant_access_token}` |
| Content-Type | `application/json`(文件上传用 `multipart/form-data`) |

---

## 二、文件夹操作

### 1. 创建文件夹

```
POST /open-apis/drive/v1/folders
```

```json
{ "name": "文件夹名", "folder_token": "root" }
```

**实测心法**:
1. `folder_token` 为父文件夹 ID,`root` 表示根目录。
2. **可见性保障 (重要)**:通过 API 创建的文件夹默认只对机器人可见。**强烈建议在创建后立即调用权限接口 (Skill 8)**,将用户(如管理员)添加为 `full_access` 协作者,这样文件夹才会出现在用户的「我的空间」列表中。
3. **权限继承**:一旦您被添加为父文件夹的管理员,AI 机器人在该文件夹下创建的所有子文件夹和文档,您都将自动拥有管理权限,无需重复授权。

---

## 三、文件上传

### 2. 上传文件(小文件一次性上传)

```
POST /open-apis/drive/v1/files/upload_all
Content-Type: multipart/form-data
```

表单字段:

| 字段 | 说明 |
|------|------|
| `file` | 文件二进制内容 |
| `file_name` | 文件名(如 `report.pdf`) |
| `parent_type` | 父节点类型(`explorer` = 云空间,`bitable_file` = 多维表格附件) |
| `parent_node` | 父节点 token(文件夹 token 或 app_token) |
| `size` | 文件大小(字节) |

**实测心法**:大文件建议使用分片上传接口。

### 3. 分片上传(大文件)

**第 1 步:准备上传**

```
POST /open-apis/drive/v1/files/upload_prepare
```

```json
{
  "file_name": "large_file.zip",
  "parent_type": "explorer",
  "parent_node": "fldcnXXX",
  "size": 104857600
}
```

返回 `upload_id` 和分片信息。

**第 2 步:逐片上传**

```
POST /open-apis/drive/v1/files/upload_part
Content-Type: multipart/form-data
```

**第 3 步:完成上传**

```
POST /open-apis/drive/v1/files/upload_finish
```

---

## 四、文件下载

### 4. 下载文件

```
GET /open-apis/drive/v1/files/:file_token/download
```

**实测心法**:流式读取响应体,注意保存路径。返回的是...

Related skills

OpenClaw

dojo.md

edholofy

University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning req...

OpenClaw

wps-macos-helper

lethehades

macOS WPS Office workflow helper skill for safer document preparation, conversion, export, and compatibility guidance