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 0 38
0 REPLIES 0