Work with Search

The following are Apex classes for the Slack search API methods.

Represents an item that matches a search query.

The following are methods for MatchedItem.

Signature

Return Value

Type: String

Signature

Return Value

Type: List<Slack.MatchedItem.Address>

Signature

Return Value

Type: Slack.Channel

Signature

Return Value

Type: Integer

Signature

Return Value

Type: String

Signature

Return Value

Type: List<String>

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: List<Slack.MatchedItem.Address>

Signature

Return Value

Type: List<String>

The ID of the matching file item.

Signature

Return Value

Type: String

Gets the ID of the matching message item.

Signature

Return Value

Type: String

Signature

Return Value

Type: Integer

Signature

Return Value

Type: List<String>

Signature

Return Value

Type: String

Signature

Return Value

Type: Integer

Signature

Return Value

Type: Integer

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: Slack.MatchedItem.OtherItem

Signature

Return Value

Type: Slack.MatchedItem.OtherItem

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: Slack.MatchedItem.OtherItem

Signature

Return Value

Type: Slack.MatchedItem.OtherItem

Signature

Return Value

Type: String

Signature

Return Value

Type: Integer

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: List<Slack.MatchedItem.Address>

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: Integer

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Booolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Return Value

Type: Boolean

Signature

Parameters

botId

Type: String

Return Value

Type: void

Signature

Parameters

cc

Type: List<Slack.MatchedItem.Address>

Return Value

Type: void

Signature

Parameters

channel

Type: Slack.Channel

Return Value

Type: void

Signature

Parameters

channelActionsCount

Type: Integer

Return Value

Type: void

Signature

Parameters

channelActionsTs

Type: String

Return Value

Type: void

Signature

Parameters

channels

Type: List<String>

Return Value

Type: void

Signature

Parameters

comment

Type: String

Return Value

Type: void

Signature

Parameters

created

Type: String

Return Value

Type: void

Signature

Parameters

deanimateGif

Type: String

Return Value

Type: void

Signature

Parameters

displayAsBot

Type: Boolean

Return Value

Type: void

Signature

Parameters

editable

Type: Boolean

Return Value

Type: void

Signature

Parameters

editLink

Type: String

Return Value

Type: void

Signature

Parameters

editor

Type: String

Return Value

Type: void

Signature

Parameters

external

Type: Boolean

Return Value

Type: void

Signature

Parameters

externalId

Type: String

Return Value

Type: void

Signature

Parameters

externalType

Type: String

Return Value

Type: void

Signature

Parameters

externalUrl

Type: String

Return Value

Type: void

Signature

Parameters

fileId

Type: String

Return Value

Type: void

Signature

Parameters

filetype

Type: String

Return Value

Type: void

Signature

Parameters

fromValue

Type: List<Slack.MatchedItem.Address>

Return Value

Type: void

Signature

Parameters

groups

Type: List<String>

Return Value

Type: void

Signature

Parameters

hasMore

Type: Boolean

Return Value

Type: void

Signature

Parameters

hasRichPreview

Type: Boolean

Return Value

Type: void

Signature

Parameters

id

Type: String

Return Value

Type: void

Signature

Parameters

iid

Type: String

Return Value

Type: void

Signature

Parameters

imageExifRotation

Type: Integer

Return Value

Type: void

Signature

Parameters

ims

Type: List<String>

Return Value

Type: void

Signature

Parameters

lastEditor

Type: String

Return Value

Type: void

Signature

Parameters

lines

Type: Integer

Return Value

Type: void

Signature

Parameters

linesMore

Type: Integer

Return Value

Type: void

Signature

Parameters

mimetype

Type: mimetype

Return Value

Type: void

Signature

Parameters

mode

Type: String

Return Value

Type: void

Signature

Parameters

mpim

Type: Boolean

Return Value

Type: void

Signature

Parameters

name

Type: String

Return Value

Type: void

Signature

Parameters

next

Type: Slack.MatchedItem.OtherItem

Return Value

Type: void

Signature

Parameters

next2

Type: Slack.MatchedItem.OtherItem

Return Value

Type: void

Signature

Parameters

nonOwnerEditable

Type: Boolean

Return Value

Type: void

Signature

Parameters

noReactions

Type: Boolean

Return Value

Type: void

Signature

Parameters

originalHeight

Type: String

Return Value

Type: void

Signature

Parameters

originalWidth

Type: String

Return Value

Type: void

Signature

Parameters

permalink

Type: String

Return Value

Type: void

Signature

Parameters

permalinkPublic

Type: Boolean

Return Value

Type: void

Signature

Parameters

plainText

Type: String

Return Value

Type: void

Signature

Parameters

prettyType

Type: String

Return Value

Type: void

Signature

Parameters

preview

Type: String

Return Value

Type: void

Signature

Parameters

previewHighlight

Type: String

Return Value

Type: void

Signature

Parameters

previewPlainText

Type: String

Return Value

Type: void

Signature

Parameters

previewTruncated

Type: Boolean

Return Value

Type: void

Signature

Parameters

previous

Type: Slack.MatchedItem.OtherItem

Return Value

Type: void

Signature

Parameters

previous

Type: Slack.MatchedItem.OtherItem

Return Value

Type: void

Signature

Parameters

_public

Type: Boolean

Return Value

Type: void

Signature

Parameters

publicUrlShared

Type: Boolean

Return Value

Type: void

Signature

Parameters

score

Type: String

Return Value

Type: void

Signature

Parameters

sentToSelf

Type: Boolean

Return Value

Type: void

Signature

Parameters

size

Type: Integer

Return Value

Type: void

Signature

Parameters

sourceTeam

Type: String

Return Value

Type: void

Signature

Parameters

starred

Type: Boolean

Return Value

Type: void

Signature

Parameters

subject

Type: String

Return Value

Type: void

Signature

Parameters

team

Type: String

Return Value

Type: void

Signature

Parameters

Type: String

Return Value

Type: void

Signature

Parameters

thumb64

Type: String

Return Value

Type: void

Signature

Parameters

thumb64Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb64Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb64Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb80

Type: String

Return Value

Type: void

Signature

Parameters

thumb80Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb80Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb80Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb160

Type: String

Return Value

Type: void

Signature

Parameters

thumb160Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb160Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb160Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb360

Type: String

Return Value

Type: void

Signature

Parameters

thumb360Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb360Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb360Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb480

Type: String

Return Value

Type: void

Signature

Parameters

thumb480Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb480Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb480Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb720

Type: String

Return Value

Type: void

Signature

Parameters

thumb720Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb720Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb720Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb800

Type: String

Return Value

Type: void

Signature

Parameters

thumb800Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb800Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb800Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb960

Type: String

Return Value

Type: void

Signature

Parameters

thumb960Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb960Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb960Width

Type: String

Return Value

Type: void

Signature

Parameters

thumb1024

Type: String

Return Value

Type: void

Signature

Parameters

thumb1024Gif

Type: String

Return Value

Type: void

Signature

Parameters

thumb1024Height

Type: String

Return Value

Type: void

Signature

Parameters

thumb1024Width

Type: String

Return Value

Type: void

Signature

Parameters

thumbPdf

Type: String

Return Value

Type: void

Signature

Parameters

thumbPdfHeight

Type: String

Return Value

Type: void

Signature

Parameters

thumbPdfWidth

Type: String

Return Value

Type: void

Signature

Parameters

thumbTiny

Type: String

Return Value

Type: void

Signature

Parameters

timestamp

Type: String

Return Value

Type: void

Signature

Parameters

title

Type: String

Return Value

Type: void

Signature

Parameters

to

Type: List<Slack.MatchedItem.Address>

Return Value

Type: void

Signature

Parameters

topFile

Type: Boolean

Return Value

Type: void

Signature

Parameters

ts

Type: String

Return Value

Type: void

Signature

Parameters

type

Type: String

Return Value

Type: void

Signature

Parameters

updated

Type: Integer

Return Value

Type: void

Signature

Parameters

urlPrivate

Type: String

Return Value

Type: void

Signature

Parameters

urlPrivateDownload

Type: Boolean

Return Value

Type: void

Signature

Parameters

user

Type: String

Return Value

Type: void

Signature

Parameters

username

Type: String

Return Value

Type: void

Signature

Parameters

userTeam

Type: String

Return Value

Type: void

The following are methods for MatchedItem.Address.

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Parameters

address

Type: String

Return Value

Type: void

Signature

Parameters

name

Type: String

Return Value

Type: void

Signature

Parameters

original

Type: String

Return Value

Type: void

The following are methods for MatchedItem.OtherItem.

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Return Value

Type: String

Signature

Parameters

iid

Type: String

Return Value

Type: void

Signature

Parameters

permalink

Type: String

Return Value

Type: void

Signature

Parameters

text

Type: String

Return Value

Type: void

Signature

Parameters

ts

Type: String

Return Value

Type: void

Signature

Parameters

type

Type: String

Return Value

Type: void

Signature

Parameters

user

Type: String

Return Value

Type: void

Signature

Parameters

username

Type: String

Return Value

Type: void

Represents search result for a query. Use SearchResult with Paging to work with results returned from a search query. See Slack's search.all method.

The following are methods for SearchResult.

Signature

Return Value

Type: List<Slack.MatchedItem>

Signature

Return Value

Type: Slack.SearchResult.Pagination

Signature

Return Value

Type: Slack.Paging

Signature

Return Value

Type: List<String>

Signature

Return Value

Type: Integer

Signature

Parameters

matches

Type: List<Slack.MatchedItem>

Return Value

Type: void

Signature

Parameters

pagination

Type: Slack.SearchResult.Pagination

Return Value

Type: void

Signature

Parameters

pagination

Type: Slack.Paging

Return Value

Type: void

Signature

Parameters

refinements

Type: List<String>

Return Value

Type: void

Signature

Parameters

total

Type: Integer

Return Value

Type: void

The following are methods for SearchResult.Pagination.

Signature

Return Value

Type: Integer

Signature

Return Value

Type: Integer

Signature

Return Value

Type: Integer

Signature

Return Value

Type: Integer

Signature

Return Value

Type: Integer

Signature

Return Value

Type: Integer

Signature

Parameters

first

Type: Integer

Return Value

Type: void

Signature

Parameters

last

Type: Integer

Return Value

Type: void

Signature

Parameters

page

Type: Integer

Return Value

Type: void

Signature

Parameters

pageCount

Type: Integer

Return Value

Type: void

Signature

Parameters

perPage

Type: Integer

Return Value

Type: void

Signature

Parameters

totalCount

Type: Integer

Return Value

Type: void

Sends a request to search for messages and files matching a query.

Usage

See Slack’s search.all method.

The following are methods for SearchAllRequest.

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.SearchAllRequest.Builder

Contains methods to build an instance of the Slack.SearchAllRequest class.

A Builder object is obtained by invoking one of the SearchAllRequest.builder methods defined by the SearchAllRequest class.

The following are methods for SearchAllRequest.Builder. These methods are optional unless specified otherwise.

Required. Returns an instance of Slack.SearchAllRequest.

Signature

Return Value

Type: Slack.SearchAllRequest

Number of items to return per page. The default is 20.

Signature

Parameters

count

Type: Integer

Return Value

Type: Slack.SearchAllRequest.Builder

Specifies whether to enable query highlight markers.

Signature

Parameters

highlight

Type: Boolean

Return Value

Type: Slack.SearchAllRequest.Builder

Page number of results to return. The default is 1.

Signature

Parameters

page

Type: Integer

Return Value

Type: Slack.SearchAllRequest.Builder

Required. The search query, which can contain booleans.

Signature

Parameters

query

Type: String

Return Value

Type: Slack.SearchAllRequest.Builder

Changes sort direction. Valid values are: asc (ascending), and desc (descending). The default is desc.

Signature

Parameters

sortDir

Type: String

Signature

Parameters

sortType

Type: String

Return Value

Type: Slack.SearchAllRequest.Builder

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.SearchAllRequest.Builder

Searches for messages and files matching a query.

Usage See Slack’s search.all method.

This class contains standard response methods.

The following are methods for SearchAllResponse.

Signature

Return Value

Type: Slack.SearchResult

Signature

Return Value

Type: Slack.SearchResult

Signature

Return Value

Type: Slack.SearchAllResponse.Posts

Signature

Return Value

Type: String

Signature

Parameters

files

Type: Slack.SearchResult

Return Value

Type: void

Signature

Parameters

messages

Type: Slack.SearchResult

Return Value

Type: void

Signature

Parameters

posts

Type: Slack.SearchAllResponse.Posts

Return Value

Type: void

Signature

Parameters

query

Type: String

Return Value

Type: void

Contains methods to build an instance of the Slack.SearchAllResponse class.

A Posts object is obtained by invoking one of the SearchAllRequest.Posts methods defined by the SearchAllRequest class.

The following are methods for SearchAllResponse.Posts.

Signature

Return Value

Type: List<String>

Signature

Return Value

Type: Integer

Signature

Parameters

matches

Type: List<String>

Return Value

Type: void

Signature

Parameters

total

Type: Integer

Return Value

Type: void

Sends a request to search for files matching a query.

Usage See Slack’s search.files method.

The following are methods for SearchFilesRequest.

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.SearchFilesRequest.Builder

Contains methods to build an instance of the Slack.SearchFilesRequest class.

A Builder object is obtained by invoking one of the SearchFilesRequest.builder methods defined by the SearchFilesRequest class.

The following are methods for SearchFilesRequest.Builder. These methods are optional unless specified otherwise.

Required. Returns an instance of Slack.SearchFilesRequest.

Signature

Return Value

Type: Slack.SearchFilesRequest

Number of items to return per page. The default is 20.

Signature

Parameters

count

Type: Integer

Return Value

Type: Slack.SearchFilesRequest.Builder

Specifies whether to enable query highlight markers.

Signature

Parameters

highlight

Type: Boolean

Return Value

Type: Slack.SearchFilesRequest.Builder

The page number of the results to return. The default is 1.

Signature

Parameters

page

Type: Integer

Return Value

Type: Slack.SearchFilesRequest.Builder

Required. The search query.

Signature

Parameters

query

Type: String

Return Value

Type: Slack.SearchFilesRequest.Builder

Changes sort direction. Valid values are asc (ascending) and desc (descending). The default is desc.

Signature

Parameters

sortDir

Type: String

Return Value

Type: Slack.SearchFilesRequest.Builder

Returns martches sorted by score or timestamp. The default is score.

Signature

Parameters

sortValue

Type: String

Return Value

Type: Slack.SearchFilesRequest.Builder

The encoded team ID to search in, which is required if org token is used.

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.SearchFilesRequest.Builder

Searches for files matching a query.

Usage See Slack’s search.files method.

This class contains standard response methods.

The following are methods for SearchFilesResponse.

Signature

Return Value

Type: Slack.SearchResult

Signature

Return Value

Type: String

Signature

Parameters

files

Type: Slack.SearchResult

Return Value

Type: void

Signature

Parameters

query

Type: String

Return Value

Type: void

Sends a request to search for messages matching a query.

Usage See Slack’s search.messages method.

The following are methods for SearchMessagesRequest.

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.SearchMessagesRequest.Builder.

Contains methods to build an instance of the Slack.SearchMessagesRequest class.

A Builder object is obtained by invoking one of the SearchMessagesRequest.builder methods defined by the SearchMessagesRequest class.

The following are methods for SearchMessagesRequest.Builder. These methods are optional unless specified otherwise.

Required. Returns an instance of Slack.SearchMessagesRequest.

Signature

Return Value

Type: Slack.SearchMessagesRequest

Number of items to return per page. The default is 20.

Signature

Parameters

count

Type: Integer

Return Value

Type: Slack.SearchMessagesRequest.Builder

Signature

Parameters

cursor

Type: String

Return Value

Type: Slack.SearchMessagesRequest.Builder

Specifies whether to enable query highlight markers.

Signature

Parameters

highlight

Type: Boolean

Return Value

Type: Slack.SearchMessagesRequest.Builder

The page number of the results to return. The default is 1.

Signature

Parameters

page

Type: Integer

Return Value

Type: Slack.SearchMessagesRequest.Builder

Required. The search query.

Signature

Parameters

query

Type: String

Return Value

Type: Slack.SearchMessagesRequest.Builder

Changes sort direction. Valid values are asc (ascending) and desc (descending). The default is desc.

Signature

Parameters

sortDir

Type: String

Return Value

Type: Slack.SearchMessagesRequest.Builder

Returns martches sorted by score or timestamp. The default is score.

Signature

Parameters

sortValue

Type: String

Return Value

Type: Slack.SearchMessagesRequest.Builder

The encoded team ID to search in, which is required if org token is used.

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.SearchMessagesRequest.Builder

Searches for messages matching a query.

Usage See Slack’s search.messages method.

This class contains standard response methods.

The following are methods for SearchMessagesResponse.

Signature

Return Value

Type: Slack.SearchResult

Signature

Return Value

Type: String

Signature

Parameters

messages

Type: Slack.SearchResult

Return Value

Type: void

Signature

Parameters

query

Type: String

Return Value

Type: void