All Products
Search
Document Center

EventBridge:Trigger an HTTP API when a new member joins DingTalk

Last Updated:Mar 11, 2026

When a new employee joins your DingTalk team, you may need to sync that data to internal systems such as HR platforms, access provisioning tools, or notification services. EventBridge connects DingTalk to a custom HTTP API through a serverless pipeline, so new-member events flow automatically to your business endpoint without writing any code.

How it works

The integration connects four components in sequence:

  1. DingTalk detects a new member joining your team.

  2. The DingTalk connector forwards the event to an EventBridge webhook.

  3. EventBridge receives the event on a custom event bus and routes it through an event rule.

  4. The event rule triggers a Function Compute function that calls your HTTP API.

Process overview

Prerequisites

Before you begin, make sure that you have:

Step 1: Create a custom event bus

Create a custom event bus with an HTTPS event source. The event source generates a webhook URL that you use in Step 2 to connect DingTalk.

  1. Log in to the EventBridge console and select a region in the top menu bar.

  2. In the left-side navigation pane, click Event Buses. In the Custom Event Buses section, click Quick Create.

  3. In the Create Custom Event Bus panel, complete the following tabs:

    1. Bus: Enter a Custom Event Bus Name and Description, then click Next.

    2. Event Source: Enter an Event Source Name and Description, configure the following parameters, then click Next.

      ParameterValue
      Event ProviderHTTP/HTTPS Trigger
      Request TypeHTTPS
      Request MethodPOST
      Security ConfigurationNo configuration required
    3. Rule: Click Skip. In the Create Custom Event Bus Directly dialog box, click Confirm.

      This creates the event bus without an event rule or event target. You add those in Step 4.

  4. After creation, locate the event source in the list and click Details. Copy the Public Request URL. This is the webhook address for the DingTalk connector.

    Public Request URL on the event source details page

Step 2: Create a DingTalk connection stream

Set up a connection stream in DingTalk that forwards new-member events to the EventBridge webhook URL from Step 1.

  1. Log in to the DingTalk Open Platform.

  2. In the left-side navigation pane, choose My Connection Streams.

  3. Click New and select Business Stream.

  4. In the Create Stream dialog box, enter a name and description for the business stream. Set Trigger to the new member event trigger.

  5. On the Connection Stream tab, click the add icon, then click Network Request.

  6. In the Network Request panel, configure the following parameters, then click Save.

    ParameterDescriptionExample
    Request MethodMust match the method configured in Step 1.POST
    Request URLThe Public Request URL copied from Step 1.https://115964845466****.eventbridge.cn-hangzhou.aliyuncs.com/webhook/putEvents?token=8a5c4e6****
    BodyThe fields contained in the message body.root

Step 3: Set up a Function Compute function

Create a service and function in Function Compute to receive events from EventBridge and call your HTTP API.

Create a service

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

  2. Select a region in the top navigation bar. On the Services page, click Create Service.

  3. In the Create Service panel, enter a service name and description, configure advanced options as needed, then click OK.

    Advanced service configuration
    ParameterDescription
    Log FeatureEnable to save function execution logs to Simple Log Service for debugging and analytics. Disable to skip log persistence.
    Tracing Analysis FeatureEnable to upload trace information through Jaeger for performance analysis. See Introduction to Tracing Analysis.
    Service RoleThe role that grants functions the required permissions. See Grant Function Compute permissions to access other Alibaba Cloud services.
    Allow Access To VPCSet to Yes to allow the function to access resources in a Virtual Private Cloud (VPC). Then select or create a VPC, VSwitch, and Security Group. See Configure a network.
    Allow Function To Access The InternetSet to Yes to allow the function to access the internet.
    Important

    Disable this setting when using a static public IP address. See Configure a static public IP address.

Create a function

  1. On the Services page, click the service name, then click Create Function.

  2. On the Create Function page, configure the following settings:

    • In Basic Settings, enter a function name and set Handler Type to Process HTTP Requests.

    • In Function Code, set Runtime to Node.js, set Code Upload Method to Use Sample Code, and select API Gateway Trigger Function.

    Create Function page with sample code selected

  3. Click Create. The Function Details page opens.

    Function Details page

Step 4: Create an event rule

Connect the event bus to the Function Compute function by creating an event rule.

  1. In the EventBridge console, open the custom event bus created in Step 1.

  2. In the left-side navigation pane, click Event Rules, then click Create Rule.

  3. In the Create Rule panel, complete the following tabs:

    1. Configure Basic Information: Enter a Name and Description, then click Next.

    2. Configure Event Pattern: Set Event Source Type to Custom Event Source and Event Source to the event source created in Step 1, then click Next.

    3. Configure Event Target: Configure the following parameters, then click Create.

      ParameterDescriptionExample
      Service TypeThe target service type.Function Compute
      ServiceThe service created in Step 3.testserver
      FunctionThe function created in Step 3.testfunction
      EventThe event delivery mode.Complete Event
      Execution MethodThe invocation mode for the function.Sync

Step 5: Test the end-to-end flow

Trigger the pipeline by adding a new member to your DingTalk team, then verify that the event reaches Function Compute.

Trigger the event

Invite a new member to join your DingTalk team. For details, see How to add organization members.

Verify event delivery

  1. In the EventBridge console, open the custom event bus from Step 1 and click Event Trace.

  2. Set a time range and click Query.

  3. In the Operation column, click Event Trace to confirm the event was delivered.

    Event trace showing successful delivery

Verify function execution

  1. In the Function Compute console, open the function created in Step 3.

  2. Click the Function Logs tab to view the execution logs.

    Function execution logs

    The logs show the incoming event payload from DingTalk, confirming that the function received and processed the new-member event.

Clean up resources

If you no longer need the resources created in this tutorial, delete them to avoid ongoing charges:

  1. EventBridge: Delete the event rule, event source, and custom event bus.

  2. Function Compute: Delete the function and service.

  3. DingTalk: Delete the connection stream from the DingTalk Open Platform.

What's next

  • Customize the function code to parse the DingTalk event payload and call your business HTTP API with the employee data.

  • Add error handling and retry logic for production use.

  • Enable Simple Log Service to monitor event delivery and function execution.