Slack Files Upload

Description

The Slack Files Upload Action Component allows you to post messages and files to a Slack channel specified in the component's properties using the Slack API. It is useful for debugging actions and notifying people. It can also be used to send messages to #channels and @people.

actioncomponent-slackfileupload-1
Output PayloadDescription
cv.PayloadOutputs the previous component's output payload as-is (pass-through)

Component Properties

Property NameDescription
File NameSpecify the file to send along with the message. For how to specify the file name, refer to File Path Handling
TitleSpecify the title of the file
ChannelSpecify the Slack channel. You can specify #channels @people and the channel ID
CommentSpecify the message text you want to send
TimeoutSpecify the message send timeout duration
TokenSpecify the User OAuth Token set in Slack

How to Set Up the Slack API

Create a new app from the Slack API site.

slack1b

Specify this User OAuth Token in the Token property of the component.

Select OAuth & Permissions from the Features menu.

slack2b

Add the required scopes to Scopes.

If you are sending files, chat:write:bot and files:write:bot are essential.

If you are specifying #channels or @people in a Slack channel, also add channels:read, groups:read, im:read, and users:read.

Once added, the Install App to Workspace button will become clickable at OAuth Tokens & Redirect URLs, allowing you to install the app (grant permissions). Once granted, the OAuth Access Token token will become available for use.