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.
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.
The Integrations List page appears.
- Select an existing integration or create a new integration by clicking Create integration.
If you are creating a new integration:
- Enter a name and description in the Create Integration dialog.
- Select a Region for the integration from the list of supported regions.
- Click Create.
This opens the integration in the integration designer.
- In the integration designer navigation bar, click +Add a task/trigger > 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 designer 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 theintegrations.execute
method to invoke that trigger from any application.
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://REGIONAL_SERVICE_ENDPOINT/v1/projects/PROJECT_ID/locations/-/integrations/-:execute"
Replace the following:
- TRIGGER_NAME: The name of the API trigger in your integration.
- REGIONAL_SERVICE_ENDPOINT: An Application Integration service endpoint. For information about the available Application Integration service endpoints, see Application Integration Service endpoints.
- PROJECT_ID: The ID 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/-/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.