You can use event rules to filter events and route events to DingTalk. This topic describes the prerequisites and procedure for routing custom events to DingTalk. This topic also describes how to verify the result.
Prerequisites
- EventBridge is activated, and a RAM user is granted the required permissions on EventBridge.
- DingTalk is downloaded.
- A custom chatbot is added.Important When you add a custom chatbot, you must select Additional Signature for Security Settings.
Background information
The DingTalk chatbot can push the following types of messages:- Message of the text type
- Message of the link type
- Message of the Markdown type
- Message of the single redirect actionCard type
- Message of the multi-redirect actionCard type
- Message of the feedCard type
Step 1: Create a custom event source
- Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.
- In the top navigation bar, select a region. On the Event Buses page, click the name of the custom event bus that you want to manage.
- In the left-side navigation pane, click Event Sources, and then click Add Event Source.
- In the Add Custom Event Source panel, set the Name and Description parameters, select Custom Application from the Event Provider drop-down list, and then click OK.
Step 2: Create an event rule
Important The event targets that you want to configure for an event rule must reside in the same region as the event rule.
- Log on to the EventBridge console.
- In the left-side navigation pane, click Event Buses.
- In the top navigation bar, select the region.
- On the Event Buses page, click the name of the event bus that you want to manage.
- In the left-side navigation pane, click Event Rules.
- On the Event Rules page, click Create Rule.
- Complete the Create Rule wizard.
Step 3: Publish an event
- Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.
- In the top navigation bar, select a region.
- On the Event Buses page, find the event bus to which you want to publish an event and click Publish Event in the Operations column. Note You can publish events only to custom event buses in the EventBridge console.
- In the Publish Event to Custom Event Bus panel, select a custom event source from the Custom Event Source drop-down list, enter the event content in the Event Body code editor, and then click OK. For more information about the event parameters, see Overview.
Verify the result
View the message that is pushed by the DingTalk chatbot on DingTalk.