See the supported connectors for Application Integration.
API trigger
API triggers are used to directly invoke executions for integrations.
Configuring an API trigger in your integration enables you to do the following:
- Set request and response payload using trigger specific input and output variables.
- Generate and view the OpenAPI Specification (OAS) for your integration.
- Invoke an integration synchronously or asynchronously.
Add an API trigger
To add an API trigger to your integration, perform the following steps:- In the Google Cloud console, go to the Application Integration page.
- In the navigation menu, click Integrations
The Integrations List page appears listing all the integrations available in the Google Cloud project.
- Select an existing integration or click Create integration to create a new one.
If you are creating a new integration:
- Enter a name and description in the Create Integration pane.
- Select a region for the integration.
- Select a service account for the integration. You can change or update the service account details of an integration any time from the Integration summary pane in the integration toolbar.
- Click Create.
This opens the integration in the integration editor.
- In the integration editor navigation bar, click Triggers to view the list of available triggers.
- Click and place the API trigger element to the designer.
Configure an API trigger
To configure an API trigger, click the API trigger element in the integration editor. The API trigger configuration pane appears showing the following fields:
- Label: The visible name of the API trigger in your integration. You can change the label to a name of your choice.
- Notes: You can add notes to the API trigger to provide additional information about the trigger.
- Trigger ID: A unique ID that is assigned to the API trigger in the format
api_trigger/TRIGGER_NAME
. - Input variables: Trigger specific input variables that you can use to set the request payload for the API trigger.
- To add or remove existing integration variables to the API trigger, click Modify and select the required variables from the API trigger input variables pane.
- To add a new variable, specifically for the selected API trigger, click Modify and select + Add new variable from the API trigger input variables pane. For information about the supported data types, see Supported variable data types.
- Output variables: Trigger specific output variables that you can use to set the response payload for the API trigger.
- To add or remove existing integration variables to the API trigger, click Modify and select the required variables from the API trigger output variables pane.
- To add a new variable, specifically for the selected API trigger, click Modify and select + Add new variable from the API trigger output variables pane. For information about the supported data types, see Supported variable data types.
View OpenAPI Specification for your API trigger
Application Integration provides the ability to dynamically generate and view the OpenAPI Specifications of your published integrations that are configured with one or more API triggers. For information about how to view the OpenAPI Specification, see View OpenAPI Specification for your integration.
Invoke an API trigger using an API call
After you have published an integration that has an API trigger configured, you can use theprojects.locations.integrations.execute
method to invoke that trigger from any application. This method triggers the execution in the synchronous mode.
Syntax
curl -X POST \ -H "authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ -H "X-Server-Timeout: TIMEOUT_SECONDS" \ -d '{"trigger_id":"api_trigger/TRIGGER_NAME"}' \ "https://LOCATION-integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/-:execute"
Replace the following:
TIMEOUT_SECONDS
: The timeout in seconds for the API call. By default, the timeout is 120 seconds. For a list of pre-defined set of request parameters, see System parameters.TRIGGER_NAME
: The name of the API trigger in your integration.PROJECT_ID
: The ID of your Google Cloud project.LOCATION
: The location of your Google Cloud project.
Example
The following example invokes an integration in us-east1
region containing the test_API_1
API trigger in the demo-project
Google Cloud project:
curl -X POST \ -H "authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" \ -H "X-Server-Timeout: 300" -d '{"trigger_id":"api_trigger/test_API_1"}' \ "https://us-east1-integrations.googleapis.com/v1/projects/demo-project/locations/us-central1/integrations/-:execute"
Considerations
When using the API trigger, the cumulative size of all the input variables can be a maximum of 8 MB. If the size exceeds 8 MB, Application Integration doesn't run the integration and you will get an error.
Quotas and limits
For information about quotas and limits, see Quotas and limits.
What's next
- Learn about all tasks and triggers.
- Learn how to test and publish an integration.
- Learn about error handling.
- Learn about integration execution logs.