Slack

Description

Post messages to Slack

Component key: slack

Actions

Slack Message

Post a message to a Slack channel

Action key: postSlackMessage

Inputs

KeyTypeDefaultRequiredComments
messageSTRINGNoneTrueMessage to send the slack channel.
webhookUrlSTRINGNoneTrueSlack Webhook URL in the form https://hooks.slack.com/services/FOO/BAR/BAZ
# Post 'Hello, Slack' to a slack channel using a Slack webhook
SLACK_ACTION_ID=$(prism components:actions:list --filter 'key=postSlackMessage' --columns id --no-header)
INPUTS='[
{
"name": "webhookUrl",
"expression": "'"'"'https://hooks.slack.com/services/FOO/BAR/BAZ'"'"'"
},
{
"name": "message",
"expression": "'"'"'Hello, Slack!'"'"'"
}
]'
prism integrations:steps:add ${SLACK_ACTION_ID} \
--integration ${INTEGRATION_ID} \
--inputs ${INPUTS}

Generate a webhook URL

In order to use the Slack component, you will need to generate a webhook:

  1. Navigate to https://api.slack.com/apps
  2. Click Create New App, adding an app to your workspace.
  3. Under Add features and functionality select Incoming Webhooks
  4. Activate Incoming Webhooks and then Add New Webhook to Workspace
  5. Take note of the Webhook URL. It should be of the form https://hooks.slack.com/services/foo/bar/baz
Last updated on