module Slack::Web::Api::Endpoints::AdminConversations
Public Instance Methods
Archive a public or private channel.
@option options [Object] :channel_id
The channel to archive.
@see api.slack.com/methods/admin.conversations.archive @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.archive.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 16 def admin_conversations_archive(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.archive', options) end
Convert a public channel to a private channel.
@option options [Object] :channel_id
The channel to convert to private.
@see api.slack.com/methods/admin.conversations.convertToPrivate @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.convertToPrivate.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 28 def admin_conversations_convertToPrivate(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.convertToPrivate', options) end
Create a public or private channel-based conversation.
@option options [Object] :is_private
When true, creates a private channel instead of a public channel.
@option options [Object] :name
Name of the public or private channel to create.
@option options [Object] :description
Description of the public or private channel to create.
@option options [Object] :org_wide
When true, the channel will be available org-wide. Note: if the channel is not org_wide=true, you must specify a team_id for this channel.
@option options [Object] :team_id
The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.
@see api.slack.com/methods/admin.conversations.create @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.create.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 48 def admin_conversations_create(options = {}) throw ArgumentError.new('Required arguments :is_private missing') if options[:is_private].nil? throw ArgumentError.new('Required arguments :name missing') if options[:name].nil? post('admin.conversations.create', options) end
Delete a public or private channel.
@option options [Object] :channel_id
The channel to delete.
@see api.slack.com/methods/admin.conversations.delete @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.delete.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 61 def admin_conversations_delete(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.delete', options) end
Get conversation preferences for a public or private channel.
@option options [Object] :channel_id
The channel to get preferences for.
@see api.slack.com/methods/admin.conversations.getConversationPrefs @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getConversationPrefs.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 73 def admin_conversations_getConversationPrefs(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.getConversationPrefs', options) end
This API endpoint can be used by any admin to get a channel's retention policy.
@option options [Object] :channel_id
The channel to get the retention policy for.
@see api.slack.com/methods/admin.conversations.getCustomRetention @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getCustomRetention.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 85 def admin_conversations_getCustomRetention(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.getCustomRetention', options) end
Get all the workspaces a given public or private channel is connected to within this Enterprise org.
@option options [Object] :channel_id
The channel to determine connected workspaces within the organization for.
@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
The maximum number of items to return. Must be between 1 - 1000 both inclusive.
@see api.slack.com/methods/admin.conversations.getTeams @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getTeams.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 101 def admin_conversations_getTeams(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? if block_given? Pagination::Cursor.new(self, :admin_conversations_getTeams, options).each do |page| yield page end else post('admin.conversations.getTeams', options) end end
Invite a user to a public or private channel.
@option options [Object] :channel_id
The channel that the users will be invited to.
@option options [Object] :user_ids
The users to invite.
@see api.slack.com/methods/admin.conversations.invite @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.invite.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 121 def admin_conversations_invite(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? throw ArgumentError.new('Required arguments :user_ids missing') if options[:user_ids].nil? post('admin.conversations.invite', options) end
This API endpoint can be used by any admin to remove a channel's retention policy.
@option options [Object] :channel_id
The channel to set the retention policy for.
@see api.slack.com/methods/admin.conversations.removeCustomRetention @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.removeCustomRetention.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 134 def admin_conversations_removeCustomRetention(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.removeCustomRetention', options) end
Rename a public or private channel.
@option options [Object] :channel_id
The channel to rename.
@option options [Object] :name
.
@see api.slack.com/methods/admin.conversations.rename @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.rename.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 148 def admin_conversations_rename(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? throw ArgumentError.new('Required arguments :name missing') if options[:name].nil? post('admin.conversations.rename', options) end
Search
for public or private channels in an Enterprise organization.
@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
Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.
@option options [Object] :query
Name of the the channel to query by.
@option options [Object] :search_channel_types
The type of channel to include or exclude in the search. For example private will search private channels, while private_exclude will exclude them. For a full list of types, check the Types section.
@option options [Object] :sort
Possible values are relevant (search ranking based on what we think is closest), name (alphabetical), member_count (number of users in the channel), and created (date channel was created). You can optionally pair this with the sort_dir arg to change how it is sorted.
@option options [Object] :sort_dir
Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).
@option options [Object] :team_ids
Comma separated string of team IDs, signifying the workspaces to search through.
@see api.slack.com/methods/admin.conversations.search @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.search.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 173 def admin_conversations_search(options = {}) if block_given? Pagination::Cursor.new(self, :admin_conversations_search, options).each do |page| yield page end else post('admin.conversations.search', options) end end
Set the posting permissions for a public or private channel.
@option options [Object] :channel_id
The channel to set the prefs for.
@option options [Object] :prefs
The prefs for this channel in a stringified JSON format.
@see api.slack.com/methods/admin.conversations.setConversationPrefs @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setConversationPrefs.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 192 def admin_conversations_setConversationPrefs(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? throw ArgumentError.new('Required arguments :prefs missing') if options[:prefs].nil? post('admin.conversations.setConversationPrefs', options) end
This API endpoint can be used by any admin to set a channel's retention policy.
@option options [Object] :channel_id
The channel to set the retention policy for.
@option options [Object] :duration_days
The message retention duration in days to set for this channel.
@see api.slack.com/methods/admin.conversations.setCustomRetention @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setCustomRetention.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 207 def admin_conversations_setCustomRetention(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? throw ArgumentError.new('Required arguments :duration_days missing') if options[:duration_days].nil? post('admin.conversations.setCustomRetention', options) end
Set the workspaces in an Enterprise grid org that connect to a public or private channel.
@option options [Object] :channel_id
The encoded channel_id to add or remove to workspaces.
@option options [Object] :org_channel
True if channel has to be converted to an org channel.
@option options [Object] :target_team_ids
A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
@option options [Object] :team_id
The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
@see api.slack.com/methods/admin.conversations.setTeams @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setTeams.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 226 def admin_conversations_setTeams(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.setTeams', options) end
Unarchive a public or private channel.
@option options [Object] :channel_id
The channel to unarchive.
@see api.slack.com/methods/admin.conversations.unarchive @see github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.unarchive.json
# File lib/slack/web/api/endpoints/admin_conversations.rb, line 238 def admin_conversations_unarchive(options = {}) throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? post('admin.conversations.unarchive', options) end