Module: Slack::Web::Api::Endpoints::Search

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

Instance Method Summary collapse

Instance Method Details

#search_all(options = {}) ⇒ Object

Searches for messages and files matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :highlight (Object)

    Pass a value of true to enable query highlight markers (see below).

  • :sort (Object)

    Return matches sorted by either score or timestamp.

  • :sort_dir (Object)

    Change sort direction to ascending (asc) or descending (desc).

  • :team_id (Object)

    encoded team id to search in, required if org token is used.

See Also:



24
25
26
27
# File 'lib/slack/web/api/endpoints/search.rb', line 24

def search_all(options = {})
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
  post('search.all', options)
end

#search_files(options = {}) ⇒ Object

Searches for files matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query.

  • :highlight (Object)

    Pass a value of true to enable query highlight markers (see below).

  • :sort (Object)

    Return matches sorted by either score or timestamp.

  • :sort_dir (Object)

    Change sort direction to ascending (asc) or descending (desc).

  • :team_id (Object)

    encoded team id to search in, required if org token is used.

See Also:



44
45
46
47
# File 'lib/slack/web/api/endpoints/search.rb', line 44

def search_files(options = {})
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
  post('search.files', options)
end

#search_messages(options = {}) ⇒ Object

Searches for messages matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query.

  • :highlight (Object)

    Pass a value of true to enable query highlight markers (see below).

  • :sort (Object)

    Return matches sorted by either score or timestamp.

  • :sort_dir (Object)

    Change sort direction to ascending (asc) or descending (desc).

  • :team_id (Object)

    encoded team id to search in, required if org token is used.

See Also:



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

def search_messages(options = {})
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
  post('search.messages', options)
end