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.

Raises:

  • (ArgumentError)

See Also:



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

def admin_conversations_archive(options = {})
  raise ArgumentError, '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.

  • :name (string)

    Name of private channel to create. Only respected when converting an MPIM.

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 30

def admin_conversations_convertToPrivate(options = {})
  raise ArgumentError, '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 (boolean)

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

  • :name (string)

    Name of the public or private channel to create.

  • :description (string)

    Description of the public or private channel to create.

  • :org_wide (boolean)

    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.

Raises:

  • (ArgumentError)

See Also:



50
51
52
53
54
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 50

def admin_conversations_create(options = {})
  raise ArgumentError, 'Required arguments :is_private missing' if options[:is_private].nil?
  raise ArgumentError, '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.

Raises:

  • (ArgumentError)

See Also:



63
64
65
66
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 63

def admin_conversations_delete(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  post('admin.conversations.delete', options)
end

#admin_conversations_disconnectShared(options = {}) ⇒ Object

Disconnect a connected channel from one or more workspaces.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (Object)

    The channel to be disconnected from some workspaces.

  • :leaving_team_ids (array)

    team IDs getting removed from the channel, optional if there are only two teams in the channel.

Raises:

  • (ArgumentError)

See Also:



77
78
79
80
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 77

def admin_conversations_disconnectShared(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  post('admin.conversations.disconnectShared', 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.

Raises:

  • (ArgumentError)

See Also:



89
90
91
92
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 89

def admin_conversations_getConversationPrefs(options = {})
  raise ArgumentError, '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 conversation’s retention policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (string)

    The conversation to get the retention policy for.

Raises:

  • (ArgumentError)

See Also:



101
102
103
104
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 101

def admin_conversations_getCustomRetention(options = {})
  raise ArgumentError, '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 (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.

Raises:

  • (ArgumentError)

See Also:



117
118
119
120
121
122
123
124
125
126
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 117

def admin_conversations_getTeams(options = {})
  raise ArgumentError, '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 (array)

    The users to invite.

Raises:

  • (ArgumentError)

See Also:



137
138
139
140
141
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 137

def admin_conversations_invite(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  raise ArgumentError, '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 conversation’s retention policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (string)

    The conversation to set the retention policy for.

Raises:

  • (ArgumentError)

See Also:



150
151
152
153
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 150

def admin_conversations_removeCustomRetention(options = {})
  raise ArgumentError, '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 (string)

    .

Raises:

  • (ArgumentError)

See Also:



164
165
166
167
168
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 164

def admin_conversations_rename(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  raise ArgumentError, '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):

  • :connected_team_ids (array)

    Array of encoded team IDs, signifying the external orgs to search through.

  • :cursor (string)

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

  • :limit (integer)

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

  • :query (string)

    Name of the the channel to query by.

  • :search_channel_types (array)

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

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

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

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

See Also:



191
192
193
194
195
196
197
198
199
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 191

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

    The channel to set the prefs for.

  • :prefs (string)

    The prefs for this channel in a stringified JSON format.

Raises:

  • (ArgumentError)

See Also:



210
211
212
213
214
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 210

def admin_conversations_setConversationPrefs(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  raise ArgumentError, '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 conversation’s retention policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_id (string)

    The conversation to set the retention policy for.

  • :duration_days (integer)

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

Raises:

  • (ArgumentError)

See Also:



225
226
227
228
229
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 225

def admin_conversations_setCustomRetention(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  raise ArgumentError, '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 (string)

    The encoded channel_id to add or remove to workspaces.

  • :org_channel (boolean)

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

  • :target_team_ids (array)

    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.

Raises:

  • (ArgumentError)

See Also:



244
245
246
247
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 244

def admin_conversations_setTeams(options = {})
  raise ArgumentError, '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.

Raises:

  • (ArgumentError)

See Also:



256
257
258
259
# File 'lib/slack/web/api/endpoints/admin_conversations.rb', line 256

def admin_conversations_unarchive(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  post('admin.conversations.unarchive', options)
end