SlackWebAPI v1.2.0 SlackWebAPI.Api.Im View Source
API calls for all endpoints tagged Im
.
Link to this section Summary
Functions
Close a direct message channel.
Fetches history of messages and events from direct message channel.
Lists direct message channels for the calling user.
Sets the read cursor in a direct message channel.
Opens a direct message channel.
Retrieve a thread of messages posted to a direct message conversation
Link to this section Functions
im_close(connection, opts \\ [])
View Sourceim_close(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Close a direct message channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
Returns
{:ok, %{}} on success {:error, info} on failure
im_history(connection, opts \\ [])
View Sourceim_history(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Fetches history of messages and events from direct message channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :count (integer()): Number of messages to return, between 1 and 1000.
- :unreads (boolean()): Include
unread_count_display
in the output? - :inclusive (boolean()): Include messages with latest or oldest timestamp in results.
- :token (String.t): Authentication token. Requires scope:
im:history
- :oldest (float()): Start of time range of messages to include in results.
- :channel (String.t): Direct message channel to fetch history for.
- :latest (float()): End of time range of messages to include in results.
Returns
{:ok, %{}} on success {:error, info} on failure
im_list(connection, opts \\ [])
View Sourceim_list(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Lists direct message channels for the calling user.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :cursor (String.t): Paginate through collections of data by setting the
cursor
parameter to anext_cursor
attribute returned by a previous request'sresponse_metadata
. Default value fetches the first "page" of the collection. See pagination for more detail. - :token (String.t): Authentication token. Requires scope:
im: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 users list hasn't been reached.
- :cursor (String.t): Paginate through collections of data by setting the
Returns
{:ok, %{}} on success {:error, info} on failure
im_mark(connection, opts \\ [])
View Sourceim_mark(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Sets the read cursor in a direct message channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
im:write
- :channel (String.t): Direct message channel to set reading cursor in.
- :ts (float()): Timestamp of the most recently seen message.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
im_open(connection, opts \\ [])
View Sourceim_open(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Opens a direct message channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
im:write
- :return_im (boolean()): Boolean, indicates you want the full IM channel definition in the response.
- :user (String.t): User to open a direct message channel with.
- :include_locale (boolean()): Set this to
true
to receive the locale for this im. Defaults tofalse
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
im_replies(connection, opts \\ [])
View Sourceim_replies(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Retrieve a thread of messages posted to a direct message conversation
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :thread_ts (float()): Unique identifier of a thread's parent message
- :token (String.t): Authentication token. Requires scope:
im:history
- :channel (String.t): Direct message channel to fetch thread from
Returns
{:ok, %{}} on success {:error, info} on failure