Module: Slack::Endpoint::Users

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/users.rb

Instance Method Summary collapse

Instance Method Details

#users_deletePhoto(options = {}) ⇒ Object

Delete the user profile photo



12
13
14
# File 'lib/slack/endpoint/users.rb', line 12

def users_deletePhoto(options={})
  post("users.deletePhoto", options)
end

#users_getPresence(options = {}) ⇒ Object

Gets user presence information.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user (Object)

    User to get presence info on. Defaults to the authed user.

See Also:



24
25
26
27
# File 'lib/slack/endpoint/users.rb', line 24

def users_getPresence(options={})
  throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
  post("users.getPresence", options)
end

#users_identity(options = {}) ⇒ Object

Get a user’s identity.



35
36
37
# File 'lib/slack/endpoint/users.rb', line 35

def users_identity(options={})
  post("users.identity", options)
end

#users_info(options = {}) ⇒ Object

Gets information about a user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user (Object)

    User to get info on

  • :include_locale (Object)

    Set this to true to receive the locale for this user. Defaults to false

See Also:



49
50
51
52
# File 'lib/slack/endpoint/users.rb', line 49

def users_info(options={})
  throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
  post("users.info", options)
end

#users_list(options = {}) ⇒ Object

Lists all users in a Slack team.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cursor (Object)

    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.

  • :include_locale (Object)

    Set this to true to receive the locale for users. Defaults to false

  • :limit (Object)

    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.

  • :presence (Object)

    Whether to include presence data in the output. Defaults to false. Setting this to true reduces performance, especially with large teams.

See Also:



68
69
70
# File 'lib/slack/endpoint/users.rb', line 68

def users_list(options={})
  post("users.list", options)
end

#users_lookupByEmail(options = {}) ⇒ Object

Find a user with an email address.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :email (Object)

    An email address belonging to a user in the workspace

See Also:



80
81
82
83
# File 'lib/slack/endpoint/users.rb', line 80

def users_lookupByEmail(options={})
  throw ArgumentError.new("Required arguments :email missing") if options[:email].nil?
  post("users.lookupByEmail", options)
end

#users_profile_get(options = {}) ⇒ Object

Retrieves 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 (Object)

    User to retrieve profile info for

See Also:



95
96
97
# File 'lib/slack/endpoint/users.rb', line 95

def users_profile_get(options={})
  post("users.profile.get", options)
end

#users_profile_set(options = {}) ⇒ Object

Set the profile information for a user.

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.

  • :user (Object)

    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:



113
114
115
# File 'lib/slack/endpoint/users.rb', line 113

def users_profile_set(options={})
  post("users.profile.set", options)
end

#users_setActive(options = {}) ⇒ Object

Marks a user as active.



123
124
125
# File 'lib/slack/endpoint/users.rb', line 123

def users_setActive(options={})
  post("users.setActive", options)
end

#users_setPhoto(options = {}) ⇒ Object

Set the user profile photo

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :image (Object)

    File contents via multipart/form-data.

  • :crop_w (Object)

    Width/height of crop box (always square)

  • :crop_x (Object)

    X coordinate of top-left corner of crop box

  • :crop_y (Object)

    Y coordinate of top-left corner of crop box

See Also:



141
142
143
144
# File 'lib/slack/endpoint/users.rb', line 141

def users_setPhoto(options={})
  throw ArgumentError.new("Required arguments :image missing") if options[:image].nil?
  post("users.setPhoto", options)
end

#users_setPresence(options = {}) ⇒ Object

Manually sets user presence.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :presence (Object)

    Either auto or away

See Also:



154
155
156
157
# File 'lib/slack/endpoint/users.rb', line 154

def users_setPresence(options={})
  throw ArgumentError.new("Required arguments :presence missing") if options[:presence].nil?
  post("users.setPresence", options)
end