1> My integration has an input variable and am not sure how to provide that, the article gives the curl as below : I changed the dummy stuff with the new one and actually it hits the integration but the input variable is not passed. So the question is what is the syntax to pass the input variable?
2> For the authorization header, I passed it like Bearer value, where this value I got via using gcloud sdk shell by first activating a Service account and then manually running gcloud auth print-access-token and then copied that token and put it in value above. But this is a manual process and I need to know that is there a way where this token can be generated via a gcp API call or some other better automated way?
3> The API trigger I believe just triggers the flow, is it possible to make the complete flow synchronous and return the final flow response(preferably a json) to the postman initial call(Trigger call)?
To generate an access token via a GCP API call, you can use the following steps:
Install the Google Cloud SDK.
Authenticate with the Google Cloud SDK using the following command:
gcloud auth login
Set the project ID that you want to use:
gcloud config set project PROJECT_ID
Generate an access token using the following command:
gcloud auth print-access-token
Copy the access token and use it in the Authorization header of your Postman request.
It is not possible to make the complete flow synchronous and return the final flow response to the Postman initial call. API triggers are asynchronous, meaning that they trigger the flow without waiting for it to finish. This allows the flow to run in the background without blocking the Postman request.
But I looked into it further and understood that the way you suggested is for V2 version of the API and I am using V1 so that is why it did not worked for me but it is the right way for V2 so thanks for providing it. I will use your way when I switch to V2 of the API.
=============================Bearer Token==============================
For the auth token the provided steps are via gcloud and I also did the same thing but this is manual way and my question was around some way to do it via Rest API call(some kind of token generation api) to generate a token against a service account. If it is possible can you please pass the curl?
==============================Synchronous==============================
I figured that actually the API trigger are Synchronous in nature: Source
You are correct. When you invoke the API Trigger, you can specify whether it is Async or Sync. If you use the Sync option, it will return a response to the client and you can specify which variables you want to send back in the response payload by checking the box “Use as an Output variable” on the variable’s detailed configuration. The integrations/execute API is Synchronous. The integrations/schedule API is Asynchronous.
Here is a sample curl command from this tutorial that shows the payload structure you must use for v1…looks like you beat me to it and figured this out already! Nicely done… Note the “inputParameters” property, and you have to specify the data type of the parameter (see: “string_value” property followed by the actual value) :
As suggested I went through the schedule API and found exactly what I was looking for, specially the capability of executing the flow immediately(by passing past same day scheduleTime) or at a scheduled future time makes it more favorable for my scenario.
For the bearer token, I am well aware of how to generate it via GCLOUD commands but what am looking for is how to get that bearer token against a service account without using GCLOUD commands. If it is at all feasible then please help in guiding me.