messages.getHistory
Read chat history
Returns the message page of the selected chat in order from newest to oldest.
| Name | Type | Required | Description |
|---|---|---|---|
peer | InputPeer | Yes | A chat whose history you need to read. |
offset_id | int | Yes | ID of the message from which the selection begins. |
offset_date | int | Yes | Date for history offset in Unix seconds. |
add_offset | int | Yes | Additional offset in messages. |
limit | int | Yes | Maximum number of messages returned. |
max_id | int | Yes | Return messages with an ID less than the specified one. |
min_id | int | Yes | Return messages with an ID greater than the specified one. |
hash | long | Yes | A hash of previously received results to check for changes. |
Replies
messages.Messages
MTProto RPC
- 400 · CHANNEL_INVALID — The provided channel is invalid.
- 406 · CHANNEL_PRIVATE — You haven't joined this channel/supergroup.
- 400 · CHAT_ID_INVALID — The provided chat id is invalid.
- 400 · CHAT_NOT_MODIFIED — No changes were made to chat information because the new information you passed is identical to the current information.
- 400 · FROZEN_PARTICIPANT_MISSING — The current account is [frozen](https://core.telegram.org/api/auth.md#frozen-accounts), and cannot access the specified peer.
- 400 · MSG_ID_INVALID — Invalid message ID provided.
- 400 · PEER_ID_INVALID — The provided peer id is invalid.
- 400 · TAKEOUT_INVALID — The specified takeout ID is invalid.