Message search is a feature that retrieves a list of messages that contain a search query from group channels joined by a specific user. You can search for either an exact match or a partial match and even filter the results by message properties such as
The properties of search results are much the same as those of a list of messages, except for the
The total number of messages that contain the search term and match with all the parameters specified.
- All API endpoints are relative to the base URL allocated to the application. In this page, the
/search/messagesendpoint refers to
Retrieves a list of messages that contain a search term.
Note: Message search is limited up to 100 public and private group channels joined by a specified user.
The following table lists the parameters that this action supports.
Specifies the channel url to restrict the search scope to a specific group channel.
Specifies the ID of the target user to restrict the search scope to the messages in the channel of which the target user is currently a member. The search targets up to 100 private and public group channels joined by the user.Urlencoding the value is recommended (for example, ?user_id=urlencoded_id).
Search for messages by the specified query term that matches their content. Urlencoding the value is recommended (for example, ?query=urlencoded_term)
Specifies the custom channel type to restrict the search scope. This custom_type should be specified in conjunction with the user_id.
Specifies the number of messages to return per page. Acceptable values are 1 to 99, inclusive.
Determines whether to search for messages that exactly match the search term. If set to false, it will return partial matches that contain the search term. (Default: false)
Restrict the search scope to the messages sent after the specified value, in Unix milliseconds format. This includes the messages sent exactly on the timestamp.
Restrict the search scope to the messages sent before the specified value in Unix milliseconds format. This includes the messages sent exactly on the timestamp.
Marks the starting point of the search results to retrieve in the result set. The after can’t be specified in conjunction with the before.
Marks the end point of the search results to retrieve in the result set. The before can’t be specified in conjunction with the after.
Determines whether to sort the results in reverse order. If set to true, they are sorted in ascending order. If false, they are sorted in descending order. (Default: false)
Specifies a page token that indicates the starting index of a chunk of results to retrieve. If not specified, the index is set as 0.
Specifies the list of user IDs to restrict the search scope to messages that are sent by the specified IDs. Up to 5 user_ids are allowed per request.
Determines whether to show the detailed information about the target channel in the response. (Default: false)
Query string example
If successful, this action returns a list of messages that contain the search term in the response body like the following.
Status: 200 OK
A list of messages that match with the specified parameters.
The starting index of the current results.
The ending index of the current results.
Indicates whether there is a previous page of results.
Indicates whether there is a next page of results.
The value for the token parameter to retrieve the next page in the result set.