Message Search
Allows to search messages based on multiple search parameters.
Search messages according to the specified criteria. The "query" parameter takes a search query defined as "field:value" pairs combined by the operator "AND" (e.g. "text:foo AND autor:bar"). Supported fields are (case-insensitive): "text", "author", "hashtag", "cashtag", "mention", "signal", "fromDate", "toDate", "streamId", "streamType". "text" search requires a "streamId" to be specified. "streamType" accepts one of the following values: "chat" (IMs and MIMs), "im", "mim", "chatroom", "post". "signal" queries can only be combined with "fromDate", "toDate", "skip" and "limit" parameters.
The search query. See above for the query syntax.
No. of results to skip.
Max no. of results to return. If no value is provided, 50 is the default.
Describes where content should be searched for that query. It can exclusively apply to Symphony content or to one Connector.
Messages sort direction : ASC or DESC (default to DESC)
Target search tier : hot, warm or all (default to hot)
Session authentication token.
Key Manager authentication token.
OK
A representation of a message sent by a user of Symphony
Id of the message
Id of the parent message, set when the message is a reply to another message or a forwarded message. Since Agent 20.14.
Timestamp of the message in milliseconds since Jan 1 1970
Message content in MessageMLV2
Message data in EntityJSON
Indicates if the message have external recipients. Only present on real time messaging.
Details if event failed to parse for any reason. The contents of this field may not be useful, depending on the nature of the error. Only present when error occurs.
User agent string for client that sent the message. Allows callers to identify which client sent the origin message (e.g. API Agent, SFE Client, mobile, etc)
Indicates the format in which the message was originally sent. This could have been either:
- com.symphony.markdown - Markdown OR Message ML V1
- com.symphony.messageml.v2 - Message ML V2
Message that may be sent along with a regular message if configured for the POD, usually the first message sent in a room that day.
Unique session identifier from where the message was created.
fa691cd3-484a-4109-aeb2-57c05b78c95bId of the message that the current message is replacing (present only if set)
Id of the message that the current message is being replaced with (present only if set)
Timestamp of when the initial message has been created in milliseconds since Jan 1 1970 (present only if set)
Id the the initial message that has been updated (present only if set)
When false the user/s will receive the message update as unread (true by default)
No Messages.
Client error, see response body for further details.
Unauthorized: Session tokens invalid.
Forbidden: Caller lacks necessary entitlement.
Server error, see response body for further details.
GET /agent/v1/message/search?query=text HTTP/1.1
Host: youragentURL.symphony.com
sessionToken: text
Accept: */*
[
{
"messageId": "text",
"parentMessageId": "text",
"timestamp": 1,
"message": "text",
"sharedMessage": {
"messageId": "text",
"parentMessageId": "text",
"timestamp": 1,
"message": "text",
"sharedMessage": {
"messageId": "text",
"parentMessageId": "text",
"timestamp": 1,
"message": "text",
"sharedMessage": {
"messageId": "text",
"parentMessageId": "text",
"timestamp": 1,
"message": "text",
"sharedMessage": {
"messageId": "text",
"parentMessageId": "text",
"timestamp": 1,
"message": "text",
"sharedMessage": "[Circular Reference]",
"data": "text",
"attachments": [
{
"id": "text",
"name": "text",
"size": 1,
"images": [
{
"id": "text",
"dimension": "text"
}
]
}
],
"user": {
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
},
"stream": {
"streamId": "text",
"streamType": "text",
"roomName": "text",
"members": [
{
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
}
],
"external": true,
"crossPod": true,
"recipientTenantIds": [
1
]
},
"externalRecipients": true,
"diagnostic": "text",
"userAgent": "text",
"originalFormat": "text",
"disclaimer": "text",
"sid": "fa691cd3-484a-4109-aeb2-57c05b78c95b",
"replacing": "text",
"replacedBy": "text",
"initialTimestamp": 1,
"initialMessageId": "text",
"silent": true
},
"data": "text",
"attachments": [
{
"id": "text",
"name": "text",
"size": 1,
"images": [
{
"id": "text",
"dimension": "text"
}
]
}
],
"user": {
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
},
"stream": {
"streamId": "text",
"streamType": "text",
"roomName": "text",
"members": [
{
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
}
],
"external": true,
"crossPod": true,
"recipientTenantIds": [
1
]
},
"externalRecipients": true,
"diagnostic": "text",
"userAgent": "text",
"originalFormat": "text",
"disclaimer": "text",
"sid": "fa691cd3-484a-4109-aeb2-57c05b78c95b",
"replacing": "text",
"replacedBy": "text",
"initialTimestamp": 1,
"initialMessageId": "text",
"silent": true
},
"data": "text",
"attachments": [
{
"id": "text",
"name": "text",
"size": 1,
"images": [
{
"id": "text",
"dimension": "text"
}
]
}
],
"user": {
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
},
"stream": {
"streamId": "text",
"streamType": "text",
"roomName": "text",
"members": [
{
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
}
],
"external": true,
"crossPod": true,
"recipientTenantIds": [
1
]
},
"externalRecipients": true,
"diagnostic": "text",
"userAgent": "text",
"originalFormat": "text",
"disclaimer": "text",
"sid": "fa691cd3-484a-4109-aeb2-57c05b78c95b",
"replacing": "text",
"replacedBy": "text",
"initialTimestamp": 1,
"initialMessageId": "text",
"silent": true
},
"data": "text",
"attachments": [
{
"id": "text",
"name": "text",
"size": 1,
"images": [
{
"id": "text",
"dimension": "text"
}
]
}
],
"user": {
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
},
"stream": {
"streamId": "text",
"streamType": "text",
"roomName": "text",
"members": [
{
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
}
],
"external": true,
"crossPod": true,
"recipientTenantIds": [
1
]
},
"externalRecipients": true,
"diagnostic": "text",
"userAgent": "text",
"originalFormat": "text",
"disclaimer": "text",
"sid": "fa691cd3-484a-4109-aeb2-57c05b78c95b",
"replacing": "text",
"replacedBy": "text",
"initialTimestamp": 1,
"initialMessageId": "text",
"silent": true
},
"data": "text",
"attachments": [
{
"id": "text",
"name": "text",
"size": 1,
"images": [
{
"id": "text",
"dimension": "text"
}
]
}
],
"user": {
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
},
"stream": {
"streamId": "text",
"streamType": "text",
"roomName": "text",
"members": [
{
"userId": 1,
"firstName": "text",
"lastName": "text",
"displayName": "text",
"email": "text",
"username": "text"
}
],
"external": true,
"crossPod": true,
"recipientTenantIds": [
1
]
},
"externalRecipients": true,
"diagnostic": "text",
"userAgent": "text",
"originalFormat": "text",
"disclaimer": "text",
"sid": "fa691cd3-484a-4109-aeb2-57c05b78c95b",
"replacing": "text",
"replacedBy": "text",
"initialTimestamp": 1,
"initialMessageId": "text",
"silent": true
}
]📘 Optional attributes returned
Note that some attributes are returned in the payload only under specific conditions:
sharedMessageonly when the message represented by this class is a wall post sharing another message;
initialMessageId,initialTimestamp, andreplacingonly 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 thereplacingattribute relates to the message that has been updated by this message;
replacedByonly when this message has been updated by a new message. It contains the id of the replacing message.
parentMessageIdonly 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.
hashtag
Searches for a specific hashtag across messages to or in a specific streamType
Can be used in conjunction with
cashtagormention.Can be used in conjunction to
authorortextonly for a specificstreamType
cashtag
Searches for a specific cashtag across all messages or in a specific streamType
Can be used in conjunction with
hashtagormention.Can be used in conjunction to
authorortextonly for a specificstreamType
mention
Searches for a specific user mention, by user id, across all messages or in a specific streamType
Can be used in conjunction with
hashtagorcashtag.Can be used in conjunction to
authorortextonly for a specificstreamType
author
Searches for a specific message author, by user id, across all messages or for a specific streamType
(1.52 and later) You can now search for an author in conjunction with a specific streamType
text
Searches for plain text field in a specific message, not including any hashtag, cashtag or user mention.
Requires a
streamIdto be provided.Searching for text across all messages or a specific
streamTypeis not supported.Multi-word search is allowed. Syntax:
"text":"Hello World"
streamType
Searches for messages in a specific stream type, either:
• CHAT (1-1 instant messages and multi-party instant messages),
• IM (1-1 instant message),
• MIM (multi-party instant message),
• ROOM, or
• POST (user profile wall posts).
Can be used in conjunction with author, hashtag, cashtag or mention
streamId
Searches for messages in a specific stream. See Conversation ID for streamId format.
Can be used in conjunction with hashtag, cashtag, mention, text or author
signal
Search for messages matching this signal.
Can only be combined with date filtering and paging parameters.
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 operatorAND. 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 thetextargument in the table above).
Date selector
The queryparameter can optionally support the following date selectors:
fromDate: selects messages sent afterfromDate. Supported for all query parameters above.toDate: selects messages sent beforetoDate. Supported for all query parameters above. The date selector parameter is inclusive: a message sent at exactly the same time as the queryfromDatewill be included in the results
Examples
query=hashtag:newWorldquery=hashtag:newWorld AND mention:7627861917906query=hashtag:newWorld AND author:7627861917906 AND streamId:YQ_Q3ml8vMp98so2WRK_W3___qTUhq1_dAquery=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
Was this helpful?