telegram api method · layer 229 · #d9ba2e54
contacts.addContact
Add an existing telegram user as contact.
definition
contacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
add_phone_privacy_exception | true | Allow the other user to see our phone number? |
id | InputUser | Telegram ID of the other user |
first_name | string | First name |
last_name | string | Last name |
phone | string | User's phone number, may be omitted to simply add the user to the contact list, without a phone number. |
note | TextWithEntities |
returns
errors (6)
| 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 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 400 | CONTACT_ID_INVALID | The provided contact ID is invalid. |
| 400 | CONTACT_NAME_EMPTY | Contact name empty. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
history
present in layers 102–229 · constructor id changed 1×
| id | layers |
|---|---|
| #e8f463d0 | 102–215 |
| #d9ba2e54 | 216–229 |