DingTalk

View as Markdown

The DingTalk connector brings approved DingTalk Wiki nodes, individual DingTalk documents, and DingDrive folders into AIvis retrieval. It reads only the scopes explicitly entered by an administrator and does not scan every DingTalk object visible to the app or operator account.

Use cases

ScenarioRecommendation
Team Wiki Q&AUse workspace_id/parent_node_id for the smallest approved Wiki subtree.
Single policy or project documentUse the document dentry_uuid instead of granting a whole Wiki tree.
DingDrive materialUse space_id/parent_id for one approved folder, then validate file type and size.
Multi-department knowledgeSplit connectors by department or business audience.
Sensitive contentUse a dedicated DingTalk app and operator UnionId instead of a broad shared app.

What it indexes

DingTalk dataScope formatIndexing behavior
Wiki subtreeworkspace_id/parent_node_idReads the selected Wiki node hierarchy and native document content.
Single documentdentry_uuidParses the document body as an independent page.
DingDrive folderspace_id/parent_idReads supported files under the selected folder and keeps folder hierarchy.

The connector supports at most 100 total scopes and rejects duplicate or overlapping scopes. It does not index DingTalk chats, tasks, approvals, calendars, contacts, or resources that were not explicitly listed.

Prerequisites

  • Create an internal DingTalk app and prepare its AppKey and AppSecret.
  • Identify an operator UnionId that can read the approved resources. Do not enter a userId, phone number, email, or display name.
  • Grant the app the required read-only API permissions and resource authorization.
  • Collect the exact Wiki, document, or DingDrive scope IDs to index.
  • Decide the AIvis access group before indexing private content.
  • Allow the AIvis backend to reach api.dingtalk.com and authorized DingDrive downloads.

DingTalk API permissions, resource authorization, and app availability are separate checks. A valid credential does not prove that every target Wiki, document, or folder has been authorized to the app.

Where to get configuration values

Configuration valueWhere to get it
AppKey / AppSecretOpen the internal app in the DingTalk developer console and check the app’s basic information or credential page. See DingTalk developer tutorial: create an app and view Client ID / Client Secret.
Access token and credential validationDingTalk exchanges app credentials for an Access Token. See DingTalk developer guide: get an app Access Token.
Operator UnionIdGet it from an authorized operator identity API, enterprise address-book tooling, or your internal identity mapping. Confirm it is not a userId, phone number, or email.
Wiki, document, and DingDrive scope IDsConfirm them from the resource URL, resource admin page, or related Open API response. If the field source is unclear, search the DingTalk Open Platform docs for workspace_id, dentry_uuid, space_id, or parent_id.
API permission and resource authorizationEnable the required read-only API permissions in the DingTalk Open Platform, then authorize the target Wiki, document, or DingDrive folder to the app.

Configure in AIvis

In the Admin panel, open Connectors, select DingTalk, create or choose a DingTalk credential, and then enter the explicit scopes to index.

FieldHow to fill itNotes
AppKeyInternal app AppKeyUsed to request DingTalk access tokens.
AppSecretAppSecret from the same appStored as a protected secret.
Operator UnionIdFor example unionid_xxxRepresents the user used for resource reads.
DingTalk Wiki root scopesOne workspace_id/parent_node_id per lineIndexes explicit Wiki subtrees.
DingTalk document IDsOne dentry_uuid per lineIndexes explicit documents.
DingDrive folder scopesOne space_id/parent_id per lineIndexes explicit folders.

Enter at least one scope type. Start with a minimal test scope, validate search results, then expand.

Sync behavior

The standard Admin-created DingTalk connector runs as a polling connector with checkpoint resume. It processes scopes in order, builds a stable inventory for each scope, and emits hierarchy nodes and documents from that inventory.

StageBehavior
WikiReads the selected root’s node tree and exports native document content.
Single documentParses the target dentry_uuid directly.
DingDrive filesEmits supported files from the selected folder; unsupported files are recorded as item failures.
Incremental windowItems outside the sync time window are skipped. Configuration changes invalidate the previous checkpoint fingerprint.

Permissions

The DingTalk app and operator UnionId determine what AIvis can ingest, but this connector does not synchronize DingTalk departments, groups, document members, or DingDrive ACLs into AIvis.

AIvis access settingMeaning
Private groupsOnly selected AIvis groups can search documents produced by this connector. Recommended for internal Wiki and project material.
PublicEvery eligible AIvis user can search indexed content. Use only for content that can be shared with that audience.
Auto permission syncDingTalk is not supported for this mode.

Use AIvis Private groups for internal or project content. Use Public only when every eligible AIvis user may search every indexed result. DingTalk is not available as an auto permission-sync source.

Verify

  1. Create a connector with one test Wiki node, document, or DingDrive folder.
  2. Run indexing and confirm token acquisition and scope validation pass.
  3. Search known titles, body text, and file names.
  4. Search resources outside the configured scopes and confirm they are absent.
  5. Test both an assigned AIvis group member and an outside user.
  6. Modify a test document and confirm the next sync updates the result.

Troubleshooting

SymptomWhat to check
Credential validation failsAppKey and AppSecret must belong to the same enabled DingTalk app.
Scope validation failsCheck ID format, resource authorization, and whether the operator UnionId can read the resource.
API permission exists but resource is unreadableVerify resource-level authorization and operator access.
Only part of the content is syncedCheck omitted, duplicate, overlapping, or over-limit scopes.
DingDrive files are missingCheck supported file type, size, and backend download reachability.
Users can search content they should not seeRestrict AIvis access groups or split the connector by audience.

Security and maintenance

  • Use separate DingTalk apps and secrets for production, test, and demo environments.
  • Store real secrets only in protected AIvis credential fields.
  • Review scopes, operator UnionId, app permissions, resource authorization, and AIvis access groups regularly.
  • Rotate credentials or replace the operator if ownership changes or a secret may have leaked.
  • Disable the connector before removing DingTalk permissions for retired scopes.

Official references