telegram api method · layer 229 · #f64daf43
messages.requestEncryption
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
| name | type | description |
|---|---|---|
user_id | InputUser | User ID |
random_id | int | Unique client request ID required to prevent resending. This also doubles as the chat ID. |
g_a | bytes | A = g ^ a mod p, see Wikipedia |
returns
errors (7)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This 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. |
| 400 | DH_G_A_INVALID | g_a invalid. |
| 400 | INPUT_USER_DEACTIVATED | The specified user was deleted. |
| 400 | RANDOM_ID_DUPLICATE | You provided a random ID that was already used. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 403 | USER_IS_BLOCKED | You were blocked by this user. |
history
present in layers 8–229
| id | layers |
|---|---|
| #f64daf43 | 8–229 |