slack_web_api v1.2.1 SlackWebAPI.Api.Conversations
API calls for all endpoints tagged Conversations
.
Link to this section Summary
Functions
Archives a conversation.
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.
Leaves 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.
Renames a conversation.
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
conversations_archive(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_close(connection, opts \\ [])
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.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_create(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_history(connection, opts \\ [])
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 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:
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
conversations_info(connection, opts \\ [])
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 tofalse
- :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 tofalse
- :include_num_members (boolean()): Set to
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_invite(connection, opts \\ [])
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.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_join(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_kick(connection, opts \\ [])
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.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_leave(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_list(connection, opts \\ [])
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 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:
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
- :cursor (String.t): Paginate through collections of data by setting the
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_members(connection, opts \\ [])
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 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:
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
- :cursor (String.t): Paginate through collections of data by setting the
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_open(connection, opts \\ [])
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 supplyingusers
. - :channel (String.t): Resume a conversation by supplying an
im
ormpim
's ID. Or provide theusers
field instead.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_rename(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_replies(connection, opts \\ [])
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 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:
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
conversations_set_purpose(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_set_topic(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
conversations_unarchive(connection, opts \\ [])
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
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure