DingTalk Bot
The DingTalk bot lets users call AIvis from DingTalk conversations. Prefer Stream mode: save the DingTalk Client ID and Client Secret in the AIvis bot configuration page, add the bot capability and event subscription in DingTalk, and receive messages through the long-lived stream connection.
Treat it as a governed entry point before rollout. It should only respond to approved sources, only use knowledge and tools available to the current user, group, or bound Agent, and keep each response traceable.
Use Cases
Management Boundary
Before Configuration
Before configuration, confirm:
- You can access the DingTalk Developer Platform and create internal apps or publish app versions.
- The AIvis DingTalk bot configuration page is open and ready for
Client ID,Client Secret, and connection mode. - The groups, departments, members, workspace, default Agent, and knowledge scope the bot may serve are defined.
- You plan to use
Streammode. DingTalk HTTP callbacks are sensitive to response latency and usually need a response in about 1.5 seconds, soStreamis the safer default.
Client Secretis sensitive. Store it only in protected configuration. Do not put real secrets in public docs, Agent instructions, screenshots, tickets, or chat messages.
Create the DingTalk App
Open the DingTalk Developer Platform, go to the internal app list, click create app, and fill in the app name, description, icon, and other basic information. Keep the app name aligned with the AIvis bot display name so administrators and members can identify it.

After creation, open the app detail page and confirm it belongs to the expected organization before continuing with credentials, bot capability, and release.
Configure App Credentials
Copy Client ID and Client Secret from the DingTalk app detail page. Return to the AIvis bot configuration page, fill them into client ID and client secret, and confirm the connection mode is Stream.


Configuration notes:
Client IDandClient Secretmust come from the same DingTalk app.- Do not put an enterprise ID, bot name, user ID, or phone number into the Client ID field.
- If
Client Secretis regenerated, update the AIvis configuration as well. - If the AIvis page says the value is already saved and you are not changing the secret, the secret field can remain empty.
Add the Bot Capability
In the DingTalk Developer Platform, click add app capability and add the bot capability.

Open the bot configuration page, set the message receive mode to Stream, then save and publish the bot configuration.

If DingTalk indicates the bot configuration has not been published, DingTalk may not deliver messages even when the AIvis credentials are saved.
Configure Event Subscription
When adding an event subscription, use Stream mode and keep it consistent with the AIvis connection mode. After completing the setup, click the connection-complete action, validate the connection channel, and save after validation passes.

Event subscription and app release are separate checks. If the event subscription is saved but the version is not released, or the version is released but Stream validation fails, the bot may not receive messages.
Create and Release a Version
Open version management, submit the latest version, and publish it. After release, confirm:
- The version status is normal or published.
- The bot capability is included in the released version.
- The availability scope is expected, such as selected members, departments, or the target organization.
- There are no unpublished changes left.

Test the DingTalk Bot
Before testing, confirm in AIvis:
- The bot is enabled.
- The connection mode is
Stream. Client IDandClient Secretare saved.- The bound Agent, knowledge scope, and tool scope match the test scenario.
- DingTalk bot capability, event subscription, and app version are saved and released.
Then search for the bot in DingTalk, open the conversation, and send a test message. When configuration is correct, the bot should receive the message and reply. Actual latency depends on network, model calls, and backend processing.


Validate Access Boundaries
After the basic reply test, validate governance boundaries:
- Send an allowed question as an authorized member and confirm the bot returns the expected answer.
- Test an unauthorized member, unauthorized group, or a question requiring an inaccessible document set, and confirm sensitive data is not returned.
- Confirm tracing or request logs include source platform, user context, bound Agent, response result, and errors.
- After changing
Client Secret, connection mode, event subscription, bot capability, or availability scope, release a new DingTalk version and test again.
Troubleshooting
Security and Maintenance
- Store real secrets only in the AIvis configuration page. Do not write them into docs, screenshots, tickets, chat records, or repositories.
- If a secret may have leaked, regenerate it in DingTalk and update AIvis immediately.
- Request permissions with the smallest usable scope. Do not enable contacts, approval, or management permissions for a message-only bot.
- When the bot is no longer needed, disable it in AIvis first, then remove permissions or take the DingTalk app version offline.
- In production, record every DingTalk app release time, releaser, change summary, and validation result.
Related Pages
- Agents explains how to configure Agents the bot can call.
- Users, Groups & Roles explains how access boundaries apply to members and groups.
- Tracing explains how to audit bot requests.
- DingTalk Knowledge Connector explains how to index DingTalk knowledge.