messages

messages.getHistory

Returns message history for the specified user or group chat.

To call this method, you can use:
• user access token obtained in the standalone app through Implicit Flow (access right required: messages — this is issued in exceptional cases by a request to support at devsupport@corp.vk.com)
• community access token (access rights required: messages)

Parameters

offset

integer

Offset needed to return a specific subset of messages.

count

positive

Number of messages to return.

user_id

integer

ID of the user whose message history you want to return.

peer_id

integer

start_message_id

integer

Starting message ID from which to return history.

rev

integer

Sort order: 1 — return messages in chronological order. 0 — return messages in reverse chronological order.

extended

checkbox

fields

string

group_id

integer

Result

Returns a list of message objects.

Error codes

927
Chat does not exist
936
Contact not found
1017
Chat was deleted

Common errors may occur during execution

Linked versions

Go to API versions page
  • A field appeared in the message object template .
  • Method messages.getHistory takes a parameter rev вместе с start_message_id Equal 0 .

  • Method friends.edit Returns an error "Code: 100, Message: invalid list_ids" , если указан неправильный list_ids .

  • In the object describing the user , поля photo and photo_medium_rec renamed to photo_50 and photo_100 .

  • In the investment wall in field messages from and copy_owner Return the object user or community instead of an array.