Slack Notification Webhook avatar
Slack Notification Webhook
Try for free

No credit card required

View all Actors
Slack Notification Webhook

Slack Notification Webhook

tlinhart/slack-notification-webhook
Try for free

No credit card required

This actor is supposed to be run via webhooks to send Slack notifications about other actor/task's events.

Slack notification actor

This actor is supposed to be run via webhooks to send Slack notifications about other actor/task's events.

Slack setup

This actor uses Incoming Webhooks for sending the messages. Refer to this article for the setup process.

Using the actor

To start getting notifications for an actor (or task) create a new webhook for that actor (or task). As a webhook URL, use:

https://api.apify.com/v2/acts/tlinhart~slack-notification-webhook/runs?token=<APIFY_TOKEN>

where APIFY_TOKEN is your Apify API token. You can find the token on the Integrations page in the Apify console. You can also add other parameters supported by the Run actor endpoint to the URL, such as timeout and memory. Select events for which you would like to receive notifications. Update the default webhook payload template with slackWebhookUrl and optionally slackWebhookArguments to override the defaults (see default-webhook-args.json):

1{
2    "slackWebhookUrl": "https://hooks.slack.com/services/TXXXXX/BXXXXX/XXXXX",
3    "slackWebhookArguments": { ... },
4    "userId": {{userId}},
5    "createdAt": {{createdAt}},
6    "eventType": {{eventType}},
7    "eventData": {{eventData}},
8    "resource": {{resource}}
9}

The slackWebhookArguments parameter supports most of the arguments supported by the Node Slack SDK, namely:

  • channel
  • username
  • iconEmoji
  • iconUrl
  • text
  • blocks
  • attachments
  • linkNames
  • unfurlLinks
  • unfurlMedia

To make the message format more flexible and customizable, all the string values support JavaScript-like string interpolation. The variables that are available for interpolation are those provided by the Apify platform in the default payload template and also variables provided by this actor:

  • actor – object returned by the Get actor endpoint
  • task – object returned by the Get task endpoint
  • runLog – actor run log returned by the Get log endpoint

By default, the message contains information about the actor (and the task if available) and its run together with the last 15 lines of the run log.

Default message format

Developer
Maintained by Community
Actor metrics
  • 1 monthly users
  • 100.0% runs succeeded
  • Created in Sep 2021
  • Modified about 1 month ago
Categories