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

This method allows the user to delete their profile image. It will clear whatever image is currently set.



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

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

#users_getPresence(options = {}) ⇒ Object

This method lets you find out information about a user’s presence. Consult the presence documentation for more details.

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:



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

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

#users_identity(options = {}) ⇒ Object

After your Slack app is awarded an identity token through Sign in with Slack, use this method to retrieve a user’s identity.



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

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

#users_info(options = {}) ⇒ Object

This method returns information about a team member.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user (Object)

    User to get info on

See Also:



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

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

#users_list(options = {}) ⇒ Object

This method returns a list of all users in the team. This includes deleted/deactivated users.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :presence (Object)

    Whether to include presence data in the output

See Also:



61
62
63
# File 'lib/slack/endpoint/users.rb', line 61

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

#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):

  • :user (Object)

    User to retrieve profile info for

  • :include_labels (Object)

    Include labels for each ID in custom profile fields

See Also:



75
76
77
# File 'lib/slack/endpoint/users.rb', line 75

def users_profile_get(options={})
  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):

  • :user (Object)

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

  • :profile (Object)

    Collection of key:value pairs presented as a URL-encoded JSON hash.

  • :name (Object)

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

  • :value (Object)

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

See Also:



93
94
95
# File 'lib/slack/endpoint/users.rb', line 93

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

#users_setActive(options = {}) ⇒ Object

This method lets the slack messaging server know that the authenticated user is currently active. Consult the presence documentation for more details.



105
106
107
# File 'lib/slack/endpoint/users.rb', line 105

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

#users_setPhoto(options = {}) ⇒ Object

This method allows the user to set their profile image. The caller can pass image data via image.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :image (Object)

    File contents via multipart/form-data.

  • :crop_x (Object)

    X coordinate of top-left corner of crop box

  • :crop_y (Object)

    Y coordinate of top-left corner of crop box

  • :crop_w (Object)

    Width/height of crop box (always square)

See Also:



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

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

#users_setPresence(options = {}) ⇒ Object

This method lets you set the calling user’s manual presence. Consult the presence documentation for more details.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :presence (Object)

    Either auto or away

See Also:



137
138
139
140
# File 'lib/slack/endpoint/users.rb', line 137

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