con un clic
feishu-card
飞书交互卡片。构建和发送带按钮/选择器的消息卡片。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
飞书交互卡片。构建和发送带按钮/选择器的消息卡片。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
飞书多维表格操作。记录 CRUD、字段管理、视图、权限、公式、关联。
飞书日历。创建日程、查询日程、更新日程。
飞书审批。创建审批实例、查询审批状态。
飞书组织架构与 ID 转换。搜索成员、部门管理、ID 互转(OpenID/UserID/UnionID)。
飞书文档写入。Markdown 转 Block、创建文档块、处理并发,支持 Mermaid 绘图块。
飞书云空间文件管理。上传/下载/移动/搜索文件、创建文件夹。
| name | feishu-card |
| description | 飞书交互卡片。构建和发送带按钮/选择器的消息卡片。 |
构建、发送和处理飞书交互卡片。
Base URL: https://open.feishu.cn/open-apis/im/v1
使用场景: 晨报确认、告警处理、任务确认、状态更新
从 feishu_skills 根目录执行共享脚本:
TOKEN="$(./scripts/get_feishu_token.sh)"
请求头统一使用 Authorization: Bearer ${TOKEN}。
如果业务接口返回 token 无效、过期或 401,强制刷新后仅重试一次原请求:
TOKEN="$(./scripts/get_feishu_token.sh --force-refresh)"
环境变量:
FEISHU_APP_IDFEISHU_APP_SECRET本地缓存: ./.feishu_token_cache.json(未过期直接复用,默认提前 5 分钟刷新)
POST /open-apis/im/v1/messages?receive_id_type=chat_id
{
"receive_id": "<chat_id>",
"msg_type": "interactive",
"content": "<card_json_string>"
}
⚠️ content 必须是字符串化的 JSON。
{
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "标题"},
"template": "blue"
},
"elements": [
{"tag": "div", "text": {"tag": "lark_md", "content": "**加粗**"}},
{"tag": "action", "actions": [
{"tag": "button", "text": {"tag": "plain_text", "content": "确认"}, "type": "primary", "value": {"action": "confirm"}}
]}
]
}
| 元素 | 说明 | 示例 |
|---|---|---|
div | 文本块 | {"tag":"div","text":{"tag":"lark_md","content":"文本"}} |
hr | 分割线 | {"tag":"hr"} |
action | 按钮组 | 见下方 |
note | 备注 | {"tag":"note","elements":[{"tag":"plain_text","content":"备注"}]} |
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": {"tag": "plain_text", "content": "确认"},
"type": "primary",
"value": {"action": "confirm", "data": "extra_info"}
}
]
}
按钮类型: default / primary / danger
{
"tag": "select_static",
"placeholder": {"tag": "plain_text", "content": "请选择"},
"options": [
{"text": {"tag": "plain_text", "content": "选项1"}, "value": "opt1"},
{"text": {"tag": "plain_text", "content": "选项2"}, "value": "opt2"}
],
"value": {"key": "select_result"}
}
用户点击按钮后,飞书会发送 WebSocket 事件:
{
"type": "card.action.trigger",
"action": {
"value": {"action": "confirm", "data": "extra_info"}
}
}
处理回调后可更新卡片:
PATCH /open-apis/im/v1/messages/{message_id}