SuperAPI AI Directory

feishu-messaging

General & other

View repository

Updated 10-16 01:31

About this skill

Feishu Message and Document Skill

Overview

This Skill helps users send messages, create documents, and manage Feishu resources through the Feishu Open Platform API.

Core Capabilities

Feature Status Required Permissions
Send text message ✅ Available im:message:send_as_bot
Send rich text message ✅ Available im:message:send_as_bot
Send card message ✅ Available im:message:send_as_bot
Get group chat list ✅ Available im:chat:readonly
Get group members ⏳ Pending authorization im:chat.members:read
Create Feishu document ⏳ Pending authorization docx:document
Create multi-dimensional table ⏳ Pending authorization bitable:app
Create knowledge base page ⏳ Pending authorization wiki:wiki

Usage

Send a message to a specified user

给 [姓名] 发一条飞书消息,告诉他 [内容]

Prerequisite: need to obtain the user's open_id

Methods to obtain the user's open_id

  1. Method 1: Query by email/phone number(requires contact:user.id:readonly permission)

    用户邮箱:xxx@company.com
    
  2. Method 2: Have the user send a message proactively

    • The user searches for the bot name in Feishu
    • Sends any message
    • The bot obtains the user's open_id
  3. Method 3: The user checks it themselves

    • The user sends in the bot conversation /myid
    • or checks it from the Feishu Open Platform backend

Known user ID records

Name open_id Remarks
Wang Zhimeng ou_18b8063b232cbdec73ea1541dfb74890 zhimeng.wang@qunar.com

Message Types

1. Text message

mcp__feishu__im_v1_message_create(
    params={"receive_id_type": "open_id"},
    data={
        "receive_id": "ou_xxx",
        "msg_type": "text",
        "content": '{"text": "Hello World"}'
    }
)

2. Rich text message (Post)

Supports formats such as titles, bold, links, and @users.

mcp__feishu__im_v1_message_create(
    params={"receive_id_type": "open_id"},
    data={
        "receive_id": "ou_xxx",
        "msg_type": "post",
        "content": json.dumps({
            "zh_cn": {
                "title": "消息标题",
                "content": [
                    [{"tag": "text", "text": "正文内容"}],
                    [{"tag": "text", "text": "粗体", "style": ["bold"]}],
                    [{"tag": "a", "text": "链接", "href": "https://example.com"}]
                ]
            }
        })
    }
)

3. Card message (Interactive)

The richest message format, supporting columns, buttons, images, etc.

mcp__feishu__im_v1_message_create(
    params={"receive_id_type": "open_id"},
    data={
        "receive_id": "ou_xxx",
        "msg_type": "interactive",
        "content": json.dumps({
            "config": {"wide_screen_mode": True},
            "header": {
                "title": {"tag": "plain_text", "content": "卡片标题"},
                "template": "blue"  # blue/green/orange/red/purple
            },
            "elements": [
                {"tag": "markdown", "content": "**支持 Markdown**\n- 列表项1\n- 列表项2"},
                {"tag": "hr"},
                {"tag": "div", "text": {"tag": "lark_md", "content": "分栏内容"}}
            ]
        })
    }
)

Standard Operating Procedure

Send Message SOP

1. 确认收件人
   ↓ 有 open_id → 直接发送
   ↓ 无 open_id → 获取 open_id(见上述方法)

2. 确认消息类型
   ↓ 简单文本 → text
   ↓ 需要格式 → post
   ↓ 丰富卡片 → interactive

3. 构造消息内容
   ↓ 根据类型构造 JSON

4. 发送消息
   ↓ 调用 im_v1_message_create

5. 确认送达
   ↓ 检查返回的 message_id

Create Document SOP (pending permission activation)

1. 确认文档类型
   ↓ 普通文档 → docx_builtin_import
   ↓ 多维表格 → bitable_v1_app_create
   ↓ 知识库页面 → wiki 相关 API

2. 准备内容
   ↓ Markdown 格式(会自动转换)

3. 创建文档

4. 分享权限(可选)
   ↓ 添加协作者

Permission Application Guide

Feishu Application Information

Permission Application Links

Feature Permission Application Link
Query user ID contact:user.id:readonly Apply
Read group members im:chat.members:read Apply
Read messages im:message Apply
Create document docx:document Apply
Multi-dimensional table bitable:app Apply
Knowledge base wiki:wiki Apply

Apply for all at once

Apply for all commonly used permissions

FAQ

Q: The message was sent successfully but the user did not receive it?

Possible reasons:

  1. The user has not established contact with the bot → have the user send a message to the bot first
  2. Incorrect open_id → Confirm the source of open_id
  3. Cross-tenant → The bot cannot send messages to users of other enterprises

Q: Unable to request permissions?

Possible reasons:

  1. The bot version is under review → Wait for the review to pass
  2. Restricted by the enterprise administrator → Contact the administrator to enable it
  3. The permission requires special approval → Follow the enterprise's internal process

Q: How do I send a group message?

Use chat_id instead of open_id:

params={"receive_id_type": "chat_id"},
data={"receive_id": "oc_xxx", ...}

Message templates

Capability introduction card

{
  "config": {"wide_screen_mode": true},
  "header": {
    "title": {"tag": "plain_text", "content": "🤖 Claude Code 能力介绍"},
    "template": "blue"
  },
  "elements": [
    {"tag": "markdown", "content": "Hi,我是 **Claude Code**,一个 AI 编程助手。"},
    {"tag": "div", "text": {"tag": "lark_md", "content": "**💻 开发支持**\n• 代码编写、调试和重构\n• Bug 排查与修复"}},
    {"tag": "div", "text": {"tag": "lark_md", "content": "**📊 项目管理**\n• 飞书文档/多维表格操作\n• Git 提交、PR 创建"}},
    {"tag": "hr"},
    {"tag": "markdown", "content": "有任何需要,随时召唤我!"}
  ]
}

Task notification card

{
  "config": {"wide_screen_mode": true},
  "header": {
    "title": {"tag": "plain_text", "content": "📋 任务通知"},
    "template": "green"
  },
  "elements": [
    {"tag": "div", "fields": [
      {"is_short": true, "text": {"tag": "lark_md", "content": "**任务**\n部署上线"}},
      {"is_short": true, "text": {"tag": "lark_md", "content": "**状态**\n✅ 已完成"}}
    ]},
    {"tag": "hr"},
    {"tag": "markdown", "content": "详情请查看 [链接](https://example.com)"}
  ]
}

Notes

  1. Message frequency limit - A single user can receive at most 5 messages per minute
  2. Content length limit - The body of a card message must not exceed 30KB
  3. Images must be uploaded first - Use im/v1/images to upload and obtain the image_key
  4. Sensitive information - Do not include sensitive information such as passwords or tokens in messages

Related resources