To call an API trigger end point from an external application as a webhook

As per the documentation, I need to call the end point with access token in the header. 

curl -X POST \
    -H "authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    -d '{"trigger_id":"api_trigger/TRIGGER_NAME"}' \
    "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/-:execute"

The external application does not have access to GCP it actually calls the API once an event is fired. Is there a way to get the access token through API call. It would be better If APIGee gateway can be used so that external services does not need to call the API Trigger altogether.

0 1 55
1 REPLY 1

Hello Ritwik ! 

You can use Apigee proxy with Integration as the target. It has been documented here: 

 
The above works in https://apigee.google.com/ UI ; Google console Apigee PAYG users, can use apigeecli command like this: 
apigeecli apis create integration -i <integration-name> -n <proxy-name> --trigger <trigger-id> -o <project> -t <token>
 
Alternatively if you app which is calling Application Integration does not depend on the response from your integration you can use Webhook trigger.

Let me know if you need any more details.