photos.uploadContactProfilePhoto #

Upload a custom profile picture for a contact, or suggest a new profile picture to a contact.

The file, video and video_emoji_markup flags are mutually exclusive.

Layer 223

photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
---functions---
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 #

NameTypeDescription
flags#Flags, see TL conditional fields
suggestflags.3?trueIf 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).
saveflags.4?trueIf 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_idInputUserThe contact
fileflags.0?InputFileProfile photo
videoflags.1?InputFileAnimated profile picture video
video_start_tsflags.2?doubleFloating 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_markupflags.5?VideoSizeAnimated sticker profile picture, must contain either a videoSizeEmojiMarkup or a videoSizeStickerMarkup constructor.

Result #

photos.Photo

Only users can use this method #

Possible errors #

CodeTypeDescription
400CONTACT_MISSINGThe specified user is not a contact.
400NEED_ACTION_MISSINGThe caller didn't specify a valid action (either save or suggest) for the contact profile photo upload.
400USER_ID_INVALIDThe provided user ID is invalid.

messageActionSuggestProfilePhoto #

A new profile picture was suggested using photos.uploadContactProfilePhoto.

messages.deleteMessages #

Deletes messages by their identifiers.

Uploading and Downloading Files #

How to transfer large data batches correctly.

videoSizeEmojiMarkup #

An animated profile picture based on a custom emoji sticker.

videoSizeStickerMarkup #

An animated profile picture based on a sticker.