Module: Slack::Web::Api::Endpoints::AdminUsersSession

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

Instance Method Summary collapse

Instance Method Details

#admin_users_session_clearSettings(options = {}) ⇒ Object

Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user_ids (array)

    The IDs of users you’d like to clear session settings for.

Raises:

  • (ArgumentError)

See Also:



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

def admin_users_session_clearSettings(options = {})
  raise ArgumentError, 'Required arguments :user_ids missing' if options[:user_ids].nil?
  post('admin.users.session.clearSettings', options)
end

#admin_users_session_getSettings(options = {}) ⇒ Object

Get user-specific session settings—the session duration and what happens when the client closes—given a list of users.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user_ids (array)

    The IDs of users you’d like to fetch session settings for. Note: if a user does not have any active sessions, they will not be returned in the response.

Raises:

  • (ArgumentError)

See Also:



28
29
30
31
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 28

def admin_users_session_getSettings(options = {})
  raise ArgumentError, 'Required arguments :user_ids missing' if options[:user_ids].nil?
  post('admin.users.session.getSettings', options)
end

#admin_users_session_invalidate(options = {}) ⇒ Object

Revoke a single session for a user. The user will be forced to login to Slack.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :session_id (integer)

    ID of the session to invalidate.

  • :team_id (string)

    ID of the workspace that the session belongs to.

Raises:

  • (ArgumentError)

See Also:



42
43
44
45
46
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 42

def admin_users_session_invalidate(options = {})
  raise ArgumentError, 'Required arguments :session_id missing' if options[:session_id].nil?
  raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
  post('admin.users.session.invalidate', options)
end

#admin_users_session_list(options = {}) ⇒ Object

List active user sessions for an organization

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cursor (string)

    Set cursor to next_cursor returned by the previous call to list items in the next page.

  • :limit (integer)

    The maximum number of items to return. Must be between 1 - 1000 both inclusive.

  • :team_id (string)

    The ID of the workspace you’d like active sessions for. If you pass a team_id, you’ll need to pass a user_id as well.

  • :user_id (string)

    The ID of user you’d like active sessions for. If you pass a user_id, you’ll need to pass a team_id as well.

See Also:



61
62
63
64
65
66
67
68
69
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 61

def admin_users_session_list(options = {})
  if block_given?
    Pagination::Cursor.new(self, :admin_users_session_list, options).each do |page|
      yield page
    end
  else
    post('admin.users.session.list', options)
  end
end

#admin_users_session_reset(options = {}) ⇒ Object

Wipes all valid sessions on all devices for a given user

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user_id (string)

    The ID of the user to wipe sessions for.

  • :mobile_only (boolean)

    Only expire mobile sessions (default: false).

  • :web_only (boolean)

    Only expire web sessions (default: false).

Raises:

  • (ArgumentError)

See Also:



82
83
84
85
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 82

def admin_users_session_reset(options = {})
  raise ArgumentError, 'Required arguments :user_id missing' if options[:user_id].nil?
  post('admin.users.session.reset', options)
end

#admin_users_session_resetBulk(options = {}) ⇒ Object

Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user_ids (array)

    The ID of the user to wipe sessions for.

  • :mobile_only (boolean)

    Only expire mobile sessions (default: false).

  • :web_only (boolean)

    Only expire web sessions (default: false).

Raises:

  • (ArgumentError)

See Also:



98
99
100
101
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 98

def admin_users_session_resetBulk(options = {})
  raise ArgumentError, 'Required arguments :user_ids missing' if options[:user_ids].nil?
  post('admin.users.session.resetBulk', options)
end

#admin_users_session_setSettings(options = {}) ⇒ Object

Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user_ids (array)

    The list of up to 1,000 user IDs to apply the session settings for.

  • :desktop_app_browser_quit (boolean)

    Terminate the session when the client—either the desktop app or a browser window—is closed.

  • :duration (integer)

    The session duration, in seconds. The minimum value is 28800, which represents 8 hours; the max value is 315569520 or 10 years (that’s a long Slack session).

Raises:

  • (ArgumentError)

See Also:



114
115
116
117
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 114

def admin_users_session_setSettings(options = {})
  raise ArgumentError, 'Required arguments :user_ids missing' if options[:user_ids].nil?
  post('admin.users.session.setSettings', options)
end