In this article
Table of Contents | ||||
---|---|---|---|---|
|
Overview
Use this Snap to upload and share one or more files with a user/group/channel either directly or as a reply to a thread.
Prerequisites
- A valid and active account in the Slack Workspace.
Slack Scopes required
Any action you want to perform within a Slack Workspace, additionally needs appropriate Scopes assigned to your app. See Scopes for more information.
To | Bot Token Accounts | User Token Accounts ( user_scope ) |
---|---|---|
To upload, edit, and delete files | files:write |
|
View lists of channels and users to select from | users:read | users:read |
Support for Ultra Pipelines
Capture if Ultra Mode is supported. If the Snap requires certain configurations to support Ultra mention those as well.
Works in Ultra Pipelines.
Limitations
Snaps in this Snap Pack use conditional display/hiding of fields. So, ensure that you always use the New Form UI (and not the classic UI) for the Snaps to function as designed/expected.
Known Issues
None.
Snap Input and Output
Input/Output | Type of View | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| A document containing information and paths of one or more files to upload to Slack and the recipient user/channel details. |
Output | Document |
|
| A document containing the success / failure status of each file uploaded. |
Snap Settings
Parameter Name | Data Type | Description | Default Value | Example | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Label | String |
| Upload File | Upload File | ||||||||
File | String/Expression | Required. Enter the file name or its path including the file name to upload the file. See File Types for a generic list of file extensions that the upload operation supports. | N/A | car.jpeg, D:/My_Pipeline.slp | ||||||||
Channels | String/Expression/Suggestion | Select a channel from the suggested values. To add more channels, enter comma-separated values manually in one of the following formats:
| N/A | #testprivate:G019B3ETYMB | ||||||||
Users | String/Expression/Suggestion | Select a recipient from the suggested values. To add more recipients, enter comma-separated values manually in the format:
| N/A | @user.name:W01A94P7MK1 | ||||||||
File Type | String/Expression | Provide a brief description of the file and its format (extension). | N/A | jpeg | ||||||||
Initial Comment | String/Expression | Add any comments related to the file to be uploaded. | N/A | Here is the doc I was talking about. | ||||||||
Timestamp (if thread reply) | String/Expression | To upload the file in reply to a message or a message in a thread, provide the timestamp of the corresponding message. This timestamp must correspond to a message in the channel or the direct conversations with the users, as specified above. | N/A | 1601469028.000100 | ||||||||
Title | String/Expression | Enter the file name with extension in this field. It is displayed along with the uploaded file, in the Slack message. If no value is provided in this field, Slack defaults the value to the file name excluding its file extension. | N/A | car.jpeg | ||||||||
Snap Execution | Drop-down list | Select one of the three following modes in which the Snap executes:
| Execute only | Validate & Execute |
Troubleshooting
Error | Reason | Resolution |
---|---|---|
IO error while performing the operation | File not found on elastic.snaplogic.com at /api/1/rest/.../Slack_SnapPack/filename.extn | Ensure the token and the inputs are valid, and try again; contact support team if the problem persists. |
Failure: Unable to create an interim channel for the given list of users. | user_not_found | Ensure the token and the inputs are valid, and try again; contact support team if the problem persists. |
Failure: Error uploading file | missing_scope | Ensure the token and the inputs are valid, and try again; contact support team if the problem persists. |
Failure: Auth error | No user token present in the OAuth2 response | Ensure your OAuth2 app is configured correctly, and try authorizing account again. |
Failure: Error uploading file | invalid_channel | Ensure the token and the inputs are valid, and try again; contact support team if the problem persists. |
Examples
Uploading and Deleting Files using Slack Snap Pack
This example demonstrates how we can use the Upload File Snap to share files with one or more recipients. To delete a file that you have sent to another Slack user/Channel/private group, you need to use the Delete File Snap to pass the id of the file to be deleted. The same can be done for multiple files, at once.
In this example, we use the Upload File Snap to upload and share a file with members of a Channel.
...
The file is deleted and the result of this operation is displayed in the Snap output.
Downloads
Note | ||
---|---|---|
| ||
|
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
...