slack_web_api v1.2.1 SlackWebAPI.Api.Groups
API calls for all endpoints tagged Groups
.
Link to this section Summary
Functions
Archives a private channel.
Creates a private channel.
Clones and archives a private channel.
Fetches history of messages and events from a private channel.
Gets information about a private channel.
Invites a user to a private channel.
Removes a user from a private channel.
Leaves a private channel.
Lists private channels that the calling user has access to.
Sets the read cursor in a private channel.
Opens a private channel.
Renames a private channel.
Retrieve a thread of messages posted to a private channel
Sets the purpose for a private channel.
Sets the topic for a private channel.
Unarchives a private channel.
Link to this section Functions
groups_archive(connection, opts \\ [])
groups_archive(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Archives a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :channel (String.t): Private channel to archive
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_create(connection, opts \\ [])
groups_create(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Creates a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :validate (boolean()): Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
- :name (String.t): Name of private channel to create
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_create_child(connection, opts \\ [])
groups_create_child(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Clones and archives a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :channel (String.t): Private channel to clone and archive.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_history(connection, opts \\ [])
groups_history(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Fetches history of messages and events from a private 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:
groups:history
- :oldest (float()): Start of time range of messages to include in results.
- :channel (String.t): Private 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
groups_info(connection, opts \\ [])
groups_info(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Gets information about a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:read
- :include_locale (boolean()): Set this to
true
to receive the locale for this group. Defaults tofalse
- :channel (String.t): Private channel to get info on
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_invite(connection, opts \\ [])
groups_invite(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Invites a user to a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :user (String.t): User to invite.
- :channel (String.t): Private channel to invite user to.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_kick(connection, opts \\ [])
groups_kick(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Removes a user from a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :user (String.t): User to remove from private channel.
- :channel (String.t): Private channel to remove user from.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_leave(connection, opts \\ [])
groups_leave(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Leaves a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :channel (String.t): Private channel to leave
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_list(connection, opts \\ [])
groups_list(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Lists private channels that the calling user has access to.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :cursor (String.t): Parameter for pagination. 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. See pagination for more details. - :exclude_members (boolean()): Exclude the
members
from eachgroup
- :token (String.t): Authentication token. Requires scope:
groups:read
- :exclude_archived (boolean()): Don't return archived private channels.
- :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.
- :cursor (String.t): Parameter for pagination. Set
Returns
{:ok, %{}} on success {:error, info} on failure
groups_mark(connection, opts \\ [])
groups_mark(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Sets the read cursor in a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :ts (float()): Timestamp of the most recently seen message.
- :channel (String.t): Private channel to set reading cursor in.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_open(connection, opts \\ [])
groups_open(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Opens a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :channel (String.t): Private channel to open.
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_rename(connection, opts \\ [])
groups_rename(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Renames a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :validate (boolean()): Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
- :name (String.t): New name for private channel.
- :channel (String.t): Private channel to rename
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_replies(connection, opts \\ [])
groups_replies(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Retrieve a thread of messages posted to a private channel
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:
groups:history
- :channel (String.t): Private channel to fetch thread from
Returns
{:ok, %{}} on success {:error, info} on failure
groups_set_purpose(connection, opts \\ [])
groups_set_purpose(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Sets the purpose for a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :purpose (String.t): The new purpose
- :channel (String.t): Private channel to set the purpose of
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_set_topic(connection, opts \\ [])
groups_set_topic(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Sets the topic for a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :topic (String.t): The new topic
- :channel (String.t): Private channel to set the topic of
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure
groups_unarchive(connection, opts \\ [])
groups_unarchive(Tesla.Env.client(), keyword()) :: {:ok, map()} | {:error, Tesla.Env.t()}
Unarchives a private channel.
Parameters
- connection (SlackWebAPI.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :token (String.t): Authentication token. Requires scope:
groups:write
- :channel (String.t): Private channel to unarchive
- :token (String.t): Authentication token. Requires scope:
Returns
{:ok, %{}} on success {:error, info} on failure