telegram api method · layer 229 · #e14c4a71

photos.uploadContactProfilePhoto

usable by users

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

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.

returns

photos.Photo

errors (5)

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.
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.
401AUTH_KEY_UNREGISTEREDThe 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×

idlayers
#b91a83bf151
#e14c4a71152–229