/search.messages
GET
/search.messagesSearches for messages matching a query.
Request
Query Params
token
string
required
Authentication token. Requires scope: search:read
count
integer
optional
Pass the number of results you want per "page". Maximum of 100
.
highlight
string
optional
Pass a value of true
to enable query highlight markers (see below).
page
integer
optional
query
string
required
Search query.
sort
string
optional
Return matches sorted by either score
or timestamp
.
sort_dir
string
optional
Change sort direction to ascending (asc
) or descending (desc
).
Request samples
Responses
Typical success response(200)
Typical error response(500)
Typical success response
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
ok
#/definitions/700149required
Additional properties
integer | number | string | boolean
optional
Exampleresponse
{
"messages": {
"matches": [
{
"channel": {
"id": "C12345678",
"is_ext_shared": false,
"is_mpim": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"is_private": false,
"is_shared": false,
"name": "general",
"pending_shared": []
},
"iid": "cb64bdaa-c1e8-4631-8a91-0f78080113e9",
"permalink": "https://hitchhikers.slack.com/archives/C12345678/p1508284197000015",
"team": "T12345678",
"text": "The meaning of life the universe and everything is 42.",
"ts": "1508284197.000015",
"type": "message",
"user": "U2U85N1RV",
"username": "roach"
},
{
"channel": {
"id": "C12345678",
"is_ext_shared": false,
"is_mpim": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"is_private": false,
"is_shared": false,
"name": "random",
"pending_shared": []
},
"iid": "9a00d3c9-bd2d-45b0-988b-6cff99ae2a90",
"permalink": "https://hitchhikers.slack.com/archives/C12345678/p1508795665000236",
"team": "T12345678",
"text": "The meaning of life the universe and everything is 101010",
"ts": "1508795665.000236",
"type": "message",
"user": "",
"username": "robot overlord"
}
],
"pagination": {
"first": 1,
"last": 2,
"page": 1,
"page_count": 1,
"per_page": 20,
"total_count": 2
},
"paging": {
"count": 20,
"page": 1,
"pages": 1,
"total": 2
},
"total": 2
},
"ok": true,
"query": "The meaning of life the universe and everything"
}
Last modified: a year ago