Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Invoking an integration that contains an API Trigger

Former Community Member
Not applicable

From @thenajjar 

We are trying to integrate our backend with third party application, we are not sure how can we call the API_trigger? how can we link the API_trigger to a REST API endpoint. In the documentation it only explains how to test the API_trigger, but it does not explain how to edit the API_trigger to link it to an endpoint (so the API call will activate the trigger)

0 3 398
3 REPLIES 3

Former Community Member
Not applicable

This API is used to execute an API Trigger. Here is an example

export region=integration-region
export name=integration-name
export auth="authorization: Bearer $(gcloud auth application-default print-access-token)"

curl -H $auth -H "Content-Type: application/json" https://$region-integrations.googleapis.com/v1/projects/$project/locations/$region/integrations/$name:execute -d '{"triggerId":"api_trigger/ADD-TRIGGER-NAME-HERE","inputParameters":{}}'

@Former Community Member 

There is a need to move  triggerid/TriggerName into URL and keep -d only for inputs to the API.

Also it would be helpful to be able to generate a curl test command similar to above thru the "test" button itself for someone to run it remotely. 


@Former Community Member wrote:

ions/$nam


 

 

 

Thanks for the feedback!!  We can look at these suggestions to help inform our V2 of the APIs.  I also love the idea of generating the curl command from the TEST button.

Top Labels in this Space