Slack.Web.Users.Profile (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

Retrieve a user's profile information, including their custom status.

Set a user's profile information, including custom status.

Functions

get(optional_params \\ %{})

Retrieve a user's profile information, including their custom status.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes:

View on docs.slack.dev ↗

Optional Params

  • include_labels - Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended. ex: true
  • user - User to retrieve profile info for

Errors the API can return:

  • user_not_found - Value passed for user was invalid.

See the Common Errors guide for errors returned by every Web API method.

set(optional_params \\ %{})

Set a user's profile information, including custom status.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Optional Params

  • name - Name of a single key to set. Usable only if profile is not passed. Update one field at a time by passing the pair of arguments name and value. ex: first_name
  • profile - 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. You can update any of the following non-custom fields from the profile object within a Slack user object: ex: { first_name: "John", ... }
  • user - ID of user to change. This argument may only be specified by admins on paid teams. You can update any of the following non-custom fields from the profile object within a Slack user object:
  • value - Value to set a single key to. Usable only if profile is not passed. Update one field at a time by passing the pair of arguments name and value. ex: John

Errors the API can return:

  • cannot_update_admin_user - Only a primary owner can update the profile of an admin.
  • email_taken - email taken
  • invalid_emoji_not_allowed - Invalid emoji not allowed.
  • invalid_ooo_message - Invalid Out of Office message.
  • invalid_profile - Profile object passed in is not valid JSON (make sure it is URL encoded!).
  • invalid_starts_with_at - Name cannot start with @.
  • must_clear_both_status_text_and_status_emoji - Clearing the status requires setting both status_text and status_emoji to ''.
  • name_not_allowed - name cannot contain URL.
  • not_admin - Only admins can update the profile of another user. Some fields, like email may only be updated by an admin.
  • not_app_admin - Only team owners and selected members can update the profile of a bot user.
  • partial_profile_set_failed - Failed to set user profile.
  • permission_denied - Permission denied.
  • profile_set_failed - Failed to set user profile.
  • reserved_name - First or last name are reserved.
  • sudo_required - Request requires sudo session.
  • too_long - You attempted to set a custom status but it was longer than the maximum allowed, 100.
  • username_same - Username is the same as the current username.

See the Common Errors guide for errors returned by every Web API method.