SlackWebAPI v1.2.0 SlackWebAPI.Api.Groups View Source

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

Link to this function

groups_archive(connection, opts \\ [])

View Source
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

Returns

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

Link to this function

groups_create(connection, opts \\ [])

View Source
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

Returns

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

Link to this function

groups_create_child(connection, opts \\ [])

View Source
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.

Returns

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

Link to this function

groups_history(connection, opts \\ [])

View Source
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

Link to this function

groups_info(connection, opts \\ [])

View Source
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 to false
    • :channel (String.t): Private channel to get info on

Returns

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

Link to this function

groups_invite(connection, opts \\ [])

View Source
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.

Returns

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

Link to this function

groups_kick(connection, opts \\ [])

View Source
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.

Returns

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

Link to this function

groups_leave(connection, opts \\ [])

View Source
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

Returns

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

Link to this function

groups_list(connection, opts \\ [])

View Source
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 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.
    • :exclude_members (boolean()): Exclude the members from each group
    • :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.

Returns

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

Link to this function

groups_mark(connection, opts \\ [])

View Source
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.

Returns

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

Link to this function

groups_open(connection, opts \\ [])

View Source
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.

Returns

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

Link to this function

groups_rename(connection, opts \\ [])

View Source
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

Returns

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

Link to this function

groups_replies(connection, opts \\ [])

View Source
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

Link to this function

groups_set_purpose(connection, opts \\ [])

View Source
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

Returns

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

Link to this function

groups_set_topic(connection, opts \\ [])

View Source
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

Returns

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

Link to this function

groups_unarchive(connection, opts \\ [])

View Source
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

Returns

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