What Is Event Subscription
DingTalk event subscription is a service offered by the DingTalk Open Platform. It allows developers to receive various important notifications generated by the DingTalk platform in real time within their own apps. By setting up event subscriptions, your app can listen for events that occur in DingTalk, such as departmental structure changes, employee check-ins, and clock-ins, and respond to and process them promptly in your app. With this capability, your enterprise app can integrate more deeply with the DingTalk platform to achieve information sharing and business collaboration.Use Cases
Contacts Event Scenarios
When a new employee joins or an employee leaves, your app must update user data immediately. In this case, subscribe to Contacts-related events. Instead of periodically pulling and comparing Contacts data, you receive changed Contacts information in real time and synchronize it.Group Event Scenarios
To respond promptly to user actions in a group, subscribe to events. For example, when a user joins a group chat, your app can subscribe to the relevant events under IM Chat Management and send a welcome message to the user when they enter the group chat. For more events, refer to Event Subscription Overview.Subscription Methods
Subscription Rules
DingTalk event subscription lets you subscribe on demand. The specific rules are as follows.Syntax
Event subscription matching rules use Glob syntax for pattern matching. Glob is a matching method similar to regular expressions, but with more intuitive and simpler syntax. In Glob rules, you can use special characters such as*, ?, {}, and [] to define patterns. In DingTalk event custom filtering, only the * and {} characters are used to precisely filter events.
Note
If no rules are configured, or all configured rules are deleted, all events of that type are pushed.
- Single asterisk
*
/ or \. For example, /path/*/abc matches /path/a/abc, /path/b/abc, and so on.
-
Double asterisks
**Similar to a single asterisk, but it can cross path boundaries and is generally used to match multiple levels of directories. For example,/path/**/abccan match/eventkey/a/abc,/eventkey/b/abc,/eventkey/a/b/abc,/eventkey/a/b/c/abc, and so on. -
Curly braces
{}Curly braces specify a set of sub-pattern matches. For example,{sun,moon,stars}matchessun,moon, andstars, and{temp*, tmp*}matches any string that begins withtemportmp.
For related parameter information, refer to Approval Events.