Feishu configuration

Updated at:

This article describes how to create a Feishu custom app bot, enable app permissions, obtain application credentials, and configure the Feishu channel in the Quick BI AIPro management center. For the overall process of channel integration, see Channel Management.

Prerequisites

  • You must have a Feishu account with permissions to create apps in the Feishu Developer Console.

Create Feishu app

  1. Go to the Feishu Developer Console at https://open.feishu.cn/app and sign in with a Feishu account that has app creation permissions.

    飞书开发者后台首页的创建企业自建应用入口

  2. Click Create Custom App.

  3. Enter the following information.

    Parameter

    Value

    Description

    App name

    A custom name

    For example: AIPro Data Analyst

    App description

    A brief description of the app's purpose

    —

    App icon

    Upload an icon as needed

    —

    创建企业自建应用的名称、描述、图标填写弹窗

  4. After you enter the information, click Create. Feishu then directs you to the app details page.

    创建成功后进入的应用详情页

Add bot

On the app details page, in the Add Features section, find the Bot card and click Add.

应用详情页添加应用能力区域中的机器人卡片

Configure app permissions

To allow the bot to send and receive messages and process conversations, you must import the following permissions for the app.

  1. In the left navigation pane of the app details page, click Permissions & Scopes to open the permissions page.

    应用详情页左侧菜单中的权限管理入口

  2. Click Bulk-import/export permissions. In the dialog box that appears, clear the sample content from the input field, and then copy and paste the entire list of permissions below.

    {
      "scopes": {
        "tenant": [
          "contact:contact.base:readonly",
          "docx:document:readonly",
          "im:chat:read",
          "im:chat:update",
          "im:message.group_at_msg:readonly",
          "im:message.p2p_msg:readonly",
          "im:message.pins:read",
          "im:message.pins:write_only",
          "im:message.reactions:read",
          "im:message.reactions:write_only",
          "im:message:readonly",
          "im:message:recall",
          "im:message:send_as_bot",
          "im:message:send_multi_users",
          "im:message:send_sys_msg",
          "im:message:update",
          "im:resource",
          "application:application:self_manage",
          "cardkit:card:write",
          "cardkit:card:read"
        ],
        "user": [
          "contact:user.employee_id:readonly",
          "offline_access",
          "base:app:copy",
          "base:field:create",
          "base:field:delete",
          "base:field:read",
          "base:field:update",
          "base:record:create",
          "base:record:delete",
          "base:record:retrieve",
          "base:record:update",
          "base:table:create",
          "base:table:delete",
          "base:table:read",
          "base:table:update",
          "base:view:read",
          "base:view:write_only",
          "base:app:create",
          "base:app:update",
          "base:app:read",
          "board:whiteboard:node:create",
          "board:whiteboard:node:read",
          "calendar:calendar:read",
          "calendar:calendar.event:create",
          "calendar:calendar.event:delete",
          "calendar:calendar.event:read",
          "calendar:calendar.event:reply",
          "calendar:calendar.event:update",
          "calendar:calendar.free_busy:read",
          "contact:contact.base:readonly",
          "contact:user.base:readonly",
          "contact:user:search",
          "docs:document.comment:create",
          "docs:document.comment:read",
          "docs:document.comment:update",
          "docs:document.media:download",
          "docs:document:copy",
          "docx:document:create",
          "docx:document:readonly",
          "docx:document:write_only",
          "drive:drive.metadata:readonly",
          "drive:file:download",
          "drive:file:upload",
          "im:chat.members:read",
          "im:chat:read",
          "im:message",
          "im:message.group_msg:get_as_user",
          "im:message.p2p_msg:get_as_user",
          "im:message:readonly",
          "search:docs:read",
          "search:message",
          "space:document:delete",
          "space:document:move",
          "space:document:retrieve",
          "task:comment:read",
          "task:comment:write",
          "task:task:read",
          "task:task:write",
          "task:task:writeonly",
          "task:tasklist:read",
          "task:tasklist:write",
          "wiki:node:copy",
          "wiki:node:create",
          "wiki:node:move",
          "wiki:node:read",
          "wiki:node:retrieve",
          "wiki:space:read",
          "wiki:space:retrieve",
          "wiki:space:write_only"
        ]
      }
    }

    批量导入权限弹窗中粘贴权限列表

  3. Click Next, confirm the new permissions.

    确认新增权限弹窗中的权限列表

  4. Click Next, configure the accessible range.

    配置可访问范围中的数据范围设置

  5. Click Confirm and activate.

Application credentials

  1. In the left navigation pane of the app details page, click Credentials & Basic Info.

  2. Note the following credentials. You will need them later when you configure the Feishu channel in AIPro.

    Credential

    Description

    App ID

    The Feishu app's credential ID.

    App Secret

    The secret paired with the App ID.

凭证与基本信息页面中的 APP ID 与 APP Secret

Note
  • The App Secret is sensitive information. Do not share it in chats or public channels.

  • Keep this page open. You must return to the Feishu Developer Console later to configure events and callbacks.

Configure the Feishu channel

  1. Go to the Quick BI AIPro management center, and click Channel Management at the top.

  2. Find the Feishu channel and click it.

  3. Enter the App ID and App Secret that you obtained in the previous step.

管理中心频道管理中飞书渠道的配置面板

Configure event subscription

  1. Return to the app details page in the Feishu Developer Console, and in the left navigation pane, click Events & Callbacks.

  2. Click Event Configuration and edit the Subscription Method.

  3. Select Use WebSocket to receive events and click Verify. After the connection succeeds, click Save.

    事件配置中选择长链接接收事件的订阅方式

  4. After you save, click Add Event in the lower-left corner. Search for the Receive Message event and add it.

    添加事件面板中搜索并添加接收消息事件

Configure callback settings

  1. On the Events & Callbacks page, click Callback Configuration and edit the subscription method.

  2. Select Use WebSocket to receive callbacks and click Verify Link. After the connection succeeds, click Save.

    回调配置中选择长连接接收回调的订阅方式

  3. After you save, click Add Callback. In the configuration panel that appears, search for card callback and click Add.

    添加回调面板中搜索并添加卡片回传回调

Release app

Important

You must release the app before the bot can be used.

  1. At the top of the app details page, click Create Version and enter the version number and update notes.

    应用详情页面顶部的创建版本入口

    创建版本页面中的版本号与更新说明填写项

  2. Set Availability to All Members.

    创建版本页面中可用范围设置为全部成员

  3. Click Save, and in the dialog box, click Apply for Online Release.

  4. Wait for an administrator to approve the request. If you are an administrator, sign in to the Feishu Admin Console at https://odpahs7juw.feishu.cn/admin/index to approve it directly.

    申请线上发布后的管理员审核界面

Related tasks

  • Channel Management: Check the integration status of the Feishu channel, edit its configuration, or unbind the channel in the Quick BI AIPro management center.

  • Channels: Enables organization members to bind their instant messaging (IM) accounts and use AIPro in Feishu.

  • DingTalk Configuration Guide: Instructions for integrating the DingTalk channel.