This document will describe in detail how to create a Feishu bot app and connect it to the Dora platform for user mappings.
Dora Version
Functional Change
V0.7
/
V1.4
Supported card interaction.
In an intranet environment, whitelist the following domain names in advance on the server where the FineBI service and Data Agent service are deployed to ensure normal service access:
open.feishu.cn
open.larksuite.com
Access Feishu Developer Console and create a custom enterprise app.
After app creation, go to the app capability configuration page, choose Add Features > By Feature, and add the Bot and Web app capabilities.
For the bot to have the basic functions of sending and receiving messages, choose Development Configuration > Permissions & Scopes and configure related permissions either by adding them in batches or manually adding them one by one. The following describes how to add them.
(1) Adding Them in Batches
Import permissions in batches using the following code:
{ "scopes": { "tenant": [ "cardkit:card:write", "contact:contact.base:readonly", "contact:user.base:readonly", "contact:user.department:readonly", "contact:user.employee_id:readonly", "im:app_feed_card:write", "im:message", "im:message.group_at_msg:readonly", "im:message.p2p_msg:readonly", "im:message:readonly", "im:message:send_as_bot", "im:message:send_sys_msg", "im:message:update", "im:resource", "cardkit:card:write" ], "user": [] }}
(2) Manually Adding Them
Configure the following permissions for the bot:
Get basic information in contacts
Obtain user's organization information
Obtain user's basic information
Obtain user ID
Create, update, and delete app feed card
Get direct messages sent to bot
Read direct messages and group chat messages
Send messages as an app
Send specified template system message
Update message
Read and send direct messages and group chat messages
Receive users' mentions
Create and update card
Read and upload images or other files
Choose Events and Callbacks > Event Configuration and add the Message received event for the bot.
Choose Events and Callbacks > Callback Configuration and add Card callback communication for the bot.
Add the PC and mobile access URLs of your enterprise's deployed Dora to Desktop homepage and Mobile homepage, respectively.
Choose Security Settings > H5 trusted domains and add the egress IP address of the Dora service.
After completing the above configuration, click Create Version, go to Version Management & Release, and save and publish the bot app of the current version.
If the app is not created by a Feishu administrator, you must apply to the Feishu administrator for online publication.
After the app is successfully published, choose Basic Info > Credentials & Basic Info and copy the app ID and app secret.
Log in to the Dora platform as the super administrator, choose User Management > IM User Mapping, and enter the app ID and app secret obtained from the above operations into the App Connection area for the Feishu bot app to complete the connection and user mapping between Feishu and the Dora platform.
After completing all the above steps, you are advised to test and confirm network connectivity:
(1) The Dora server can access open.feishu.cn normally. If a proxy or privatized address is configured in the backend, the Dora server must be able to access the corresponding proxy or privatized address.
(2) The mobile device must be able to access the public CDN (lf1-cdn-tos.bytegoofy.com) of the Feishu JSSDK. Dora will load this capability when users tap the sharing button. Currently, Feishu sharing is not available in environments with strictly restricted networks or private Feishu deployments.
(3) The card's summary and image are generated by the Feishu server fetching the sharing link. If the sharing link is an intranet address, the shared card will display only the title.