Integrate DingTalk users

更新时间:
复制 MD 格式

The Mobi platform provides powerful integration with DingTalk. This feature lets you seamlessly connect to DingTalk user services and exchange data through simple configurations. This topic describes how to create and use DingTalk user integrations.

Function introduction

The DingTalk user integration feature on the Mobi platform supports the following capabilities:

  • Custom trigger methods: You can set integration operations to be triggered manually or run automatically for different business scenarios.

  • Callbacks and data transformation: You can execute specific integration events when a query succeeds or fails and process returned data with custom transformations.

  • Advanced settings: You can use advanced configurations for debouncing and conditional execution to optimize integration operations.

For more information about events, see Integration operation events.

Use DingTalk user integration

Step 1: Create a DingTalk user integration

  1. Log on to the Mobi platform and go to the console.

  2. Navigate to Resources > Integration and click Create Integration.

  3. Select DingTalk User Configuration and enter a name and description for the integration.

  4. Configure the DingTalk user integration information for different environments, including the appKey and appSecret.

  5. Click OK to create the DingTalk user integration.

Step 2: Create an integration operation in an application

  1. In the Code panel, click the plus sign (+) for the relevant scope, and then select Integration Operation.

  2. Select the DingTalk user integration that you created as the resource. Select an operation type, enter the required parameters, and select a trigger method for the integration operation. You can also add more detailed configurations.

  1. Click Run to preview the query results.

Configuration panel details

Integration configuration

  • appKey and appSecret: These are the access credentials for the DingTalk developer platform. In the developer console, locate your application's Client ID (formerly the AppKey for internal corporate applications) and Client Secret (formerly the AppSecret for internal corporate applications). For more information, see Obtain the accessToken for an internal application.

Important

Ensure that your application has permission to read member information. For more information about how to add application permissions, see Add API call permissions.

General configurations

  • Query user details:

  • Retrieve user ID by unionId:

    • unionId: The unionId of the user to query.

Callback configuration

  • Data transformation: Processes the data returned by the API. The default is return data, which means no processing is performed.

  • Streaming receive callback: Configures the event that is triggered when chunk data is retrieved from a streaming API call.

  • Success callback: Configures the event that is triggered when the API call is successful.

  • Failure callback: Configures the event that is triggered when the API call fails.

Advanced configuration

  • Debounce: Sets a debounce expression to prevent frequent API calls.

  • Execution prevention condition: Uses a conditional expression to determine whether to execute this integration operation.

Manually trigger an integration

Event trigger

  1. In the component where you want to trigger the integration operation, configure an event handler.

  2. Set the action type to Integration Operation and select the corresponding integration.

  3. Enter the configured parameters as an object.

API trigger

If the integration operation is named action1, you can use the action1.trigger() method to trigger it anywhere a script can run. If the operation has parameters, you must enter them as an object.