Search Message
    • Dark
      Light
    • PDF

    Search Message

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/chat.search

    Search for messages by room ID and text message.

    Changelog

    VersionDescription
    0.67.0Changed limit query parameter to count
    0.60.0Added
    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.

    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

    Example 1
    {
      "success": false,
      "error": "The required \"roomId\" query param is missing. [error-roomId-param-not-provided]",
      "errorType": "error-roomId-param-not-provided"
    }
    Example 2
    {
      "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

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.