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

Use this method to retrieve a user’s profile information.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :include_labels (Object)

    Include labels for each ID in custom profile fields.

  • :user (user)

    User to retrieve profile info for.

See Also:



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

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

Use this method to set a user’s profile information, including name, email, current status, and other attributes.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :name (Object)

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

  • :profile (Object)

    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 team admins on paid teams.

  • :value (Object)

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

See Also:



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

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