diff --git a/content/en/docs/cli/entities/triggers/_index.md b/content/en/docs/cli/entities/triggers/_index.md index c98a9e05..85d25544 100644 --- a/content/en/docs/cli/entities/triggers/_index.md +++ b/content/en/docs/cli/entities/triggers/_index.md @@ -65,6 +65,39 @@ In this example, whenever a user visits either the homepage or the contact page, the "SendSlackNotification" action will be triggered, resulting in a Slack notification being sent. +### Step 3: Firing your triggers + +Triggers can be fired in two different ways: + +- With the CLI: + + ```sh + ops trigger fire + ``` + +- With the API: + + ```sh + curl -u $AUTH https://{API_HOST}/api/v1/namespaces/{namespace}/triggers/{triggerName} + ``` + + `API_HOST` is your Openwhisk url (`ops debug apihost`), `namespace` can be `_` to + use your default namespace, and `triggerName` is obviously the trigger name. + + So if you create a trigger with name `event`, and you host on openserverless.dev, + the URL to fire it would be: + + ```sh + https://openserverless.dev/api/v1/namespaces/_/triggers/event + ``` + + See more details in the [REST API docs](/docs/reference/references/rest_api/_index.md#triggers). + +> ⚠️ **WARN** +> +> Unfortunately, at the moment both options require authentication, which prevents +> triggers from being used as simple web hooks. + ## Conclusion Triggers provide a flexible and scalable way to automate workflows based