You need to enable JavaScript to run this app.
DataAgent (OnPremise)

DataAgent (OnPremise)

Copy page
Download PDF
OA Applications Integration Practices
Lark Platform Agent Configuration and Testing
Copy page
Download PDF
Lark Platform Agent Configuration and Testing

This article explains how to configure the intelligent analysis Agent on the Lark platform.

Prerequisites
  • You have completed purchase activation, project creation, and data preparation.
  • To integrate the intelligent analysis Agent with the Lark application in a privatized environment, during deployment of the intelligent analysis Agent, contact the deployment and operations administrator to configure the Lark office platform as part of office platform integration. Once this is completed, you can then configure the Lark platform integration settings in the intelligent analysis Agent.

Image

Create an intelligent agent
  1. Create a new intelligent agent. Go to the configuration page of the intelligent analysis Agent . Click "Create intelligent agent" in the upper right corner to access the initial configuration page for the intelligent agent.

Image

  1. General configuration for intelligent agent. Configure basic information for the intelligent agent, including avatar, name, description, and administrator. After configuration, click "Save".

Image

  1. Obtain the callback address. Click and copy the "Lark callback address" below the intelligent agent name.

Image

Preparation for Lark platform

Step 1: Apply for a Lark bot

  1. Apply for a Lark bot. Go to the Lark open platform. To create a Lark bot, go to Lark open platform and select "Create enterprise self-built application".

Image

  1. Create an enterprise self-built application.
    • In the pop-up window to create an enterprise self-built application, enter the application name, description, and icon. The application name here will correspond to the intelligent agent name that users search for on Lark later.

Image

  • After entering the information, click "Create" to create an application.

Image

  1. Add bot capabilities to the created application. First, go to the application's configuration page. Then, go to "Add application capabilities" on the left and select "Bot".

Image

  1. Add the required permissions for the bot**.** To enable normal interaction for the bot, you need to add certain permissions for the bot. You can find "Permission management" under "Development configuration" on the left. In Permission management, select "Batch import/export permissions," check the box, and enable permissions in bulk.

Image

The permissions that need to be enabled are as follows:

Image
Image

Users can directly copy the code below and then paste it in the permission import section:

{
  "scopes": {
    "tenant": [
      "admin:app.info:readonly",
      "application:application:self_manage",
      "contact:contact.base:readonly",
      "contact:user.employee_id:readonly",
      "contact:user.id:readonly",
      "im:chat:read",
      "im:chat:update",
      "im:message.group_at_msg:readonly",
      "im:message.group_msg",
      "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_depts",
      "im:message:send_multi_users",
      "im:message:update",
      "im:resource",
      "im:user_agent:read"
    ],
    "user": [
      "contact:user.employee_id:readonly",
      "contact:user.id:readonly",
      "drive:drive.metadata:readonly",
      "drive:drive:version",
      "drive:drive:version:readonly",
      "im:chat:read",
      "im:message:readonly",
      "im:message:update"
    ]
  }
}

tip

  • If the agent is a group chat agent:
    Please add "im:chat:read" and "im:message.group_at_msg:readonly" in "tenant". Do not add im:message.group_msg, otherwise it will respond to all messages in the group.
  • To use the download data to Lark feature:
    Please add "drive:drive.metadata:readonly" and "drive:drive" in "user".
  1. After configuring the permissions, publish the Lark bot**.** Once you have filled in the required permissions for the bot, you can publish the bot by creating a version and publishing it on the "Version management and publishing" page. The version number, description, and other information, and the reason for application can be filled in as needed.

Image

warning

Before proceeding to the next step, you must first publish the enterprise application; otherwise, you cannot continue to the next step.

Step 2: Create a new agent and associate it with the bot

  1. Configure the request address for the bot**.** Return to the Lark bot page created in the previous step, and paste the copied callback address into the request address fields of "Event configuration" and "Callback configuration" on the Lark bot's "Events and callbacks" page.

Image

warning

  • Both event configuration and callback configuration need to be added.
  1. Configure events for the bot. After filling in the address, you also need to add events for both the event and callback configurations.
    • The event configuration requires adding: im.message.receive_v1, p2p_chat_create
    • The callback configuration requires adding: card.action.trigger_v1
  2. Publish the bot. After completing the previous steps, you can publish the bot by creating a version and publishing it on the "Version management and publishing" page. The version number, description, and other information can be filled in as needed.
    Image

    warning

    Before proceeding to the next step, you must first publish the enterprise application; otherwise, you cannot continue to the next step.

  3. Obtain the App ID and App Secret of the Lark bot. After publishing the Lark bot, return to the bot's configuration page and copy the App ID and App Secret separately from the "Credentials and basic information" page.
    Image
  4. (Optional) Configure encryption policy.
    • When the agent is used for external scenarios or special cases where request content needs to be encrypted, you can choose to configure an encryption policy for the agent; if the agent is only for internal company users, configuration is generally not required.

Image

Step 3: How to add members for the agent

  1. Add members entry point.
    • The available members of the agent are the available members of the bound robot. Therefore, you need the Lark Open Platform.
  2. Add members. Edit the available members of the robot. After searching for users, simply check the box to select them. Do not select "All members".
    Image
  3. Save and publish. After adding, save and publish. Note that it will only take effect after publishing.
    Image

warning

In addition to being added as available members, users of the agent must also have at least view permission for the dataset currently bound to the agent in order to use the agent properly.

Agent Lark endpoint configuration
  1. Enable the Lark endpoint. Go to the configuration page of the previously created agent, find "Lark endpoint configuration" under "Basic information", and select "Enable Lark endpoint".

Image

  1. Add the agent. Enter the App ID and App Secret of the Lark robot in the basic settings for Lark. Click "Save" in the upper right corner. The agent will then be associated with the Lark robot. See Step 2: Create a new agent and associate it with the bot for how to obtain.

Image

  1. (Optional) Configure encryption strategy. Fill in "Encryption type" and "Verification code" on the agent configuration page, then save. See Step 2: Create a new agent and associate it with the bot for how to obtain.

Image

  1. Add a dataset to the agent. After configuration, click "Publish". The agent will appear in the list of published agents.

Image

  1. Click "Publish" to publish the agent.

Image

Using the agent on the Lark endpoint

warning

After configuration, the Lark-side agent can also be used directly through the web interface.

For agents on the Lark endpoint, after publishing, you can search for the agent name in Lark and click to use it.

Last updated: 2026.06.02 14:59:27