Module: Slack::Web::Api::Endpoints::AdminConversations

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

Instance Method Summary collapse

Instance Method Details

#admin_conversations_archive(options = {}) ⇒ Object

Archive a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to archive.

See Also:



16
17
18
19
# 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

#admin_conversations_convertToPrivate(options = {}) ⇒ Object

Convert a public channel to a private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to convert to private.

See Also:



28
29
30
31
# 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

#admin_conversations_create(options = {}) ⇒ Object

Create a public or private channel-based conversation.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :is_private (Object)

    When true, creates a private channel instead of a public channel.

  • :name (Object)

    Name of the public or private channel to create.

  • :description (Object)

    Description of the public or private channel to create.

  • :org_wide (Object)

    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.

  • :team_id (Object)

    The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.

See Also:



48
49
50
51
52
# 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

#admin_conversations_delete(options = {}) ⇒ Object

Delete a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to delete.

See Also:



61
62
63
64
# 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

#admin_conversations_getConversationPrefs(options = {}) ⇒ Object

Get conversation preferences for a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to get preferences for.

See Also:



73
74
75
76
# 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

#admin_conversations_getCustomRetention(options = {}) ⇒ Object

This API endpoint can be used by any admin to get a channel’s retention policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to get the retention policy for.

See Also:



85
86
87
88
# 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

#admin_conversations_getTeams(options = {}) ⇒ Object

Get all the workspaces a given public or private channel is connected to within this Enterprise org.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to determine connected workspaces within the organization for.

  • :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.

See Also:



101
102
103
104
105
106
107
108
109
110
# 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

#admin_conversations_invite(options = {}) ⇒ Object

Invite a user to a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel that the users will be invited to.

  • :user_ids (Object)

    The users to invite.

See Also:



121
122
123
124
125
# 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

#admin_conversations_removeCustomRetention(options = {}) ⇒ Object

This API endpoint can be used by any admin to remove a channel’s retention policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to set the retention policy for.

See Also:



134
135
136
137
# 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

#admin_conversations_rename(options = {}) ⇒ Object

Rename a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to rename.

  • :name (Object)

    .

See Also:



148
149
150
151
152
# 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

#admin_conversations_search(options = {}) ⇒ Object

Search for public or private channels in an Enterprise 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)

    Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.

  • :query (Object)

    Name of the the channel to query by.

  • :search_channel_types (Object)

    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.

  • :sort (Object)

    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.

  • :sort_dir (Object)

    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).

  • :team_ids (Object)

    Comma separated string of team IDs, signifying the workspaces to search through.

See Also:



173
174
175
176
177
178
179
180
181
# 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

#admin_conversations_setConversationPrefs(options = {}) ⇒ Object

Set the posting permissions for a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to set the prefs for.

  • :prefs (Object)

    The prefs for this channel in a stringified JSON format.

See Also:



192
193
194
195
196
# 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

#admin_conversations_setCustomRetention(options = {}) ⇒ Object

This API endpoint can be used by any admin to set a channel’s retention policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to set the retention policy for.

  • :duration_days (Object)

    The message retention duration in days to set for this channel.

See Also:



207
208
209
210
211
# 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

#admin_conversations_setTeams(options = {}) ⇒ Object

Set the workspaces in an Enterprise grid org that connect to a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The encoded channel_id to add or remove to workspaces.

  • :org_channel (Object)

    True if channel has to be converted to an org channel.

  • :target_team_ids (Object)

    A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.

  • :team_id (Object)

    The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.

See Also:



226
227
228
229
# 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

#admin_conversations_unarchive(options = {}) ⇒ Object

Unarchive a public or private channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to unarchive.

See Also:



238
239
240
241
# 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