SlackWebAPI v1.2.0 SlackWebAPI.Api.Mpim View Source

API calls for all endpoints tagged Mpim.

Link to this section Summary

Functions

Closes a multiparty direct message channel.

Fetches history of messages and events from a multiparty direct message.

Lists multiparty direct message channels for the calling user.

Sets the read cursor in a multiparty direct message channel.

This method opens a multiparty direct message.

Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.

Link to this section Functions

Link to this function

mpim_close(connection, opts \\ [])

View Source
mpim_close(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Closes a multiparty direct message channel.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :token (String.t): Authentication token. Requires scope: mpim:write
    • :channel (String.t): MPIM to close.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

mpim_history(connection, opts \\ [])

View Source
mpim_history(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Fetches history of messages and events from a multiparty direct message.

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: mpim:history
    • :oldest (float()): Start of time range of messages to include in results.
    • :channel (String.t): Multiparty direct message to fetch history for.
    • :latest (float()): End of time range of messages to include in results.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

mpim_list(connection, opts \\ [])

View Source
mpim_list(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Lists multiparty direct message channels for the calling user.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :cursor (String.t): Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
    • :token (String.t): Authentication token. Requires scope: mpim: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.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

mpim_mark(connection, opts \\ [])

View Source
mpim_mark(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Sets the read cursor in a multiparty direct message channel.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :token (String.t): Authentication token. Requires scope: mpim:write
    • :ts (float()): Timestamp of the most recently seen message.
    • :channel (String.t): multiparty direct message channel to set reading cursor in.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

mpim_open(connection, opts \\ [])

View Source
mpim_open(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

This method opens a multiparty direct message.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :token (String.t): Authentication token. Requires scope: mpim:write
    • :users (String.t): Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

mpim_replies(connection, opts \\ [])

View Source
mpim_replies(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.

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: mpim:history
    • :channel (String.t): Multiparty direct message channel to fetch thread from.

Returns

{:ok, %{}} on success {:error, info} on failure