telegram api method · layer 229 · #f64daf43

messages.requestEncryption

usable by users

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

definition

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.
g_abytesA = g ^ a mod p, see Wikipedia

returns

EncryptedChat

errors (7)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
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.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403USER_IS_BLOCKEDYou were blocked by this user.

history

present in layers 8–229

idlayers
#f64daf438–229