Webhook
The Webhook connector lets you listen to events from your backend that supports webhooks. This connector is designed to be used with the Webhook trigger. The Webhook trigger receives events from third-party SaaS-based applications that support webhook eventing capability. This trigger supports multiple authentication types for your event listener. To use the Webhook trigger in your integration, you must first configure a Webhook connector.
Before you begin
Before using the Webhook connector, do the following tasks:
- In your Google Cloud project:
- Enable the following services:
secretmanager.googleapis.com
(Secret Manager API)connectors.googleapis.com
(Connectors API)
To understand how to enable services, see Enabling services.
- Grant the following IAM roles to the service account that you want to use for the connector:
roles/secretmanager.viewer
roles/secretmanager.secretAccessor
A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs. If you don't have a service account, you must create a service account. For more information, see Creating a service account.
If these services or permissions have not been enabled for your project previously, you are prompted to enable them when configuring the connector.
- Enable the following services:
Configure the connector
Configuring the connector requires you to create a connection to your data source (backend system). A connection is specific to a data source. It means that if you have many data sources, you must create a separate connection for each data source. To create a connection, do the following steps:
- In the Cloud console, go to the Integration Connectors > Connections page and then select or create a Google Cloud project.
- Click + Create new to open the Create Connection page.
- In the Location section, choose the location for the connection.
- Region: Select a location from the drop-down list.
For the list of all the supported regions, see Locations.
- Click Next.
- Region: Select a location from the drop-down list.
- In the Connection Details section, complete the following:
- Connector: Select Webhook from the drop down list of available Connectors.
- Connector version: Select the Connector version from the drop down list of available versions.
- Connection Name: Enter a name for the Connection instance.
Connection names must meet the following criteria:
- Connection names can use letters, numbers, or hyphens.
- Letters must be lower-case.
- Connection names must begin with a letter and end with a letter or number.
- Connection names cannot exceed 49 characters.
- For connectors that support event subscription, the connection names cannot begin with the "goog" prefix.
- Description: Optionally, enter a description for the connection instance.
- Service Account: Select a service account that has the required roles.
- Event Subscription: Event subscription will be enabled by default and is mandatory for webhook connector.
- Optionally, click + Add label to add a label to the Connection in the form of a key/value pair.
- Click Next.
-
In the Event Subscription Details section, complete the following:
- Listener Authentication: Select an authentication type for event listener and enter the relevant details.
The following authentication types are supported by the webhook listener:
- No Authentication
- Google Authentication: Ensure that the service account has roles/connectors.listener role whose access token is used for authentication.
- API Key Authentication
- Basic Authentication
- Event Type Field Location: Mandatory field which denotes the location (Header, Query Param or Request Body) where event type associated with the incoming event request will be present.
- Event Type Field Name: Mandatory field in the configured location identifies the type of event associated with the incoming event request.
- Select Enable private connectivity for secured connectivity between your backend application and your connection. If you select this option, you must perform additional configuration steps after creating the connection. For more information, see Private connectivity for event subscription.
- Enter the dead-letter configuration. If you configure dead-letter, the connection writes
the unprocessed events to the specified Pub/Sub topic. Enter the following details:
- Dead-letter project ID: The Google Cloud project ID where you have configured the dead-letter Pub/Sub topic.
- Dead-letter topic: The Pub/Sub topic where you want to write the details of the unprocessed event.
- Click Next.
In the example above, the event_type field in request body signifies that the request pertains to a "user.created" event.{ "event_type": "user.created", ... // other request fields ... }
- Listener Authentication: Select an authentication type for event listener and enter the relevant details.
- Review: Review your connection and listener authentication details.
- Click Create.
Use the Webhook connection in an integration
After you create the connection, it becomes available in both Apigee Integration and Application Integration. You can use the connection in an integration through the Connectors task.
- To understand how to create and use the Connectors task in Apigee Integration, see Connectors task.
- To understand how to create and use the Connectors task in Application Integration, see Connectors task.
Get help from the Google Cloud community
You can post your questions and discuss this connector in the Google Cloud community at Cloud Forums.What's next
- Understand how to suspend and resume a connection.
- Understand how to monitor connector usage.
- Understand how to view connector logs.