Module: Slack::Web::Api::Endpoints::UsersProfile

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/users_profile.rb

Instance Method Summary collapse

Instance Method Details

#users_profile_get(options = {}) ⇒ Object

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

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :include_labels (boolean)

    Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.

  • :user (user)

    User to retrieve profile info for.

See Also:



18
19
20
21
# File 'lib/slack/web/api/endpoints/users_profile.rb', line 18

def users_profile_get(options = {})
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  post('users.profile.get', options)
end

#users_profile_set(options = {}) ⇒ Object

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

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :name (string)

    Name of a single key to set. Usable only if profile is not passed.

  • :profile (string)

    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 (user)

    ID of user to change. This argument may only be specified by admins on paid teams.

  • :value (string)

    Value to set a single key to. Usable only if profile is not passed.

See Also:



36
37
38
39
40
# File 'lib/slack/web/api/endpoints/users_profile.rb', line 36

def users_profile_set(options = {})
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  options = encode_options_as_json(options, %i[profile])
  post('users.profile.set', options)
end