Set up Webhook Event Notification

This topic describes how to set up webhook event notifications, so that third-party applications can get real-time notifications for specific events occur on Yeastar Workplace.

Prerequisites

Step1. Set up a webhook on Yeastar Workplace

  1. Log in to Yeastar Workplace admin portal, go to Integration > API.
  2. Click Settings beside API.
  3. In the pop-up window, configure the webhook:

    1. In the Callback URI field, enter the Webhook URL obtained from the third-party application.
    2. Optional: Click Test to check if the webhook is working properly.

      The third-party application will receive a "WEBHOOK_TEST" event.

    3. Click Save.

Step2. Subscribe to desired events

After seting up a webhook, you need to send an event subscription API request to subscribe to specific event(s). In this way, Yeastar Workplace can proactively send notifications to the third-party application when the subscribed event occurs.
  1. Check the desired event type(s) in Webhook event types.
  2. Compose an event subscription API request in the following format, then send the request.
    Note: If you want to subscribe to all webhook events, set the eventTypes parameter to ALL. For more information, see Event Subscription API.
    POST {base_url}/services/openapi/v1.0/integration/subscribe
    Authorization: Bearer {access_token}
    Content-Type: application/json
    {
        "eventTypes": [ "eventType1","eventType2",...]
    }
    The event subscription request is sent to the predefined callback URI.

Result

When a subscribed event occurs, Yeastar Workplace sends a notification to the predefined callback URI (namely the Webhook URL of the third-party application), informing the third-party application of the event in real time.