All Products
Search
Document Center

EventBridge:Automatically trigger an HTTP API operation when a new member is added in DingTalk

Last Updated:Dec 08, 2025

EventBridge integrates with the DingTalk connector. You can build various types of employee management systems using the request parameters of your business API operations. This topic describes how to send new employee onboarding data from DingTalk to a custom HTTP API operation without writing any code.

Process overview

This solution uses DingTalk, the DingTalk connector, EventBridge, and Function Compute. The following diagram shows the process.链路图

Prerequisites

You have completed the following operations:

Step 1: Create a custom event bus

  1. Log in to the EventBridge console and select a region from the top menu bar.
  2. In the navigation pane on the left, click Event Buses. In the Custom Event Buses section, click Quick Create.
  3. In the Create Custom Event Bus panel, complete the following steps.
    1. On the Bus tab, set Custom Event Bus Name and Description, and then click Next.
    2. On the Event Source tab, set Event Source Name and Description, configure the following parameters, and then click Next.
      ParameterValue
      Event ProviderHTTP/HTTPS Trigger
      Request TypeHTTPS
      Request MethodPOST
      Security ConfigurationNo configuration required
    3. On the Rule tab, click Skip. In the Create Custom Event Bus Directly dialog box, click Confirm to create the custom event bus without creating an event rule or an event target.
      DetailsPublic Request URLAfter the event source is created, find it in the event source list. Click to view its configuration. The is the webhook address for the DingTalk connector.pic-1

Step 2: Create a DingTalk connection stream

  1. Log on to the DingTalk Open Platform. In the top menu bar, choose .
  2. In the navigation pane on the left, choose .
  3. On the My Connection Streams page, click New and select Business Stream.
    1. In the Create Stream dialog box, enter a name and description for the business stream. Set Trigger to .
    2. On the Connection Stream tab, click the 添加 icon, and then click Network Request.
    3. In the Network Request section, click the 箭头 icon. In the Network Request panel, configure the request parameters and click Save.
      ParameterDescriptionExample
      Request MethodMust be the same as the request method configured in Step 1: Create a custom event bus.POST
      Request URLThe URL obtained in Step 1: Create a custom event bus.https://115964845466****.eventbridge.cn-hangzhou.aliyuncs.com/webhook/putEvents?token=8a5c4e6****
      BodyThe fields contained in the message body.root

Step 3: Use Function Compute to call the HTTP API

  1. Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.

  2. In the top navigation bar, select a region. On the Services page, click Create Service.

  3. In the Create Service panel, enter a service name and description, configure other parameters as required, and then click OK.
    Configuration ItemDescription
    Log FeatureSpecifies whether to enable Simple Log Service. Valid values:
    • Enable: The execution logs of the function are saved to Simple Log Service for persistence. This helps you debug code, analyze faults, and perform data analytics.
    • Disable: The execution logs of the function cannot be stored or queried through Simple Log Service.
    Advanced Configuration
    Tracing Analysis FeatureSpecifies whether to enable Tracing Analysis. Valid values:
    • Enable: You can use Jaeger to upload trace information to track function execution. This helps you quickly analyze and diagnose performance bottlenecks in a serverless architecture. For more information, see Introduction to Tracing Analysis.
    • Disable: The Tracing Analysis feature is not enabled.
    Service RoleConfigure the role used by the functions in the service. This grants the functions the permissions of the role. For more information, see Grant Function Compute permissions to access other Alibaba Cloud services.
    Allow Access To VPCSpecifies whether to allow the function to access resources in a VPC. For more information, see Configure a network.
    Virtual Private Cloud (VPC)Allow Access To VPC is set to Yes. Create a new VPC or select the ID of the VPC that you want to access from the drop-down list.
    VSwitchAllow Access To VPC is set to Yes. Create a new vSwitch or select a vSwitch ID from the drop-down list.
    Security GroupAllow Access To VPC is set to Yes. Create a new security group or select a security group from the drop-down list.
    Allow Function To Access The InternetSpecifies whether to allow the function to access the internet. If you disable this feature, functions in the current service cannot access the internet through the default network interface card of Function Compute.
    Important When you use a static public IP address, you must disable Allow Function To Access The Internet. Otherwise, the configured static public IP address does not take effect. For more information, see Configure a static public IP address.
  4. On the Services page, click the target service name, and then click Create Function.
  5. On the Create Function page, select a creation method, configure the following parameters, and then click Create.
    1. In the Basic Settings section, enter a function name and set Handler Type to Process HTTP Requests.
    2. In the Function Code section, set Runtime to Node.js, set Code Upload Method to Use Sample Code, and select the API Gateway Trigger Function sample code.
      创建函数
    After the function is created, you can view its details on the Function Details page.Function details

Step 4: Create an event rule

  1. Log on to the and navigate to the custom event bus that you created in Step 1: Create a custom event bus.
  2. Click the name of the custom event bus. In the navigation pane on the left, click Event Rules.
  3. On the Event Rules page, click Create Rule. In the Create Rule panel, configure the following parameters.
    1. On the Configure Basic Information tab, enter a Name and Description for the event rule, and then click Next.
    2. On the Configure Event Pattern tab, set Event Source Type to Custom Event Source, set Event Source to the custom event source that you created in Step 1: Create a custom event bus, and then click Next.
    3. On the Configure Event Target tab, set the following parameters, and then click Create.
      ParameterDescriptionExample
      Service TypeSelect the target service type.Function Compute
      ServiceSelect the service that you created in Step 3: Use Function Compute to call the HTTP API.testserver
      FunctionConfigure the function that you created in Step 3: Use Function Compute to call the HTTP API.testfunction
      EventSelect Complete Event.Complete Event
      Execution MethodSelect Sync.Sync

Step 5: Automatically trigger the HTTP API when a new employee is added

  1. Invite a member to join your DingTalk team. For more information, see How to add organization members.
  2. On the details page of the custom event bus that you created in Step 1: Create a custom event bus, click Event Trace. Set a time range and click Query.
  3. In the Operation column for the event, click Event Trace to confirm that the new employee event was successfully delivered.
    投递成功

Verify the result

Log on to the Function Compute console. On the details page of the function that you created in Step 3: Use Function Compute to call the HTTP API, click the Function Logs tab to view the execution logs.
日志