Search Message

Get
/api/v1/chat.search

Search for messages by room ID and text message.

Changelog

Version Description
0.67.0 Changed limit query parameter to count
0.60.0 Added
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Query parameters
count
integer

The number of items to return. Refer to the official documentation to learn more.

Example50
offset
integer

Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.

Example50
roomId
stringRequired

The room ID.

searchText
stringRequired

The text to search for in messages.

Responses
200

OK

Example 1
{
  "messages": [
    {
      "_id": "px9KLW9G2SfD5DKFt",
      "rid": "GENERAL",
      "msg": "this is a test",
      "ts": "2018-03-27T14:44:00.549Z",
      "u": {
        "_id": "RtMDEYc28fQ5aHpf4",
        "username": "marc.dev",
        "name": "Marc Dev"
      },
      "mentions": [],
      "channels": [],
      "_updatedAt": "2018-03-27T14:44:00.550Z",
      "score": 0.5833333333333334
    }
  ],
  "success": true
}
Expand All
object
messages
Array of object
object
_id
string
rid
string
msg
string
ts
string
u
object
_id
string
username
string
name
string
mentions
Array of object
object
channels
Array of object
object
_updatedAt
string
score
number
success
boolean
400

Bad Request

Missing roomId
{
  "success": false,
  "error": "The required \"roomId\" query param is missing. [error-roomId-param-not-provided]",
  "errorType": "error-roomId-param-not-provided"
}
Missing searchText
{
  "success": false,
  "error": "The required \"searchText\" query param is missing. [error-searchText-param-not-provided]",
  "errorType": "error-searchText-param-not-provided"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string