st2 --version
st2 3.1.0, on Python 3.6.9
Rules YAML file:
name: “notify_slack”
pack: “examples”
description: “Send to Slack.”
enabled: true
trigger:
type: “core.st2.webhook”
parameters:
url: “notify”
action:
ref: “chatops.post_message”
parameters:
message: “{{trigger}}”
channel: “automation”
CURL Command:
curl -k -X POST https:///api/v1/webhooks/notify -H "X-Auth-Token: " -H “Content-Tye: application/json” --data ‘{“msg”: “Hi”}’
Slack Bot Output:
{‘headers’: {‘Host’: , ‘X-Real-Ip’: , ‘X-Forwarded-For’: , ‘Content-Length’: ‘68’, ‘User-Agent’:
‘curl/7.52.1’, ‘Accept’: ‘/’, ‘X-Auth-Token’: , ‘Content-Tye’: ‘application/json’,
‘Content-Type’: ‘application/x-www-form-urlencoded’, ‘X-Request-Id’: }, ‘body’: {}}