Message Search

Allows to search messages based on multiple search parameters.

📘 Optional attributes returned

Note that some attributes are returned in the payload only under specific conditions:

  • sharedMessage only when the message represented by this class is a wall post sharing another message;

  • initialMessageId, initialTimestamp, and replacing only when the corresponding message is sent as an update to another message thanks to Update Message endpoint. Note that the first two attributes relate to the original (and therefore first) message sent, whereas the replacing attribute relates to the message that has been updated by this message;

  • replacedBy only when this message has been updated by a new message. It contains the id of the replacing message.

  • parentMessageId only when this message is a reply or a forward of another message which id is returned in this attribute.

🚧 Important

You should use the POST Message Search endpoint where the query string is specified in the request body if your Agent is in-cloud. With this GET endpoint, query strings will be transmitted in the clear.

Allow to search messages across the message space the authenticated user has access to. This means all rooms this user is a member of and all public rooms.

Query arguments

The query parameter supports the following combination of arguments. When multiple arguments are supported, the search results are the union of all query arguments, defined as argument:value pairs combined by the operator "AND". Only a certain combination of arguments is supported.

Usage

  • At least one argument in the list above is required.

  • To provide multiple arguments, the query is formatted as argument:value, and separated with the operator AND. Returned messages will include messages that match all the arguments.

  • Arguments names and values are case-insensitive.

  • The same argument cannot be used multiple times.

  • Search terms cannot contain the following reserved characters: colon :, parentheses ( ) and whitespaces (except when applying multi-word text search. See the text argument in the table above).

Date selector

The queryparameter can optionally support the following date selectors:

  • fromDate: selects messages sent after fromDate. Supported for all query parameters above.

  • toDate: selects messages sent before toDate. Supported for all query parameters above. The date selector parameter is inclusive: a message sent at exactly the same time as the query fromDate will be included in the results

Examples

  • query=hashtag:newWorld

  • query=hashtag:newWorld AND mention:7627861917906

  • query=hashtag:newWorld AND author:7627861917906 AND streamId:YQ_Q3ml8vMp98so2WRK_W3___qTUhq1_dA

  • query=author:7627861917906

📘 Note

Spaces are expected between query arguments joined with AND.

📘 See also

Message MessageML Message ID Message Format - MessageML PresentationML Message Format - ExtensionML Colors Symphony Elements

Last updated