messages.requestEncryption #

Sends a request to start a secret chat to the user.

Layer 223

encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
encryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;
encryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;
encryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;
---functions---
messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;

Parameters #

NameTypeDescription
user_idInputUserUser ID
random_idintUnique client request ID required to prevent resending. This also doubles as the chat ID. See here » for more info on random ID deduplication and updateMessageID mapping.
g_abytesA = g ^ a mod p, see Wikipedia

Result #

EncryptedChat

Only users can use this method #

Possible errors #

CodeTypeDescription
400DH_G_A_INVALIDg_a invalid.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400RANDOM_ID_DUPLICATEYou provided a random ID that was already used.
400USER_ID_INVALIDThe provided user ID is invalid.
403USER_IS_BLOCKEDYou were blocked by this user.

Working with Updates #

How to subscribe to updates and handle them properly.