All Products
Search
Document Center

:Best practices for building DingTalk connectors

Last Updated:Jan 12, 2024

This topic uses examples to demonstrate the strong security, HA, and lightweight application-to-application data interconnection scenarios built by using the DingTalk open platform based on Alibaba Cloud Function Compute and EventBridge. It helps official DingTalk applications, third-party applications, and enterprise-owned systems to implement event-driven data flows.

What is a DingTalk connector?

DingTalk application center contains many mini programs and H5 applications developed by independent software developers (ISVs). To better intercommunicate with other applications and internal systems of enterprises, a set of event-driven standard data models is required to solve the problems of customer application interconnection and business automation. Therefore, DingTalk connectors came into being.

image

Case studies

The following figure shows current DingTalk ISVs that uses the DingTalk connector. More ISVs are being developed.

xbongbongcrm

Take the Xbongbong CRM (a leading domestic enterprise mobile SaaS service provider) as an example. End users of the Xbongbong CRM need to synchronize incremental data such as customer changes, product changes, and contract changes to another SaaS application: BOSS accounting (an intelligent finance software). In this scenario, Xbongbong CRM is the trigger application, BOSS accounting is the execution application, and customer changes, product changes, contract changes, and other behaviors are trigger events.

The following figure shows the process.

image

Connectors are created by ISV application data providers. In this example, the provider is Xbongbong CRM. Xbongbong CRM sends its data to the connector, which is EventBridge. Enterprise users can create a connection (which is the rule of EventBridge) under this connector to synchronize data from Xbongbong CRM. Where exactly is the data synchronized? You can configure the execution action (that is, the EventBridge target) in the connection. The execution action here is the event receiving service for BOSS accounting. DingTalk ISVs can register execution actions on the platform in advance, or host the execution actions in Function Compute and connect them to the EventBridge through an HTTP trigger.

In an example scenario where Xbongbong CRM sends data to BOSS accounting, the customer and order data sent by Xbongbong CRM and customers and order data received by BOSS accounting adopt the same set of customer data model and order contract data model. Xbongbong CRM calls the connector event sending interface. The connector synchronously converts customer and order data into standard CloudEvents protocol data. This way, BOSS accounting only needs to complete simple format intercommunication when connecting data.

The following figure describes principles of Eventbridge:

image

Configure Function Compute to execute an action

Currently, DingTalk officially supports popular templates such as Xbongbong CRM, BOSS accounting, Douyuyun, Ekuaibao, Youcheng finance, Jinzhi CRM, and Antbim. Trigger events include customer changes, product changes, contract changes, and EKB-trigger events. Third-party service providers can access DingTalk cloud applications through the platform based on primary data standards. The access platform provides data conversion tools, which reduces the costs of registering service providers and using primary data.

Function Compute can be used as the execution action background service of self-built connectors, third-party connectors, and network applications. It can quickly help DingTalk the ISV service providers to build data conversion links for popular China Unicom applications, and even does not need to maintain any basic resources. It only needs to interconnect data format and higher-level custom business logic.

Perform the following steps:

  1. Log on to the DingTalk open platform.

  2. Create an application.

    Before developing internal applications, you must create an internal application and complete the basic configurations.

  3. Create a self-built connector.

    The connector is for the enterprise to use, and the corresponding data model and execution actions can be configured, such as Xbongbong CRM customer changes and other events.

    The following figure shows an example:custom_connector_fccustom_connector

  4. Create a custom application connection.

    An application connection consists of application trigger and application execution. The triggered application can be a self-built application or a third-party application. The execution application can be a self-built application, a third-party application, an enterprise internal application, or a robot. Enterprises can combine applications of different trigger events and executed applications to interconnect applications in different scenarios.

Configure Function Compute as the connector's destination address

At present, Function Compute has provided services for popular templates such as Xbongbong CRM, BOSS accounting, Douyuyun, Ekuaibao, Youcheng finance, Jinzhi CRM, and Antbim etc. It can also be used as an event trigger destination address of custom connectors to host the background code of DingTalk ISV service providers, thus realizing the automation and standardization of the whole process.

Debug the DingTalk connector

The ISVs convert data sending to EventBridge events, use the CloudEvents protocol to transfer data, and actively trigger the execution of a specific functions.

For more information, see the document about sending connector events.