Integrate an agent with WeCom
This topic describes how to connect an agent in AgentRun to WeCom. This integration allows you to interact with the agent in WeCom group chats or direct messages by mentioning (@) the bot.
Prerequisites
-
You have activated Function Compute and created an agent in AgentRun. For more information, see Quickly Create an Agent (Code-Free).
-
You have WeCom administrator permissions and can log in to the WeCom admin console.
Step 1: Create a WeCom bot
1. Create the bot and get credentials
-
Log in to the WeCom admin console.
-
In the left-side navigation pane, choose Security and Management > Management Tools. Find Intelligent Bot and click Create Bot.
-
In the dialog box that appears, click Create Manually.
-
Scroll to the bottom of the page and click Create in API Mode to switch the creation mode.
-
Configure the bot's visibility scope as needed. For the connection method, select Use long-lived connection and click Get Secret.
You will need the Bot ID and bot secret to configure the WeCom integration in AgentRun. Store them securely.
-
Click Save, enter a name and description for the bot, and then click OK.
Step 2: Configure WeCom integration
-
Log in to the AgentRun console.
-
Click the name of the desired agent to go to its details page.
-
Click the Integration and Publishing tab, click IM Integration, and then click Add IM Bot.
-
In the Add IM Bot panel, set Robot Mode to Standard Bot, set Select Platform to WeCom Bot, and then configure the following parameters:
Parameter
Description
Robot Name
Enter a display name for the bot. Maximum 128 characters.
Description
(Optional) Enter a description for the bot. Maximum 256 characters.
Robot Mode
Select Standard Bot to process messages using an Agent Endpoint.
Select Endpoint
Select a published Agent Endpoint. The bot uses this endpoint to process messages.
Select Protocol
Select a protocol specification for message processing. If one does not exist, click Add Protocol to create one, or click Refresh Protocol List to update.
WeCom Application ID
The WeCom bot application ID (AgentId) from Step 1. You can get it from the WeCom Developer Center.
WeCom Application Secret
The WeCom bot secret from Step 1.
Enable upon Creation
Selected by default. The bot starts running immediately after creation. If cleared, the bot is created in a stopped state and can be enabled later from the list.
-
Click Create Bot to complete the WeCom integration.
NoteAfter you enable the integration, AgentRun establishes a long-lived connection with WeCom, reserving a dedicated instance for this purpose. This instance incurs charges. For more information, see Billing Overview.
Step 3: Use the agent
After the configuration is complete, you can chat with the agent in WeCom group chats or direct messages.
Use in a group chat
-
In WeCom, create a new group chat or open an existing one.
-
In the group settings, add the bot that you created in Step 1.
-
In the group chat, @ the bot and enter your question.
Use in a direct message
In the WeCom search bar, search for the bot's name, open the chat window, and send a message to start a conversation.