module Slack::Endpoint::Files

Public Instance Methods

files_delete(options={}) click to toggle source

This method deletes a file from your team.

@option options [Object] :file

ID of file to delete.

@see api.slack.com/methods/files.delete @see github.com/aki017/slack-api-docs/blob/master/methods/files.delete.md @see github.com/aki017/slack-api-docs/blob/master/methods/files.delete.json

# File lib/slack/endpoint/files.rb, line 14
def files_delete(options={})
  throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("files.delete", options)
end
files_info(options={}) click to toggle source

This method returns information about a file in your team.

@option options [Object] :file

File to fetch info for

@option options [Object] :count

Number of items to return per page.

@option options [Object] :page

Page number of results to return.

@see api.slack.com/methods/files.info @see github.com/aki017/slack-api-docs/blob/master/methods/files.info.md @see github.com/aki017/slack-api-docs/blob/master/methods/files.info.json

# File lib/slack/endpoint/files.rb, line 32
def files_info(options={})
  throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("files.info", options)
end
files_list(options={}) click to toggle source

This method returns a list of files within the team. It can be filtered and sliced in various ways.

@option options [Object] :user

Filter files created by a single user.

@option options [Object] :ts_from

Filter files created after this timestamp (inclusive).

@option options [Object] :ts_to

Filter files created before this timestamp (inclusive).

@option options [Object] :types

Filter files by type:

all - All files
posts - Posts
snippets - Snippets
images - Image files
gdocs - Google docs
zips - Zip files
pdfs - 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.

@option options [Object] :count

Number of items to return per page.

@option options [Object] :page

Page number of results to return.

@see api.slack.com/methods/files.list @see github.com/aki017/slack-api-docs/blob/master/methods/files.list.md @see github.com/aki017/slack-api-docs/blob/master/methods/files.list.json

# File lib/slack/endpoint/files.rb, line 68
def files_list(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("files.list", options)
end
files_upload(options={}) click to toggle source

This method allows you to create or upload an existing file.

@option options [Object] :file

File contents via multipart/form-data.

@option options [Object] :content

File contents via a POST var.

@option options [Object] :filetype

Slack-internal file type identifier.

@option options [Object] :filename

Filename of file.

@option options [Object] :title

Title of file.

@option options [Object] :initial_comment

Initial comment to add to file.

@option options [Object] :channels

Comma separated list of channels to share the file into.

@see api.slack.com/methods/files.upload @see github.com/aki017/slack-api-docs/blob/master/methods/files.upload.md @see github.com/aki017/slack-api-docs/blob/master/methods/files.upload.json

# File lib/slack/endpoint/files.rb, line 93
def files_upload(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("files.upload", options)
end