See the supported connectors for Application Integration.
API trigger
API triggers are used to directly invoke executions for integrations. API triggers can be used in synchronous or asynchronous mode.
You can set the request and response payload for the API trigger by creating variables in your integration. For information about how to create an integration with an API trigger that receives API requests for retrieving customer information, see the API fulfillment tutorial.
Add an API trigger
To add an API trigger trigger, 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
Click the API trigger element in the integration editor to view the trigger configuration pane.
The configuration panel displays the Trigger ID, which is a
machine-generated ID in the format api_trigger/TRIGGER_NAME
.
No further configuration is required for this trigger.
Invoke API trigger from an application
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" \ -d '{"trigger_id":"api_trigger/TRIGGER_NAME"}' \ "https://LOCATION-integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/-:execute"
Replace the following:
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" \ -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.