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

Sample payload for Integration API trigger with input variables

I have a use-case where I need to pass an input parameter(partyName) to my Integration flow which has an API trigger (SendResultEmail_API_1). I have the below CURL command to test the integration from Cloud shell.

curl -X POST -H "authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -d '{"trigger_id":"api_trigger/SendResultEmail_API_1", "partyName":"sample-name-1"}' "https://asia-east1-integrations.googleapis.com/v1/projects/<project-id>/locations/-/integrations/-:execute"

The variable partyName is defined as an input variable in the Integration. 

When I run the above command, I am seeing the error below - 

sudershan1903_0-1679299780181.png

 

When I run the command without the input parameter value, I'm able to get the response from Integration. I'm assuming the issue is with the way I'm passing the value as input for the Integration.

Would be great if I could get a sample payload for the input for the Integration, also comments on any issues with the command

Solved Solved
1 2 597
1 ACCEPTED SOLUTION

Hey Sudershan ! 

Here is the same curl: 

curl -X POST -H "Content-Type: application/json" -d '{"trigger_id":"api_trigger/trigger_id", "inputParameters": {"partyName": {"stringValue": "sample_string"}}}' 'https://region-integrations.googleapis.com/v1/projects/project/locations/-/integrations/integrationName:execute' -H "Authorization: Bearer $(gcloud auth print-access-token)"

You can find more details on the API here. Let us know if above works for you. 

View solution in original post

2 REPLIES 2

Hey Sudershan ! 

Here is the same curl: 

curl -X POST -H "Content-Type: application/json" -d '{"trigger_id":"api_trigger/trigger_id", "inputParameters": {"partyName": {"stringValue": "sample_string"}}}' 'https://region-integrations.googleapis.com/v1/projects/project/locations/-/integrations/integrationName:execute' -H "Authorization: Bearer $(gcloud auth print-access-token)"

You can find more details on the API here. Let us know if above works for you. 

Hey @vsy ! Worked like a magic. Thanks for the sharing the documentation.

Top Labels in this Space