Developers » API methods » Messages »
Returns a list of the current user's private messages that match search criteria.
This method can be called with a user token received in Standalone-app via Implicit Flow. Access rights required: messages.
This method can be called with a community token. Access rights required: messages.
qSearch query string.
peer_idDestination ID.

For user:
User ID, e.g. 12345.

For chat:
2000000000 + chat_id, e.g. 2000000001.

For community:
- community ID, e.g. -12345.

int (number)
datedate in format DDMMYYYY to search messages have been sent before it.
positive number
preview_lengthNumber of characters after which to truncate a previewed message. To preview the full message, specify 0.
NOTE: Messages are not truncated by default. Messages are truncated by words.

positive number, default 0
offsetOffset needed to return a specific subset of messages.
positive number, default 0
countNumber of messages to return.
positive number, default 20, maximum value 100
extended1 to return additional profiles and groups array with users and communities objects.
flag, either 1 or 0
fieldsList of additional fields for profiles and communities to be returned.
list of comma-separated words
group_idCommunity ID (to use community messages with user's access token).
positive number
Returns an objects with a total number of items in the count (integer) field and an array of messages objects in the items (array) field.

If extended = 1 returns an array of conversation objects in the items (array) field. profiles (array) and groups (array) arrays will be returned additionally.
Global errors can occur while running. See their descriptions on this page.
Version historyShow all
5.86 method returns an array of conversation objects if extended parameter is set to 1.

Changes in stats.get method:
  • date_from and date_to parameters are obsolete. timestamp_from ans timestamp_to to be used instead integers representing Unix timestamp.
  • New stats_groups parameter has been added. It allows to filter separate blocks in statistics. Possible values: visitors, reach, activity.
  • period_from and period_to are integers representing Unix timestamp.
Affects methods, stats.get
Returns new objects with market and market_album type in message and wall attachments.
Returns new fields for message attachments with link type: caption, is_external, product, application, rating and button.
apps.get apps.getCatalog methods returns photo object for screenshots fields. Add in_read, out_read fields in response of messages.getDialogs, messages.getHistory and messages.getLongPollHistory methods. Add peer_id parameter for messages.send, messages.sendSticker, messages.deleteDialog, messages.setActivity and messages.getHistory methods.
In all methods that return people objects, photo, photo_medium_rec fields were renamed to photo_50, photo_100.
In wall attachment from and copy_owner fields return as user or community object, not array.
Links attached to messages now represented as attachment objects, not link in message text
Represent gifts as special object, not as attached document anymore
chat_active field returns as array, not string.
First element of result represents total count of elements.
Affects methods photos.get