SlackWebAPI v1.2.0 SlackWebAPI.Api.Usergroups View Source

API calls for all endpoints tagged Usergroups.

Link to this section Summary

Functions

Disable an existing User Group

List all User Groups for a team

Update an existing User Group

List all users in a User Group

Update the list of users for a User Group

Link to this section Functions

Link to this function

usergroups_create(connection, opts \\ [])

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

Create a User Group

Parameters

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

    • :token (String.t): Authentication token. Requires scope: usergroups:write
    • :handle (String.t): A mention handle. Must be unique among channels, users and User Groups.
    • :description (String.t): A short description of the User Group.
    • :channels (String.t): A comma separated string of encoded channel IDs for which the User Group uses as a default.
    • :include_count (boolean()): Include the number of users in each User Group.
    • :name (String.t): A name for the User Group. Must be unique among User Groups.

Returns

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

Link to this function

usergroups_disable(connection, opts \\ [])

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

Disable an existing User Group

Parameters

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

    • :token (String.t): Authentication token. Requires scope: usergroups:write
    • :include_count (boolean()): Include the number of users in the User Group.
    • :usergroup (String.t): The encoded ID of the User Group to disable.

Returns

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

Link to this function

usergroups_enable(connection, opts \\ [])

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

Enable a User Group

Parameters

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

    • :token (String.t): Authentication token. Requires scope: usergroups:write
    • :include_count (boolean()): Include the number of users in the User Group.
    • :usergroup (String.t): The encoded ID of the User Group to enable.

Returns

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

Link to this function

usergroups_list(connection, opts \\ [])

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

List all User Groups for a team

Parameters

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

    • :include_users (boolean()): Include the list of users for each User Group.
    • :token (String.t): Authentication token. Requires scope: usergroups:read
    • :include_count (boolean()): Include the number of users in each User Group.
    • :include_disabled (boolean()): Include disabled User Groups.

Returns

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

Link to this function

usergroups_update(connection, opts \\ [])

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

Update an existing User Group

Parameters

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

    • :token (String.t): Authentication token. Requires scope: usergroups:write
    • :handle (String.t): A mention handle. Must be unique among channels, users and User Groups.
    • :description (String.t): A short description of the User Group.
    • :channels (String.t): A comma separated string of encoded channel IDs for which the User Group uses as a default.
    • :include_count (boolean()): Include the number of users in the User Group.
    • :usergroup (String.t): The encoded ID of the User Group to update.
    • :name (String.t): A name for the User Group. Must be unique among User Groups.

Returns

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

Link to this function

usergroups_users_list(connection, opts \\ [])

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

List all users in a User Group

Parameters

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

Returns

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

Link to this function

usergroups_users_update(connection, opts \\ [])

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

Update the list of users for a User Group

Parameters

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

    • :token (String.t): Authentication token. Requires scope: usergroups:write
    • :users (String.t): A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
    • :include_count (boolean()): Include the number of users in the User Group.
    • :usergroup (String.t): The encoded ID of the User Group to update.

Returns

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