Slack v0.9.0 Slack.Web.Files
Summary
Functions
Add a comment to an existing file
Deletes an existing comment on a file
Edit an existing file comment
Deletes a file
Gets information about a team file
Lists & filters team files
Revokes public/external sharing access for a file
Enables a file for public/external sharing
Uploads or creates a file
Functions
Add a comment to an existing file.
Required Params
comment
- Text of the comment to add. ex:Everyone should take a moment to read this file.
file
- File to add a comment to. ex:F1234567890
Errors the API can return:
file_deleted
- The requested file was previously deleted.file_not_found
- The requested file could not be found.no_comment
- Thecomment
field was empty.
Deletes an existing comment on a file.
Required Params
file
- File to delete a comment from. ex:F1234567890
id
- The comment to delete. ex:Fc1234567890
Errors the API can return:
cant_delete
- The requested comment could not be deleted.file_deleted
- The requested file was previously deleted.file_not_found
- The requested file could not be found.
Edit an existing file comment.
Required Params
comment
- Text of the comment to edit. ex:Everyone should take a moment to read this file, seriously.
file
- File containing the comment to edit. ex:F1234567890
id
- The comment to edit. ex:Fc1234567890
Errors the API can return:
cant_edit
- The requested file could not be found.edit_window_closed
- The timeframe for editing the comment has expired.file_deleted
- The requested file was previously deleted.file_not_found
- The requested file could not be found.no_comment
- Thecomment
field was empty.
Deletes a file.
Required Params
file
- ID of file to delete.
Errors the API can return:
cant_delete_file
- Authenticated user does not have permission to delete this file.file_deleted
- The file has already been deleted.file_not_found
- The file does not exist, or is not visible to the calling user.
Gets information about a team file.
Required Params
file
- Specify a file by providing its ID. ex:F2147483862
Errors the API can return:
file_deleted
- The requested file has been deletedfile_not_found
- Value passed forfile
was invalid
Lists & filters team files.
Optional Params
channel
- Filter files appearing in a specific channel, indicated by its ID.ts_from
- Filter files created after this timestamp (inclusive). ex:123456789
ts_to
- Filter files created before this timestamp (inclusive). ex:123456789
types
- Filter files by type:all
- All filesposts
- Postssnippets
- Snippetsimages
- Image filesgdocs
- Google docszips
- Zip filespdfs
- PDF files
You can pass multiple values in the types argument, like types=posts,snippets
.The default value is all
, which does not filter the list. ex: images
user
- Filter files created by a single user.
Errors the API can return:
unknown_type
- Value passed fortypes
was invaliduser_not_found
- Value passed foruser
was invalid
Revokes public/external sharing access for a file
Required Params
file
- File to revoke
Errors the API can return:
file_not_found
- Value passed forfile
was invalid
Uploads or creates a file.
Required Params
file
- File contents viamultipart/form-data
. ex:...
filename
- Filename of file. ex:foo.txt
Optional Params
channels
- Comma-separated list of channel names or IDs where the file will be shared.content
- File contents via a POST var. ex:...
filetype
- Slack-internal file type identifier. ex:php
initial_comment
- Initial comment to add to file. ex:Best!
title
- Title of file. ex:My File
Errors the API can return:
invalid_channel
- One or more channels supplied are invalidposting_to_general_channel_denied
- An admin has restricted posting to the #general channel.