Developers » API methods » Messages » messages.getHistory
Returns message history for the specified user or group chat.
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.
offsetOffset needed to return a specific subset of messages.
int (number)
countNumber of messages to return.
positive number, default 20, maximum value 200
user_idID of the user whose message history you want to return.
accessible for versions from 5.38
start_message_idStarting message ID from which to return history.
int (number)
revSort order:
1 return messages in chronological order.
0 return messages in reverse chronological order.
int (number)
flag, either 1 or 0
list of comma-separated words
Returns a list of message objects.
936Contact not found
Global errors can occur while running. See their descriptions on this page.
Version historyShow all
The template field was added to the message object.
New format of stickers object. method returns all documents in items array: users documents first and documents from global search after them.

New error: 29: Rate limit reached
Returns new objects with market and market_album type in message and wall attachments.
messages.getHistory method can use rev parameter with start_message_id parameter. start_message_id can be equal 0. friends.edit method return error if specified wrong value of list_ids parameter: Code: 100, Message: invalid list_ids.
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 messages.getDialogs method unread parameter was added, only dialogs with unread inbound messages are returned if it is passed. Count of such dialogs was added in method result as unread_dialogs field (if positive) and count of unread inbound messages is returned for each dialog in unread field (if positive).

In messages.getHistory method rev parameter is not available to use with start_message_id parameter, behaviour of start_message_id and its link with offset has changed, count of unread inbound messages was added to result in unread field (if positive) and count of skipped messages when using start_message_id was added to result in skipped field (if positive).
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.
Empty message body in change chat photo service messages.
Changed uid meaning in some cases. Now it represents message sender.
Affects methods messages.getHistory