messages.forwardMessages

Forwards messages by their IDs.

API section: Working with messages

messages.forwardMessages#13704a7c flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;

Parameters

NameTypeDescription
flags # Bit mask: a field written flags.N?T is present only when bit N is set.
silent flags.5?true Send without sound: the recipient gets no notification.
background flags.6?true Background send: no notification and the chat is not bumped.
with_my_score flags.8?true
drop_author flags.11?true
drop_media_captions flags.12?true
noforwards flags.14?true
allow_paid_floodskip flags.19?true
from_peer InputPeer
id Vector<int> Identifier of the object — which object depends on the field's type.
random_id Vector<long> A random number from the client. The server uses it to discard duplicates when a request goes out twice.
to_peer InputPeer
top_msg_id flags.9?int Forum topic identifier.
reply_to flags.22?InputReplyTo What the message replies to.
schedule_date flags.10?int When to send, unix time. If set, the message goes out later.
schedule_repeat_period flags.24?int
send_as flags.13?InputPeer Which identity to send as — a channel or another profile.
quick_reply_shortcut flags.17?InputQuickReplyShortcut
effect flags.18?long
video_timestamp flags.20?int
allow_paid_stars flags.21?long
suggested_post flags.23?SuggestedPost

Result

Updates

Possible errors

This method has no errors of its own: it either answers or fails on the shared checks below.

Common to every call

CodeTypeWhat it means
401 AUTH_KEY_UNREGISTERED The server does not know this session: the key was revoked, expired, or the call was made before authorisation.
401 API_ID_INVALID This api_id was never issued or has been blocked. Keys come from my.ansible.su.
400 CONNECTION_LAYER_INVALID The client did not declare a layer, or declared one the server does not know.
420 FLOOD_WAIT_X Too often. Do not retry for X seconds — the number arrives in the error text.
500 INTERNAL A failure on our side. The request may be retried; if it keeps failing, it is a bug of ours.

This call counts as expensive: its cost grows with the amount of data, so under peak load it goes through admission control and may answer FLOOD_WAIT where cheap calls always pass. Build retries with a backoff.

Related pages

Types used here