Integrate with DingTalk Calendar

更新时间:
复制 MD 格式

The Mobi platform offers powerful integration with DingTalk Calendar. With simple configurations, you can seamlessly connect to the DingTalk Calendar service and exchange data. This document describes how to create and use this integration.

Features

The DingTalk Calendar integration on the Mobi platform supports the following features:

  • Custom trigger methods: Integration operations can be triggered manually or run automatically to suit various business needs.

  • Callbacks and data transformation: Configure callbacks to trigger specific events when a query succeeds or fails. You can also transform the returned data as needed.

  • Advanced settings: Use advanced configurations, such as debouncing and conditional execution, to optimize operation performance.

For more information about events, see Integration operation events.

Using the DingTalk Calendar integration

Step 1: Create a DingTalk Calendar 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 Calendar Configuration and enter a name and description for the integration.

  4. Configure the DingTalk Calendar integration details for different environments, including the appKey and appSecret.

  5. Click OK to create the DingTalk Calendar integration.

Step 2: Create an integration operation within the application

  1. Open the Code panel, click + in the relevant scope, and select Integration Operation.

  2. Select the previously created DingTalk Calendar integration as the resource. Choose an operation type, fill in the parameters as needed, and select a trigger method. You can also add more detailed configurations.

  3. Click Run to preview the query results.

Configuration panel details

Integration configuration

  • appKey and appSecret: These are the access credentials from the DingTalk developer platform. You can find the application's Client ID (formerly the internal app's AppKey) and Client Secret (formerly the internal app's AppSecret) in the developer console. For more information, see Obtain the accessToken for an internal application.

Important

Ensure your application has read and write permission for the calendar. For more information about adding application permissions, see Add API permissions.

General configurations

  • Create event:

    • Organizer: The unionId of the event organizer. The unionId is a unique identifier for a user within an application. You can obtain a user's unionId by querying their details using their user ID through the DingTalk user integration. For more information about using the DingTalk user integration, see Integrate with DingTalk users.

    • Attendees: An array of attendee unionIds. The format is [{"id":"unionId_of_user1"},{"id":"unionId_of_user2"}] image

    • Title: The event title.

    • Start time: The event start time in ISO-8601 date-time format. For example, `2025-08-25T17:30:08+08:00`.

    • End time: The event end time in ISO-8601 date-time format. For example, `2025-08-25T17:30:08+08:00`.

  • Update event:

    • Organizer: The unionId of the event organizer. The unionId is a unique identifier for a user within an application. You can obtain a user's unionId by querying their details using their user ID through the DingTalk user integration. For more information about using the DingTalk user integration, see Integrate with DingTalk users.

    • Event Id: The identifier for the event. This is returned when you create an event or query a list of events.

    • Attendees: An array of attendee unionIds. The format is [{"id":"unionId_of_user1"},{"id":"unionId_of_user2"}] image

    • Title: The event title.

    • Start time: The event start time in ISO-8601 date-time format. For example, `2025-08-25T17:30:08+08:00`.

    • End time: The event end time in ISO-8601 date-time format. For example, `2025-08-25T17:30:08+08:00`.

  • Delete event:

    • Organizer: The unionId of the event organizer. The unionId is a unique identifier for a user within an application. You can obtain a user's unionId by querying their details using their user ID through the DingTalk user integration. For more information about using the DingTalk user integration, see Integrate with DingTalk users.

    • Event Id: The identifier for the event. This is returned when you create an event or query a list of events.

  • Query single event details:

    • Organizer: The unionId of the event organizer. The unionId is a unique identifier for a user within an application. You can obtain a user's unionId by querying their details using their user ID through the DingTalk user integration. For more information about using the DingTalk user integration, see Integrate with DingTalk users.

    • Event Id: The identifier for the event. This is returned when you create an event or query a list of events.

  • Query event list:

    • Organizer: The unionId of the event organizer. The unionId is a unique identifier for a user within an application. You can obtain a user's unionId by querying their details using their user ID through the DingTalk user integration. For more information about using the DingTalk user integration, see Integrate with DingTalk users.

    • Minimum time: The minimum start time for events, in ISO-8601 date-time format. For example, `2025-08-25T17:30:08+08:00`.

    • Maximum time: The maximum start time for events, in ISO-8601 date-time format. For example, `2025-08-25T17:30:08+08:00`.

    • Show deleted events: Specifies whether to include canceled or deleted events in the results. The default value is `false`.

    • Maximum count: The maximum number of events to return. The maximum value is 100. The default value is 100.

    • Paging cursor: The token for the next page of results. If a query cannot return all results in a single response, it provides a paging token. To retrieve the next page of data, include this token in your subsequent query. A `null` token indicates that all data has been retrieved.

Callback configuration

  • Data transformation: Processes the data returned by the API. The default value, return data, indicates that the data is returned without any processing.

  • Stream reception callback: Configures the event that triggers when chunk data is retrieved from a streaming API call.

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

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

Advanced configuration

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

  • Conditional execution: Determines whether to run this integration operation based on a conditional expression.

Manually trigger the integration

Event trigger

  1. In the component that will trigger the integration operation, configure an event handler.

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

  3. Enter the required parameters as an object.

API trigger

If the integration operation is named action1, you can trigger it by calling the action1.trigger() method from any location where scripts can run. If the operation requires parameters, provide them as an object.