Files
qiniu-feishu-bot/FEISHU_SCOPES.md
2026-03-06 14:18:39 +08:00

110 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 飞书应用权限配置
## 权限配置
请在飞书开放平台配置以下权限:
```json
{
"scopes": {
"tenant": [
"im:chat",
"aily:file:read",
"aily:file:write",
"cardkit:card:read",
"cardkit:card:write",
"cardkit:template:read",
"corehr:file:download",
"event:ip_list",
"im:app_feed_card:write",
"im:chat.access_event.bot_p2p_chat:read",
"im:message",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:resource"
],
"user": [
"aily:file:read",
"aily:file:write",
"im:chat.access_event.bot_p2p_chat:read",
"im:message.p2p_msg:get_as_user"
]
}
}
```
## 配置步骤
### 1. 打开飞书开放平台
访问https://open.feishu.cn/app/cli_a92ce47b02381bcc/auth
### 2. 添加权限
#### 租户权限tenant
在"权限管理"页面,搜索并添加以下权限:
| 权限代码 | 说明 |
|---------|------|
| `im:chat` | 发送消息 |
| `aily:file:read` | 读取文件 |
| `aily:file:write` | 写入文件 |
| `cardkit:card:read` | 读取卡片 |
| `cardkit:card:write` | 写入卡片 |
| `cardkit:template:read` | 读取卡片模板 |
| `corehr:file:download` | 下载文件 |
| `event:ip_list` | 查看 IP 列表 |
| `im:app_feed_card:write` | 发送应用消息卡片 |
| `im:chat.access_event.bot_p2p_chat:read` | 读取机器人私聊事件 |
| `im:message` | 发送消息 |
| `im:message.p2p_msg:readonly` | 读取私聊消息 |
| `im:message:readonly` | 读取消息 |
| `im:resource` | 访问消息中的资源(文件) |
#### 用户权限user
在"用户权限"页面,搜索并添加以下权限:
| 权限代码 | 说明 |
|---------|------|
| `aily:file:read` | 读取文件 |
| `aily:file:write` | 写入文件 |
| `im:chat.access_event.bot_p2p_chat:read` | 读取机器人私聊事件 |
| `im:message.p2p_msg:get_as_user` | 以用户身份获取私聊消息 |
### 3. 提交审核
部分权限需要管理员审核:
1. 点击"申请权限"
2. 填写申请理由(例如:用于七牛云文件上传功能)
3. 提交等待审核(通常很快)
### 4. 发布版本
权限配置完成后:
1. 点击"版本管理"
2. 点击"发布"
3. 确认发布
---
## 权限说明
### 核心权限
- `im:message` + `im:message:readonly` - 发送和接收消息
- `im:resource` - **关键权限**:下载用户上传的文件
- `im:message.p2p_msg:readonly` - 读取私聊消息
### 卡片权限
- `cardkit:*` - 发送交互式卡片
### 文件权限
- `aily:file:read` + `aily:file:write` - 文件读写
---
## 验证权限
配置完成后,在飞书开放平台的"权限管理"页面应该看到所有权限状态为"已申请"或"已授权"。
如有问题请查看https://open.feishu.cn/document/ukTMukTMukTM/uEjNwUjLxYDM14SM2ATN