SlackWebAPI v1.2.0 SlackWebAPI.Api.Users View Source

API calls for all endpoints tagged Users.

Link to this section Summary

Functions

List conversations the calling user may access.

Delete the user profile photo

Gets user presence information.

Gets information about a user.

Lists all users in a Slack team.

Find a user with an email address.

Retrieves a user's profile information.

Set the profile information for a user.

Marked a user as active. Deprecated and non-functional.

Set the user profile photo

Manually sets user presence.

Link to this section Functions

Link to this function

users_conversations(connection, opts \\ [])

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

List conversations the calling user may access.

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.
    • :user (String.t): Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership.
    • :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

users_delete_photo(connection, opts \\ [])

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

Delete the user profile photo

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users.profile:write

Returns

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

Link to this function

users_get_presence(connection, opts \\ [])

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

Gets user presence information.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users:read
    • :user (String.t): User to get presence info on. Defaults to the authed user.

Returns

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

Link to this function

users_identity(connection, opts \\ [])

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

Get a user's identity.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: identity.basic

Returns

{:ok, %SlackWebAPI.Model.Map{}} on success {:error, info} on failure

Link to this function

users_info(connection, opts \\ [])

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

Gets information about a user.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users:read
    • :user (String.t): User to get info on
    • :include_locale (boolean()): Set this to true to receive the locale for this user. Defaults to false

Returns

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

Link to this function

users_list(connection, opts \\ [])

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

Lists all users 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: users: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.
    • :include_locale (boolean()): Set this to true to receive the locale for users. Defaults to false

Returns

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

Link to this function

users_lookup_by_email(connection, opts \\ [])

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

Find a user with an email address.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users:read.email
    • :email (String.t): An email address belonging to a user in the workspace

Returns

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

Link to this function

users_profile_get(connection, opts \\ [])

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

Retrieves a user's profile information.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users.profile:read
    • :include_labels (boolean()): Include labels for each ID in custom profile fields
    • :user (String.t): User to retrieve profile info for

Returns

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

Link to this function

users_profile_set(connection, opts \\ [])

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

Set the profile information for a user.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users.profile:write
    • :profile (String.t): Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.
    • :user (String.t): ID of user to change. This argument may only be specified by team admins on paid teams.
    • :value (String.t): Value to set a single key to. Usable only if profile is not passed.
    • :name (String.t): Name of a single key to set. Usable only if profile is not passed.

Returns

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

Link to this function

users_set_active(connection, opts \\ [])

View Source
users_set_active(Tesla.Env.client(), keyword()) ::
  {:ok, SlackWebAPI.Model.DefaultSuccessTemplate.t()} | {:error, Tesla.Env.t()}

Marked a user as active. Deprecated and non-functional.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users:write

Returns

{:ok, %SlackWebAPI.Model.DefaultSuccessTemplate{}} on success {:error, info} on failure

Link to this function

users_set_photo(connection, opts \\ [])

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

Set the user profile photo

Parameters

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

    • :image (String.t): File contents via multipart/form-data.
    • :crop_w (integer()): Width/height of crop box (always square)
    • :token (String.t): Authentication token. Requires scope: users.profile:write
    • :crop_y (integer()): Y coordinate of top-left corner of crop box
    • :crop_x (integer()): X coordinate of top-left corner of crop box

Returns

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

Link to this function

users_set_presence(connection, opts \\ [])

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

Manually sets user presence.

Parameters

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

    • :token (String.t): Authentication token. Requires scope: users:write
    • :presence (String.t): Either auto or away

Returns

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