module Slack::Web::Api::Endpoints::AdminUsers
Public Instance Methods
Add an Enterprise user to a workspace.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@option options [Object] :user_id
The ID of the user to add to the workspace.
@option options [Object] :channel_ids
Comma separated values of channel IDs to add user in the new workspace.
@option options [Object] :is_restricted
True if user should be added to the workspace as a guest.
@option options [Object] :is_ultra_restricted
True if user should be added to the workspace as a single-channel guest.
@see api.slack.com/methods/admin.users.assign @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.assign.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 24 def admin_users_assign(options = {}) throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.assign', options) end
Invite a user to a workspace.
@option options [Object] :channel_ids
A comma-separated list of channel_ids for this user to join. At least one channel is required.
@option options [Object] :email
The email address of the person to invite.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@option options [Object] :custom_message
An optional message to send to the user in the invite email.
@option options [Object] :guest_expiration_ts
Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.
@option options [Object] :is_restricted
Is this user a multi-channel guest user? (default: false).
@option options [Object] :is_ultra_restricted
Is this user a single channel guest user? (default: false).
@option options [Object] :real_name
Full name of the user.
@option options [Object] :resend
Allow this invite to be resent in the future if a user has not signed up yet. (default: false).
@see api.slack.com/methods/admin.users.invite @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.invite.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 53 def admin_users_invite(options = {}) throw ArgumentError.new('Required arguments :channel_ids missing') if options[:channel_ids].nil? throw ArgumentError.new('Required arguments :email missing') if options[:email].nil? throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? post('admin.users.invite', options) end
List users on a workspace
@option options [Object] :cursor
Set cursor to next_cursor returned by the previous call to list items in the next page.
@option options [Object] :limit
Limit for how many users to be retrieved per page.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@see api.slack.com/methods/admin.users.list @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.list.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 71 def admin_users_list(options = {}) if block_given? Pagination::Cursor.new(self, :admin_users_list, options).each do |page| yield page end else post('admin.users.list', options) end end
Remove a user from a workspace.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@option options [Object] :user_id
The ID of the user to remove.
@see api.slack.com/methods/admin.users.remove @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.remove.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 90 def admin_users_remove(options = {}) throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.remove', options) end
Set an existing guest, regular user, or owner to be an admin user.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@option options [Object] :user_id
The ID of the user to designate as an admin.
@see api.slack.com/methods/admin.users.setAdmin @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setAdmin.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 105 def admin_users_setAdmin(options = {}) throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.setAdmin', options) end
Set an expiration for a guest user
@option options [Object] :expiration_ts
Timestamp when guest account should be disabled.
@option options [Object] :user_id
The ID of the user to set an expiration for.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@see api.slack.com/methods/admin.users.setExpiration @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setExpiration.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 122 def admin_users_setExpiration(options = {}) throw ArgumentError.new('Required arguments :expiration_ts missing') if options[:expiration_ts].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.setExpiration', options) end
Set an existing guest, regular user, or admin user to be a workspace owner.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@option options [Object] :user_id
Id of the user to promote to owner.
@see api.slack.com/methods/admin.users.setOwner @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setOwner.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 137 def admin_users_setOwner(options = {}) throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.setOwner', options) end
Set an existing guest user, admin user, or owner to be a regular user.
@option options [Object] :team_id
The ID (T1234) of the workspace.
@option options [Object] :user_id
The ID of the user to designate as a regular user.
@see api.slack.com/methods/admin.users.setRegular @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setRegular.json
# File lib/slack/web/api/endpoints/admin_users.rb, line 152 def admin_users_setRegular(options = {}) throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.setRegular', options) end