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
Log on to the Mobi platform and go to the console.
Navigate to Resources > Integration and click Create Integration.
Select DingTalk User Configuration and enter a name and description for the integration.
Configure the DingTalk user integration information for different environments, including the
appKeyandappSecret.Click OK to create the DingTalk user integration.
Step 2: Create an integration operation in an application
In the Code panel, click the plus sign (+) for the relevant scope, and then select Integration Operation.
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.
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.
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:
User ID: The ID of the user to query. You can view the user's UserID in the DingTalk console address book. For more information about the returned parameters, see 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
In the component where you want to trigger the integration operation, configure an event handler.
Set the action type to Integration Operation and select the corresponding integration.
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.