SlackWebAPI v1.2.0 SlackWebAPI.Api.Conversations View Source

API calls for all endpoints tagged Conversations.

Link to this section Summary

Functions

Closes a direct message or multi-person direct message.

Initiates a public or private channel-based conversation

Fetches a conversation's history of messages and events.

Retrieve information about a conversation.

Invites users to a channel.

Joins an existing conversation.

Removes a user from a conversation.

Lists all channels in a Slack team.

Retrieve members of a conversation.

Opens or resumes a direct message or multi-person direct message.

Retrieve a thread of messages posted to a conversation

Sets the purpose for a conversation.

Sets the topic for a conversation.

Reverses conversation archival.

Link to this section Functions

Link to this function

conversations_archive(connection, opts \\ [])

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

Archives a conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :channel (String.t): ID of conversation to archive

Returns

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

Link to this function

conversations_close(connection, opts \\ [])

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

Closes a direct message or multi-person direct message.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :channel (String.t): Conversation to close.

Returns

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

Link to this function

conversations_create(connection, opts \\ [])

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

Initiates a public or private channel-based conversation

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :user_ids (String.t): Required for workspace apps. A list of between 1 and 30 human users that will be added to the newly-created conversation. This argument has no effect when used by classic Slack apps.
    • :name (String.t): Name of the public or private channel to create
    • :is_private (boolean()): Create a private channel instead of a public one

Returns

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

Link to this function

conversations_history(connection, opts \\ [])

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

Fetches a conversation's history of messages and events.

Parameters

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

    • :inclusive (boolean()): Include messages with latest or oldest timestamp in results only when either timestamp is specified.
    • :cursor (String.t): Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
    • :token (String.t): Authentication token. Requires scope: conversations:history
    • :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.
    • :oldest (float()): Start of time range of messages to include in results.
    • :channel (String.t): Conversation ID 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

conversations_info(connection, opts \\ [])

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

Retrieve information about a conversation.

Parameters

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

    • :include_num_members (boolean()): Set to true to include the member count for the specified conversation. Defaults to false
    • :token (String.t): Authentication token. Requires scope: conversations:read
    • :channel (String.t): Conversation ID to learn more about
    • :include_locale (boolean()): Set this to true to receive the locale for this conversation. Defaults to false

Returns

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

Link to this function

conversations_invite(connection, opts \\ [])

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

Invites users to a channel.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :users (String.t): A comma separated list of user IDs. Up to 30 users may be listed.
    • :channel (String.t): The ID of the public or private channel to invite user(s) to.

Returns

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

Link to this function

conversations_join(connection, opts \\ [])

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

Joins an existing conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: channels:write
    • :channel (String.t): ID of conversation to join

Returns

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

Link to this function

conversations_kick(connection, opts \\ [])

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

Removes a user from a conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :user (String.t): User ID to be removed.
    • :channel (String.t): ID of conversation to remove user from.

Returns

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

Link to this function

conversations_leave(connection, opts \\ [])

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

Leaves a conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :channel (String.t): Conversation to leave

Returns

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

Link to this function

conversations_list(connection, opts \\ [])

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

Lists all channels in a Slack team.

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 a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
    • :token (String.t): Authentication token. Requires scope: conversations: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. Must be an integer no larger than 1000.
    • :exclude_archived (boolean()): Set to true to exclude archived channels from the list
    • :types (String.t): Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im

Returns

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

Link to this function

conversations_members(connection, opts \\ [])

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

Retrieve members of a conversation.

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 a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
    • :token (String.t): Authentication token. Requires scope: conversations: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.
    • :channel (String.t): ID of the conversation to retrieve members for

Returns

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

Link to this function

conversations_open(connection, opts \\ [])

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

Opens or resumes a direct message or multi-person direct message.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :return_im (boolean()): Boolean, indicates you want the full IM channel definition in the response.
    • :users (String.t): Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.
    • :channel (String.t): Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.

Returns

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

Link to this function

conversations_rename(connection, opts \\ [])

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

Renames a conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :name (String.t): New name for conversation.
    • :channel (String.t): ID of conversation to rename

Returns

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

Link to this function

conversations_replies(connection, opts \\ [])

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

Retrieve a thread of messages posted to a conversation

Parameters

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

    • :inclusive (boolean()): Include messages with latest or oldest timestamp in results only when either timestamp is specified.
    • :ts (float()): Unique identifier of a thread's parent message.
    • :cursor (String.t): Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
    • :token (String.t): Authentication token. Requires scope: conversations:history
    • :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.
    • :oldest (float()): Start of time range of messages to include in results.
    • :channel (String.t): Conversation ID to fetch thread from.
    • :latest (float()): End of time range of messages to include in results.

Returns

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

Link to this function

conversations_set_purpose(connection, opts \\ [])

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

Sets the purpose for a conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :purpose (String.t): A new, specialer purpose
    • :channel (String.t): Conversation to set the purpose of

Returns

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

Link to this function

conversations_set_topic(connection, opts \\ [])

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

Sets the topic for a conversation.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :topic (String.t): The new topic string. Does not support formatting or linkification.
    • :channel (String.t): Conversation to set the topic of

Returns

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

Link to this function

conversations_unarchive(connection, opts \\ [])

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

Reverses conversation archival.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: conversations:write
    • :channel (String.t): ID of conversation to unarchive

Returns

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