Sends a message with a file attachment to a secret chat

messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;


Name Type Description
peer InputEncryptedChat Secret chat ID
random_id long Unique client message ID necessary to prevent message resending
data bytes TL-serialization of DecryptedMessage type, encrypted with a key generated during chat initialization
file InputEncryptedFile File attachment for the secret chat



Possible errors

Code Type Description
400 DATA_TOO_LONG Data too long
400 MD5_CHECKSUM_INVALID The MD5 checksums do not match
400 MSG_WAIT_FAILED A waiting call returned an error

Related pages


Object describes the contents of an encrypted message.