messages.getSavedHistory #

Fetch saved messages » forwarded from a specific peer, or fetch messages from a monoforum topic ».

Layer 223

messages.messages#1d73e7ea messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesNotModified#74535f21 count:int = messages.Messages;
---functions---
messages.getSavedHistory#998ab009 flags:# parent_peer:flags.0?InputPeer peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
parent_peerflags.0?InputPeerIf set, fetches messages from the specified monoforum, otherwise fetches from saved messages.
peerInputPeerTarget peer (or topic)
offset_idintOnly return messages starting from the specified message ID
offset_dateintOnly return messages sent before the specified date
add_offsetintNumber of list elements to be skipped, negative values are also accepted.
limitintNumber of results to return
max_idintIf a positive value was transferred, the method will return only messages with IDs less than max_id
min_idintIf a positive value was transferred, the method will return only messages with IDs more than min_id
hashlongResult hash

Result #

messages.Messages

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400PARENT_PEER_INVALIDThe specified parent_peer is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.

Pagination in the API #

How to fetch results from large lists of objects.

Saved messages #

The Saved Messages chat allows users to bookmark messages and media: it's a personal cloud storage for any messages or media you may want to send or forward there.

Direct messages to channels #

Telegram supports direct messages to channels, which can also be used to suggest (even paid) channel posts.