slack_web_api v1.2.1 SlackWebAPI.Api.Files
API calls for all endpoints tagged Files
.
Link to this section Summary
Functions
Deletes an existing comment on a file.
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
files_comments_delete(connection, opts \\ [])
files_comments_delete(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Deletes an existing comment on a file.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
files:write:user
- :id (String.t): The comment to delete.
- :file (String.t): File to delete a comment from.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
files_delete(connection, opts \\ [])
files_delete(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Deletes a file.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
files:write:user
- :file (String.t): ID of file to delete.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
files_info(connection, opts \\ [])
files_info(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Gets information about a team file.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :count (String.t):
- :cursor (String.t): Parameter for pagination. File comments are paginated for a single file. Set
cursor
equal to thenext_cursor
attribute returned by the previous request'sresponse_metadata
. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection of comments. See pagination for more details. - :token (String.t): Authentication token. Requires scope:
files:read
- :limit (integer()): The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
- :file (String.t): Specify a file by providing its ID.
- :page (String.t):
Returns
{:ok, %{}} on success {:error, info} on failure
files_list(connection, opts \\ [])
files_list(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Lists & filters team files.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :count (String.t):
- :channel (String.t): Filter files appearing in a specific channel, indicated by its ID.
- :ts_to (float()): Filter files created before this timestamp (inclusive).
- :ts_from (float()): Filter files created after this timestamp (inclusive).
- :token (String.t): Authentication token. Requires scope:
files:read
- :user (String.t): Filter files created by a single user.
- :page (String.t):
- :types (String.t): Filter files by type (see below). You can pass multiple values in the types argument, like
types=spaces,snippets
.The default value isall
, which does not filter the list.
Returns
{:ok, %{}} on success {:error, info} on failure
files_revoke_public_url(connection, opts \\ [])
files_revoke_public_url(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Revokes public/external sharing access for a file
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
files:write:user
- :file (String.t): File to revoke
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
files_upload(connection, opts \\ [])
files_upload(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Uploads or creates a file.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :channels (String.t): Comma-separated list of channel names or IDs where the file will be shared.
- :title (String.t): Title of file.
- :initial_comment (String.t): The message text introducing the file in specified
channels
. - :filetype (String.t): A file type identifier.
- :filename (String.t): Filename of file.
- :content (String.t): File contents via a POST variable. If omitting this parameter, you must provide a
file
. - :token (String.t): Authentication token. Requires scope:
files:write:user
- :file (String.t): File contents via
multipart/form-data
. If omitting this parameter, you must submitcontent
. - :thread_ts (float()): Provide another message's
ts
value to upload this file as a reply. Never use a reply'sts
value; use its parent instead.
Returns
{:ok, %{}} on success {:error, info} on failure