Skip to main content

Slack

Slack is a channel-based collaboration platform designed to replace email as the primary way teams communicate and share files. It organizes conversations into threads and channels, allowing users to message colleagues in real-time while integrating with various workplace productivity tools.

Files.com can post notifications to Slack when actions occur in certain folders in your Files.com account. This lets anyone in a particular Slack channel know when files in the target folder are uploaded, downloaded, changed, copied, or moved.

Overview of Slack Integrations

Automatically sending messages to Slack from Files.com requires a Slack workspace administrator to create a custom app in your Slack workspace.

The custom app accepts incoming webhooks for a Slack channel that receives alerts. Each app can support multiple incoming webhooks, and each Slack channel's incoming webhook is unique.

Once the custom Slack app is configured for your Slack workspace, you can add a Slack Notification within your Files.com site.

When you create a Slack Notification in your Files.com site, you provide the URL of the incoming webhook for the Slack channel where messages will appear. Because each webhook URL is tied to 1 channel and each Slack Notification has 1 URL it sends messages to, a Slack Notification in Files.com sends messages to exactly 1 channel in your Slack workspace.

What Is Included in Slack Messages from Files.com

Each Slack message sent by a Files.com Slack Notification includes the information that is available for the activity.

For file uploads, changes, downloads, deletes, the message will include the file's path, the username of the person who did it, and the size of the file. When a folder is created or deleted, no size is included for the folder itself, but each file in the folder is also reported with its size.

For copies and moves, the message includes the original path and the new path along with the username of the person who did it. File copies and moves include the size of the file. Moving a file or folder to a new name without changing the parent path shows up in Slack messages as Rename.

When a site-wide API key is used for the activity, no username is included because no user is associated with the activity.

When an Automation or Sync performs the activity, a temporary username representing the Automation or Sync is shown in the message.

Timing of Slack Messages from Files.com

Slack Notifications send messages to your Slack channels within seconds of the folder activity completing. Once the activity has happened, your site does not add any delay before sending the messages.

Configure a Slack App for Incoming Webhooks

A Slack workspace administrator must create the new custom Slack app in the Slack workspace.

After authentication, visit https://api.slack.com/appsExternal LinkThis link leads to an external website and will open in a new tab. Add a new custom app and select From scratch to create a completely blank app with no enabled features. Supply an App Name, which will be displayed in the Slack messages that are generated by the integration.

After you create the app, access its basic setup, including credentials and display options at https://api.slack.com/apps/YOUR_APP_ID. Replace YOUR_APP_ID with the App ID shown on the page about your app. Customize the App icon, if desired.

Enable the Incoming Webhooks Feature for your app. Visit https://api.slack.com/apps/YOUR_APP_ID/incoming-webhooks? to activate incoming webhooks for your app. Add a new Webhook for each Slack channel where your app will post messages. An incoming webhook can post to only 1 channel. Note each Webhook URL and which Slack channel it maps to because it's needed for configuring the Slack Notification in your Files.com site.

Once you have the incoming webhook URL for the channel you want to notify, configuration on the Slack workspace is complete. No other features need to be enabled or configured for the custom app.

Treat your incoming webhook URL like secret information. Anyone who learns the URL can post messages to your Slack channel.

Test Your Incoming Webhook for Slack

You can verify that your incoming webhook is correctly configured using cURL to send a test message directly to the webhook. Replace YOUR_WEBHOOK_URL in the code below with your incoming webhook URL. If a message "Hello, World!" appears in your Slack channel, the setup is correct in your Slack workspace.

curl -X POST -H 'Content-type: application/json' 
 --data '{"text":"Hello, World!"}' YOUR_WEBHOOK_URL

Add the Slack Integration in Files.com

Now that you have an incoming webhook URL in your Slack workspace, you can complete the setup in your Files.com site. You must have administrator permissions for the folder to manage its Slack Notifications.

Create a new Slack Notification and supply the Webhook URL, which determines the Slack channel that receives messages from the Slack Notification.

You must choose which folder's activity will generate messages for the Slack Notification.

By default, activity in the folder and its subfolders is included; you can change this to only activity directly in the selected folder. Activity that happens in a mounted folder within your notification's folder will not generate messages if it occurs outside of the Files.com platform.

Messages will be sent regardless of the type of file activity by default. You can instead choose which types of activities generate messages. You can choose any combination of Create, Read, Update, Delete, Move or Copy.

There is no waiting period after enabling the Slack Notification in your Files.com site; any matching activity will immediately generate messages in the matching Slack channel.

Slack Notification Rate Limits

The rate limit for Slack apps using incoming webhooks is generally 1 message per second per channelExternal LinkThis link leads to an external website and will open in a new tab. Slack is primarily a communication tool for humans, so Slack allows for infrequent "burst" that can exceed the rate limit.

A Slack Notification tied to a folder with extreme activity might exceed Slack's rate limiting threshold. Files.com cannot send "digest" messages to combine multiple operations in a single message, so operating on many files at once will generate many messages. When the activity exceeds Slack's rate limits, messages to the Slack channel indicate that the limit has been exceeded.

Common Failure Patterns

When a Slack Notification stops sending messages to your Slack channel, there are common things to check.

Send a test message directly to the webhook URL. If the message appears, your Slack configuration is correct, and the problem lies with your Slack Notification in Files.com.

If the test message did not appear, check for configuration issues in Slack:

If the test message appears in your Slack channel, check the settings on your Slack Notification and make sure that the correct folder scope (just the folder vs the folder tree) and the list of selected file operations is correct. Check that the History listing for your folder shows activity that should have triggered the Slack Notification.