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

    ID of the session to invalidate.

  • :team_id (Object)

    ID of the workspace that the session belongs to.

See Also:



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

def admin_users_session_invalidate(options = {})
  throw ArgumentError.new('Required arguments :session_id missing') if options[:session_id].nil?
  throw ArgumentError.new('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 (Object)

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

  • :limit (Object)

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

  • :team_id (Object)

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

    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:



37
38
39
40
41
42
43
44
45
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 37

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

    The ID of the user to wipe sessions for.

  • :mobile_only (Object)

    Only expire mobile sessions (default: false).

  • :web_only (Object)

    Only expire web sessions (default: false).

See Also:



58
59
60
61
# File 'lib/slack/web/api/endpoints/admin_users_session.rb', line 58

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