telegram api method · layer 229 · #e14c4a71
photos.uploadContactProfilePhoto
Upload a custom profile picture for a contact, or suggest a new profile picture to a contact.
definition
photos.uploadContactProfilePhoto#e14c4a71 flags:# suggest:flags.3?true save:flags.4?true user_id:InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.5?VideoSize = photos.Photo;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
suggest | true | If set, will send a messageActionSuggestProfilePhoto service message to user_id, suggesting them to use the specified profile picture; otherwise, will set a personal profile picture for the user (only visible to the current user). |
save | true | If set, removes a previously set personal profile picture (does not affect suggested profile pictures, to remove them simply delete the messageActionSuggestProfilePhoto service message with messages.deleteMessages). |
user_id | InputUser | The contact |
file | InputFile | Profile photo |
video | InputFile | Animated profile picture video |
video_start_ts | double | Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set. |
video_emoji_markup | VideoSize | Animated sticker profile picture, must contain either a videoSizeEmojiMarkup or a videoSizeStickerMarkup constructor. |
returns
errors (5)
| 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 | CONTACT_MISSING | The specified user is not a contact. |
| 400 | NEED_ACTION_MISSING | The caller didn't specify a valid action (either save or suggest) for the contact profile photo upload. |
| 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). |
history
present in layers 151–229 · constructor id changed 1×
| id | layers |
|---|---|
| #b91a83bf | 151 |
| #e14c4a71 | 152–229 |