Xlack.Web.Files (xlack v0.1.0) View Source
Link to this section Summary
Functions
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.
Link to this section Functions
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 forfilewas 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:123456789ts_to- Filter files created before this timestamp (inclusive). ex:123456789types- 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 fortypeswas invaliduser_not_found- Value passed foruserwas 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 forfilewas 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- Xlack-internal file type identifier. ex:phpinitial_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.