List Messages

Retrieve all chat messages within a particular dialog. All retrieved chat messages will be marked as read after request. Messages will be marked in 2 cases:

- if the current user ID is in occupants_ids field for type=2 (GROUP) dialog;
- if dialog's type=1 (PUBLIC) dialog.

Recipes
Filter messages by word
Open Recipe
Get message by its ID
Open Recipe
Filter and sort messages
Open Recipe
Get message by its ID with API key
Open Recipe
Filter messages by word with API key
Open Recipe
Filter and sort messages with API key
Open Recipe

Search operators

The request can contain all, some or none of the next search operators:

OperatorDescription
ltLess 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.
lteLess 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.
gtGreater 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.
gteGreater 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.
neNot 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.
inContained 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.
ninNot 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.
orOR 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.
ctnContains substring operator

Types: string

Applicable to fields: message

Example: message[ctn]=party

Returns messages which text contains the word "party".

Sort operators

Next sorting operators are allowed:

OperatorDescription
sort_ascTypes: all types

Example:
sort_asc=field_name

Search results will be sorted by the specified field in ascending order.
sort_descTypes: all types

Example:
sort_desc=field_name

Search results will be sorted by the specified field in descending order.
Language