Chat
List Messages
Retrieve all chat messages within a particular dialog.
GET
Documentation Index
Fetch the complete documentation index at: https://docs.quickblox.com/llms.txt
Use this file to discover all available pages before exploring further.
Recipes
Filter messages by word
Filter messages by word
2. Set a search operator for a field
Apply a search operator to the query. Here, a
ctn operator is applied to a message field with the guys value.Filter and sort messages
Filter and sort messages
2. Set a search operator for a field
Apply a search operator to the query. Here, the
lt operator is applied to a date_sent field.3. Set a sort operator for a field
Use a sort operator to order the search results by the field. Here, the
sort_desc operator is applied to the date_sent field.Get message by its ID
Get message by its ID
Get message by its ID with API key
Get message by its ID with API key
Filter messages by word with API key
Filter messages by word with API key
4. Set a search operator for a field
Apply a search operator to the query. Here, a
ctn operator is applied to a message field with the guys value.Filter and sort messages with API key
Filter and sort messages with API key
4. Set a search operator for a field
Apply a search operator to the query. Here, the
lt operator is applied to a date_sent field.5. Set a sort operator for a field
Use a sort operator to order the search results by the field. Here, the
sort_desc operator is applied to the date_sent field.Messages will be marked in 2 cases:
- if the current user ID is in
occupants_idsfield fortype=2(GROUP) dialog; - if dialog’s
type=1(PUBLIC) dialog.
| Operator | Description |
|---|---|
| lt | Less Than operator Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id, updated_at Example: date_sent[lt]=1556829805 Description: Will return messages with date_sent less than 1556829805. |
| lte | Less Than or Equal to operator Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id, updated_at Example: updated_at[lte]=1556829805 Will return messages with updated_at less than or equal 1556829805. |
| gt | Greater Than operator Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id, updated_at Example: date_sent[gt]=1556829805 Will return messages with date_sent greater than 1556829805. |
| gte | Greater Than or Equal to operator Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id, updated_at Example: date_sent[gte]=1556829805 Will return messages with date_sent greater than or equal 1556829805. |
| ne | Not Equal to operator Types: number, string, date Applicable to fields: _id, message, date_sent, sender_id, recipient_id Example: recipient_id[ne]=9988237 Will return messages with recipient_id not equal to 9988237. |
| in | Contained IN array operator Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id Example: sender_id[in]=91419276,91419395 Will return messages with sender_id equal to 91419276 and equal to 91419395. |
| nin | Not contained IN array Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id Example: recipient_id[nin]=91419276,91419395 Will return messages with recipient_id not equal to 91419276 and 91419395. |
| or | OR operator Types: number, string, date Applicable to fields: date_sent, sender_id, recipient_id Example: sender_id[or]=91419390,96753878 Will return messages with sender_id equal to 91419390 or 96753878. |
| ctn | Contains substring operator Types: string Applicable to fields: message Example: message[ctn]=party Returns messages which text contains the word “party”. |
| Operator | Description |
|---|---|
| sort_asc | Types: all types Example: sort_asc=field_name Search results will be sorted by the specified field in ascending order. |
| sort_desc | Types: all types Example: sort_desc=field_name Search results will be sorted by the specified field in descending order. |
Query Parameters
ID of the dialog.
Search records with the field that contains the specified value. Can be many 1..N.
Filters records with field which contains value according to specified value and operator. Can be many 1..N.
Mark the requested message as read. Set
mark_as_read=1 to perform. As a result, when the message is retreived by the opponent, the opponent ID is added to the array of read_ids field. Works only if the message had the unread status previously, not backwards. You can update message status using the Update Message request. Limit search results to N records. Useful for pagination.
Skip N records in search results. Useful for pagination.
Count search results. Response will contain only a count of found records.
Search results will be sorted by a specified field in descending order.
Search results will be sorted by a specified field in ascending order.
Headers
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
API key from Dashboard. Expected format:
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.User ID. The user ID of the user on whose behalf the request is being made.
Responses
403
403
An error response
404
404
An error response