Warning
API may change any time without notice.
MPGram API must not be used for bots, its only purpose is to make custom clients for legacy devices.
Instance owners are advised to block any suspicious-looking User-Agents and IP addresses from data-centers.
Usage example: https://MPGRAM_INSTANCE/api.php?v=11&method=getPeer&id=nnmidlets
- Current version: 12
- Minimum compatible version: 2
- All methods require authorization, unless stated otherwise.
- All methods return JSON objects, unless stated otherwise.
- All methods accept parameters with GET query, POST multipart or POST URL-encoded form.
- Any method may return Error object in case of failure.
- For authorization, set
X-mpgram-userrequest header oruserparameter via GET or POST.
X-mpgram-user: AuthorizationX-mpgram-instance-password: Instance passwordX-mpgram-app-version: Client app versionX-mpgram-device: Device informationX-mpgram-system: System informationX-mpgram-unicode: Set to 1 to mark that client supports UTF-8 decoding properly, otherwise Unicode characters will be escaped in responses.X-mpgram-keep-emoji: Set to 1 to keep emoji symbols in names. since v7
X-Server-Time: Server timeX-Server-Api-Version: Maximum supported API versionX-file-rewrite-supported:1If server supportsfile/FILENAME?c=PEER_ID&m=MESSAGE_IDlinksX-voice-conversion-supported:1If server supports voice messages conversion
-
Request:
method=phoneLogin&phone=+123
Response:{"res":"need_captcha","captcha_id":"zxc"} -
Request:
method=getCaptchaImg&captcha_id=zxc
Response: JPEG Image -
Request:
method=phoneLogin&phone=+123&captcha_id=zxc&captcha_key=54321
Response:{"res":"code_sent","user":"asdfgh","phone_code_hash":"dsa"} -
Request:
method=completePhoneLogin&code=12345
Header:X-mpgram-user: asdfgh
Response:{"res":1}
-
Request:
method=initLogin&qr=1
Response:{"res":"need_captcha","captcha_id":"zxc"} -
Request:
method=getCaptchaImg&captcha_id=zxc
Response: JPEG Image -
Request:
method=initLogin&qr=1&captcha_id=zxc&captcha_key=54321
Response:{"res":"qr","user":"asdfgh","text":"dGc6Ly9zb21ldGhpbmc="} -
Request:
method=qrLogin
Header:X-mpgram-user: asdfgh
Response:{"res":1}
Object
id(int): Positive integerdate(long): Time when message was senttext(string, optional): Text of messageout(boolean, optional): true if outbox messagepeer_id(string, optional): Peer ID where message was sentfrom_id(string, optional): Peer ID of senderfwd(object, optional): Forward information, present if message is forwardedfrom_id(string, optional): Peer ID of original senderdate(long, optional): Time when original message was sentmsg(int, optional): Original message ID, present if message is savedpeer(string, optional): Peer ID where original message was send, present if message is saveds(boolean, optional): true if message is savedfrom_name(string, optional): Name of original sender, present if profile is private
media(object, optional): Media information, present if message contains media.- General properties:
type(string): Type of mediahide(int, optional): 1 if media is disabled. since v9
- Photo:
type:photoid(string): ID of photodate(long or null): Date of photow(int): Width of photo. since v9h(int): Height of photo. since v9
- Document:
type:documentid(string)date(long, optional)size(int or null)mime(string or null)thumb(boolean): Has thumbnail?name(string, optional): Original file nameaudio(boolean, optional): true if media is audiovoice(boolean, optional): true if media is voice messagewave(boolean, optional): true if voice message has waveformtime(int, optional): Duration of audio in secondstitle(string, optional): Title meta tag of audioartist(string, optional): Artist meta tag of audiow(int, optional): Width of image, present if file is image. since v10h(int, optional): Height of image, present if file is image. since v10
- Webpage link
type:webpageurl(string or null): URLtitle(string or null): Titlename(string or null): Description
- Location
type:geolat(string or null): Latitudelong(string or null): Longitude
- Poll. since v11
type:polltext(string): Questionid(string): Poll IDvoted(int, optional): Count of votersclosed(boolean): true if poll is closedpublic(boolean, optional): true if poll is not anonymousmulti(boolean, optional): true if poll has multiple optionsquiz(boolean, optional): true if poll has correct answeroptions(array)- Option (object)
text(string): Textdata(string): Data for sendVotechosen(boolean, optional): true if option is chosen by logged usercorrect(boolean, optional): true if option is correct, present if poll is quiz.voters(int, optional): Count of votes for this option
- Option (object)
- Undefined
type:undefined_(string): Raw MadelineProto type of media
- General properties:
act(object, optional): Chat action information, present if message is action._(string): Type of actionuser(string, optional): Peer ID of involved usert(string, optional): New title of chat, present if action is renaming.
reply(object, optional): Reply information, present if message is reply to other or is sent in forum chatid(int or null): Replied message IDpeer(string, optional): Peer ID of replied message, present if message replied to other dialogquote(string, optional): Quote part of replied messagemsg(object, optional): Message object of replied messagetop(int, optional): Top message ID, present if sent in forum chat. since v10
markup(array, optional): Reply markup, array of button row arrays. since v5- Row (array):
- Button (object):
text(string): Textdata(string, optional): Data to be sent withsendBotCallback, present if button is callback.url(string, optional): URL, present if button is hyperlink
- Button (object):
- Row (array):
entities(array, optional): Array of raw MadelineProto MessageEntity objects. since v5group(long, optional): Message group ID, present if media message is grouped. since v5edit(long, optional): Date of edition, present if message was edited. since v7silent(boolean, optional): true if message sent without notification. since v8mention(boolean, optional): true if user is mentioned in message. since v8comments(object, optional): Post comments information, present if message is broadcast post that has comments. since v8count(int): Count of messages.peer(string): Peer ID of discussion chat.read(int, optional): Message ID of max read message, present if discussion thread was read once.
reacts(object, optional): Reacts information. since v10count(int): Count of reacts
Changes
mediacan no longer be null
replymsg(int or null): Repurposed, replaced byid
Object
id(string): Peer IDpin(boolean, optional): true if dialog is pinnedunread(int, optional): Count of unread messages, present if more than 0mentions(int, optional): Count of unread mentions, present if more than 0msg(object, optional): Last message, present ingetDialogsresponse. since v5read_in(int, optional): Maximum inbox read message ID. since v11read_out(int, optional): Maximum outbox read message ID. since v11silent(boolean, optional): true if dialog is muted. since v11
Changes
pinned(boolean, optional): true if dialog is pinned, replaced bypinunread_count(int): Count of unread messages or 0, replaced byunread
type(string): Type of peer, possible values: "user", "chat", or "channel".
String
- Positive integer: User
- 0 to -1000000000000 exclusive: Chat
- -1000000000000 to -2000000000000 exclusive: Channel
- from -2000000000000 to -Infinity exclusive: Secret chat (Unsupported!)
Object
id(string): Peer ID, positive integerfn(string or null): First nameln(string or null): Last namename(string, optional): Public linkp(boolean, optional): true if user has photo. since v5k(boolean, optional): true if user is listed in contacts. since v5s(boolean, optional): true if user is online, present ifstatusis listed infieldsparameter. since v5w(long, optional): Date when user was last online or 0 if hidden, present ifstatusis listed infieldsparameter. since v5a(boolean, optional) true if user has admin rights, present only ingetParticipantsresponse. since v6
Changes
first_name(string): First name, replaced byfnlast_name(string): Last name, replaced bylnusername(string or null): Public link, replaced byname
Object
id(string): Peer ID, negative integertype(string): Type of chat. deprecated, will be deleted in v11t(string): Title of chatname(string, optional): Public linkp(boolean, optional): true if chat has photo. since v5c(boolean, optional): true if broadcast channel. since v5l(boolean, optional): true if logged user is not in this chat. since v5
Changes
title(string): Title of chat, replaced bytusername(string or null): Public link, replaced byname
Object
update(object): Almost raw MadelineProtoUpdateobject, see https://docs.madelineproto.xyz/API_docs/types/Update.html_(string): Type of updatemessage(object, optional): Message object
update_id(int): Update ID
Object
count(int, optional): Total count of messagesoff(int, optional): History offsetmessages(array, optional): Array of Message objectsusers(object, optional): Map of User objects by their Peer IDschats(object, optional): Map of Chat objects by their Peer IDs
Object
res(string or int)- 1: Authorization completed, client should call
me. code_sent: Authorization code is sent, client must callcompletePhoneLogin.qr: QR code is generated,textcontains Base64 encoded authorization link, client must callqrLoginafter QR code is scanned.phone_code_invalid: Authorization code is invalid, code will be resent, client must callcompletePhoneLoginagain with correct code.phone_code_expired: Authorization code is expired, code will be resent, client must callcompletePhoneLoginagain with correct code.need_captcha: Captcha required, client must callgetCaptchaImgwith providedcaptcha_id, then client must call method again withcaptcha_idandcaptcha_key.password: Cloud password requested, must callcomplete2faLogin.auth_restart: Authorization failed, client must callphoneLoginagain.phone_number_invalid: Phone number is invalid, cannot proceed.no_password: Cloud password is enabled but not set, cannot proceed.need_signup: Phone number is unregistered, cannot proceed.exception: Server side error occurred.
- 1: Authorization completed, client should call
user(string, optional): User code, if present, client must save it and use it in all subsequent requests asX-mpgram-userheader.phone_code_hash(string, optional): Phone code hash to be used inresendCode, present inphoneLoginresponse or ifcompletePhoneLoginwas unsuccessfulmessage(string, optional): Error message
Object
error(object)message(string): Error messagestack_trace(string, optional): Exception stack trace
Most common error messages:
API is disabled: Server does not support API requestsInstance password is required,Wrong instance password: Server requires password, client must provide validX-mpgram-instance-passwordheaderUnsupported API version: Client API version is outdatedLogin API is disabled: Server does not accept authorization through APIInvalid authorization: Requested method requires valid authorizationCould not get user info,Failed to load session: Authorization session expired
Initializes user authorization by phone number.
If response has captcha_id, request must be repeated with captcha_id and captcha_key set.
Does not require authorization
Available since v2
phone: Phone numbercaptcha_id(optional): Captcha IDcaptcha_key(optional): Captcha text
Authorization response object
Initializes user authorization by QR code.
If response has captcha_id, request must be repeated with captcha_id and captcha_key set.
Does not require authorization
Available since v10
qr: must be set to1captcha_id(optional): Captcha IDcaptcha_key(optional): Captcha text
Authorization response object
Checks QR code authorization status, generates new link if authorization is not complete.
Available since v10
Authorization response object
Checks authorization code
Available since v1
code
Authorization response object
Checks cloud password
Available since v1
password: Cloud password
Authorization response object
Resends authorization code
Available since v5
phone: Phone numberhash:phone_code_hashprovided in previous authorization response
Object
res(int): 1 if request completed successfully
Returns captcha image
Does not require authorization
Available since v1
captcha_id: Captcha ID generated by authorization method.
JPEG image
Deprecated since v5, use me method
Available since v2
Object
res(int): 1 if request completed successfully
Removed since v2
first_name: First namelast_name: Last name
Object
res(int): 1 if request completed successfully
Destroys user authorization code
Available since v11
s: Set to 1 to only delete session files
Object
res(int): 1 if request completed successfully
(Alias getSelf available since v2, deprecated since v5)
Returns information about of logged user.
Available since v5
status (optional): set to 1 to set online status. since v5
User object
Returns information about peer.
Available since v3
id: Peer ID
Returns information about list of peers.
Available since v4
id: Comma-separated Peer IDs
Object
users(object, optional): Map of User objects by their Peer IDschats(object, optional): Map of Chat objects by their Peer IDs
Returns raw detailed information about peer.
See: https://docs.madelineproto.xyz/FullInfo.html
Available since v5
id: Peer ID
MadelineProto FullInfo object
Returns raw information about peer.
See: https://docs.madelineproto.xyz/Info.html
Available since v8
id: Peer ID
MadelineProto Info object
Returns raw user information for provided phone number, if their privacy settings allow it.
See: https://docs.madelineproto.xyz/API_docs/types/contacts.ResolvedPeer.html
Available since v5
phone: Phone number
Object
res(object): MadelineProtocontacts.ResolvedPeerobject
TODO
Available since v11
id: Peer ID
Object
username(string, optional)about(string, optional)bot(boolean, optional)status(object, optional)phone(string, optional)admin_rights(object, optional)count(int, optional)can_view_participants(boolean, optional)left(boolean, optional)
Returns list of dialogs of logged user.
Supports folder filters since v5.
Available since v1
offset_id(optional): Used for pagination, does not work iffis set.offset_date(optional): Used for pagination, does not work iffis set.offset_peer(optional): Used for pagination, does not work iffis set.limit(optional): Limit of dialogs per response, 100 by default.f(optional): Folder ID, set to 1 for archived chats. since v5fields(optional): Comma-separated list of possible values:dialogs,users,chats,,rawmessages
count(int, optional): Count of found dialogs.dialogs(array): Array of Dialog objectsusers(object, optional): Map of User objects by their Peer IDschats(object, optional): Map of Chat objects by their Peer IDsraw(object, optional): Raw result. Deprecated
Returns all dialogs of logged user.
Deprecated, do not use
Available since v1
limit(optional): Limit of dialogs, 100 by default.fields(optional): Comma-separated list of possible values:dialogs,users,chats,,rawmessages
dialogs(array): Array of Dialog objectsusers(object, optional): Map of User objects by their Peer IDschats(object, optional): Map of Chat objects by their Peer IDsraw(object, optional): Raw result. Deprecated
Changes
Returns list of contacts of logged user.
Available since v5
Object
res(array): Array of User objects
Returns list of dialog folders of logged user.
Available since v5
Object
res(array or null): Array of folders- Folder (object)
id(int): Folder IDt(string, optional): Folder title
- Folder (object)
archive(boolean. optional): true if user has archived chats
Returns raw information about dialog.
Available since v9
id: Peer ID
Object
res(object): Dialog object
Changes
res(object): MadelineProtoDialogobject
See: https://docs.madelineproto.xyz/API_docs/types/Dialog.html
Search dialogs.
Available since v6
q: Search query
Object
Returns history of messages.
Available since v1
peer: Peer IDoffset_id(optional)offset_date(optional)add_offset(optional)limit(optional): Messages limitmax_id(optional): Maximum message ID, exclusivemin_id(optional): Minimum message ID, exclusiveread(optional): Set to 1 to mark messages as readmedia(optional): Set to 1 to include media in messagesfields(optional): Comma-separated list of possible values:messages,users,chats
Returns specific messages.
Available since v6
peer: Peer IDid: Comma-separated list of message IDsread(optional): Set to 1 to mark messages as readmedia(optional): Set to 1 to include media in messagesfields(optional): Comma-separated list of possible values:messages,users,chats
Returns filtered history of messages.
Available since v6
peer: Peer IDq(optional): Search queryfilter(optional): Possible values:Photos,Video,Document,Music,Voicetop_msg_id(optional): Thread top message IDoffset_id(optional): Offset message IDoffset_date(optional)add_offset(optional)limit(optional): Messages limitmax_id(optional): Maximum message ID, exclusivemin_id(optional): Minimum message ID, exclusiveread(optional): Set to 1 to mark messages as readmedia(optional): Set to 1 to include media in messagesfields(optional): Comma-separated list of possible values:messages,users,chats
Marks messages as read.
Available since v5
peer: Peer IDmax: Max message IDthread(optional): Thread top message ID, used for forum chats
Nothing
Deletes message.
Available since v5
peer: Peer IDid: Comma-separated list of message IDs. since v9revoke(optional): Set to 1 to remove message for everyone. since v11
id: Message ID.
Object
res(int): 1 if request completed successfully
Sends message.
Available since v2
Combined with message forwarding method, set fwd_from and id to forward a message before sending.
peer: Peer IDtext(optional): Text of messagehtml(optional): Set to 1 to enable HTML parsingreply(optional): Message ID to replyfwd_from(optional): Peer ID to forward message fromid(optional): Message ID to forward, required iffwd_fromis settop(optional): Topic message ID to forward to. since v11r(optional): Seed for duplication check. since v12
Object
res(int): 1 if request completed successfully
Sends media message.
Combined with message forwarding method, set fwd_from and id to forward a message before sending.
Either file, or doc_id with doc_access_hash have to be set.
Available since v6
peer: Peer IDtext(optional): Text of messagehtml(optional): Set to 1 to enable HTML parsingreply(optional): Message ID to replyfile(optional): File via multipart requestuncompressed(optional): Set to 1 to send media uncompressedspoiler(optional): Set to 1 to hide media under spoilervoice(optional): Set to 1 to send audio file as voice message. since v12doc_id(optional): Document IDdoc_access_hash(optional): Document access hashfwd_from(optional): Peer ID to forward message fromid(optional): Message ID to forward, required iffwd_fromis setr(optional): Seed for duplication check. since v12
Object
res(int): 1 if request completed successfully
Edits sent message.
Available since v5
peer: Peer IDid: Message IDtext(optional): Text of messagehtml(optional): Set to 1 to enable HTML parsingreply(optional): Message ID to replyfile(optional): Fileuncompressed(optional): Set to 1 to send media uncompressedspoiler(optional): Set to 1 to hide media under spoilerdoc_id(optional): Document IDdoc_access_hash: Document access hash
Object
res(int): 1 if request completed successfully
Updates typing status.
Available since v6
peer: Peer IDaction: Possible values:Typing,Cancel
Object
res(int): 1 if request completed successfully
Returns list of topics in forum chat.
Available since v6
peer: Peer IDlimit(optional): Response limit, 30 by default.
Object
res(array)- Topic (object)
id(int): Topic IDclosed(boolean): true if no messages can be sent in this topicpinned(boolean): true if topic is pinneddate(long): Topic creating datetop(int): Last message ID in this topicunread(int): Count of unread messagesread_max_id(int): Maximum ID of read messagestitle(string, optional): Title of topic
- Topic (object)
Pins message.
Available since v7
peer: Peer IDid: Message IDunpin(optional): set to 1 to unpin previous pinned messagesilent(optional): set to 0 to send notification or 1 to not, 1 by default
Object
res(int): 1 if request completed successfully
Returns information about post comments.
Available since v8
peer: Peer IDmsg_id: Message ID
Object
id(int): Thread top message IDpeer_id(string): Peer ID of discussion chatunread(int): Count of unread messagesread(int): Last read message IDmax_id(int): Last message ID in discussion thread
Starts conversation with a bot.
Available since v5
Object
res(int): 1 if request completed successfully
(Alias botCallback available since v6, deprecated since v10)
Available since v10
Sends bot callback
See: https://docs.madelineproto.xyz/API_docs/types/messages.BotCallbackAnswer.html
peer: Peer IDmsg_id: Message IDdata: Base64 encoded datatimeout(optional): Answer timeout in seconds, positive decimal, 0.5 by default
MadelineProto messages.BotCallbackAnswer object
Returns saved sticker sets of logged user.
Available since v6
Object
res(array)- Sticker set (object)
id(string): Sticker set IDaccess_hash(string): Sticker set access hashtitle(string): Titleshort_name(string, optional): Sticker set short name
- Sticker set (object)
Returns sticker set information.
Either id with access_hash, or slug have to be set.
Available since v6
id(optional): Sticker set IDaccess_hash(optional): Sticker set access hashslug(optional): Sticker set short name
Object
id(string): Sticker set IDaccess_hash: Sticker set access hashtitle(string, optional): Titleshort_name(string, optional)installed(long, optional): Date when sticker set was installed, not present if sticker set is not installed.count(int, optional): Count of stickersres(array): Array of stickers- Sticker (object)
id(string): Document IDaccess_hash(string): Document access hashmime(string): MIME type
- Sticker (object)
Saves sticker set.
Either id with access_hash, or slug have to be set.
Available since v7
id: Sticker set IDaccess_hash: Sticker set access hashslug: Sticker set short name
Object
res(int): 1 if request completed successfully
Removes sticker set from saved.
Either id with access_hash, or slug have to be set.
Available since v11
id: Sticker set IDaccess_hash: Sticker set access hashslug: Sticker set short name
Object
res(int): 1 if request completed successfully
Returns raw invite link information
See: https://docs.madelineproto.xyz/API_docs/types/ChatInvite.html
Available since v5
id: Invite hash
Object
res: MadelineProtoChatInviteobject
Join chat by invite link
Available since v5
id: Invite hash
Object
res(int): 1 if request completed successfully
Returns created invite links.
See: https://docs.madelineproto.xyz/API_docs/types/messages.ExportedChatInvites.html
Available since v11
peerPeer ID
Object
res: MadelineProtomessages.exportedChatInvitesobject
Creates invite link.
See: https://docs.madelineproto.xyz/API_docs/types/ExportedChatInvite.html
Available since v11
peerPeer ID
Object
res: MadelineProtoExportedChatInviteobject
Adds a user to a chat.
Available since v11
peer: Peer ID of chatid: User ID
Object
res(int): 1 if request completed successfully
Removes a user from a chat.
Available since v11
peer: Peer ID of chatid: User ID
Object
res(int): 1 if request completed successfully
Invites users to a channel.
Available since v11
peer: Peer ID of channelid: Comma-separated list of users
Object
res(int): Count of missing invitees, 0 if every invite was sent successfully.
Votes in a poll.
Available since v11
peer: Peer IDid: Message IDoptions: Comma-separated list of options data
Object
res(int): 1 if request completed successfully
Returns list of participants who read a message in a chat.
peer: Peer IDid: Message ID
Object
res(array): Array of User objects
Join public channel.
Available since v5
id: Peer ID of channel
Object
res(int): 1 if request completed successfully
Leave channel.
Available since v5
id: Peer ID of channel
Object
res(int): 1 if request completed successfully
Returns chat participants.
Supports only channels currently.
Available since v6
peer: Peer IDfilter(optional):Recentby defaultoffset(optional): Offset, for pagination.limit(optional): Limit of users per response, for pagination.
Object
count(int, optional): Count of chat participantsres(array): Array of User objects
Bans a user from channel.
Available since v6
peer: Peer ID of channel.id: User ID
Object
res(int): 1 if request completed successfully
Get updates.
Available since v5
offset: Update ID offset, inclusive.limit(optional): Limit of updates per response, 100 by default.types(optional): Comma-separated list of update types to filter.exclude(optional): Comma-separated list of update types to exclude.longpoll(optional): Set to 0 disable long-poll, if set, method will not wait for new updates, 1 by default.timeout(optional): Timeout of long-poll in seconds, positive integer, 10 by default.peer(optional): Peer ID, if set, method will return only updates related to that peer.top_msg(optional): Top message ID of thread, set for forum chats withpeer.read(optional): Set to 1 to automatically mark received messages as read, works only inpeermode.media(optional): Set to 1 to include media in messages.
Object
res(array, optional): Array of Update objectscancel(int, optional): 1, if request was canceled by cancelUpdates method. since v9
Returns last received update.
Available since v6
Object
res(object): Update object
Cancels updates method long-poll.
Available since v9
Object
res(int): 1 if request completed successfully
Changes
res(boolean): true if request completed successfully. Changed type to int.
Updates online state of logged user.
Available since v6
off(optional): set to 1 for offline
Object
res(int): 1 if request completed successfully
Returns message updates.
Unlike updates method, this method is not long-polled, it should be called periodically in interval defined by user.
Cannot be used while updates method is active.
Available since v8
offset: Update offset ID, inclusive.limit(optional): Limit of updates per response, 1000 by default.include_muted(optional): Set to 1 to include messages from muted peers.peers(optional): Comma-separated list of Peer IDs to filter.media(optional): Set to 1 to include media in messagesmu(optional): set to 1 to mute users, see getNotifySettings method.mc(optional): set to 1 to mute chats, see getNotifySettings method.mb(optional): set to 1 to mute broadcast channels, see getNotifySettings method.
Changes
mute_users(optional): set to 1 to mute users, see getNotifySettings method. replaced bymumute_chats(optional): set to 1 to mute chats, see getNotifySettings method. replaced bymcmute_broadcasts(optional): set to 1 to mute broadcast channels, see getNotifySettings method replaced bymb
Object
res(array): Array of notifications- Notification (object)
_(string): Type of updatemessage(object): Message objectmute(boolean, optional): true if message is from muted peer, present ifinclude_mutedis set.
- Notification (object)
offset(int): Offset for next request
Returns notification settings of logged user.
Available since v8
Object
users(long): Date until users are muted, or 0 if notifications are enabled.chats(long): Date until chats are muted, or 0 if notifications are enabled.broadcasts(long): Date until broadcast channels are muted, or 0 if notifications are enabled.
Returns server timezone.
Does not require authorization.
Available since v1
Object
res(int): Timezone offset in seconds
Sticker:
sticker: Sticker IDaccess_hash: Sticker access hashp(optional): Conversion parameters, see below. If not set, will return webp.s(optional): Size parameter forp, 180 by default
Message file:
c: Peer IDm: Message IDp(optional): Conversion parameters, see below.s(optional): Size parameter forp, 180 by defaulttw(optional): Target width forp=rviewth(optional): Target height forp=rview
p format:
Parsed in order:
tgss: Convert TGS to static PNG, end.tgs: Convert TGS to GIF, end.thumb: Get thumbnail of documentr: Resize or convertstickerp: (Sticker PNG) Convert to PNG, resize to fit widths, end.png: Convert to PNG, end.r: Rotate to 270 degreesorig: Set JPEG quality to 80, keep original size, end.prev: Set JPEG quality to 50, resize to fitsin both dimensions, end.min: Set JPEG quality to 30, resize to fit 180x90, end.sticker: Set JPEG quality to 75, resize to fit widthsor height 90, end.sprev: (Sticker preview) Set JPEG quality to 30, resize to fit width 100 or height 80, end.audio: (Audio file): Set JPEG quality to 50, resize to fit height 36 or width 36, end.sprevs: (Sticker preview with custom size): Set JPEG quality to 30, resize to fit widthsor heights, end.view: Set JPEG quality to 70, fit totwxth, end.
Examples:
p=rprev&s=200: Convert to JPEG with quality 50, resize to fit 200x200.p=rview&tw=240&th=320: Convert to JPEG with quality 70, resize to fit 240x320.p=rrview&tw=320&th=240: Convert to JPEG with quality 70, rotate to 270 degrees, resize to fit 320x240.p=thumbraudio: Get thumbnail of document, convert to JPEG with quality 50, resize to fit 36x36.p=rpng: Convert to PNG.p=rorig: Convert to JPEG.p=rstickerp&s=120: Convert to PNG, resize to fit 120x120.
- HTTP 400: file is too large to download
- HTTP 401: unauthorized
- HTTP 403: feature is not enabled
- HTTP 500: server error
File
Returns profile picture.
c: Peer IDa(optional): Set to 1 to return HTTP 404 on fail.p: Conversion parameters, see below.
p format:
rp: Convert to PNGorig: Keep original size, end.- integer: Resize, end.
Examples:
p=r36: Convert to JPEG, resize to 36x36.p=r48, Convert to PNG, resize to 48x48.p=rorig, Convert to JPEG, keep original size.p=rporig, Convert to PNG, keep original size.
File
Converts voice message from message to MP3 64 KBit/s.
c: Peer IDm: Message ID
MP3 file
Utility for creating authorization QR code.
Does not require authorization.
t: Base64 encoded text
PNG Image
v1:
getCaptchaImginitLoginChanged purpose in v10, deprecated from v2 to v10completePhoneLogincomplete2faLogincompleteSignupRemoved since v2logoutRemoved since v2, reintroduced in v11getServerTimeOffsetgetDialogsgetAllDialogsDeprecatedgetHistory
v2:
phoneLoginsendMessagecheckAuthDeprecated since v5, replaced bymegetSelfDeprecated since v5, replaced bymegetUserRemoved since v3, replaced bygetPeergetChatRemoved since v3, replaced bygetPeer
v3:
getPeer
v4:
getPeers
v5:
meupdatesgetFullInfogetFoldersreadMessagesstartBotgetContactsjoinChannelleaveChannelcheckChatInviteimportChatInviteeditMessagedeleteMessageresolvePhoneresendCode
v6:
searchMessagesgetMessagesgetParticipantsgetLastUpdatesetTypingupdateStatussendMediasearchChatsbanMembergetForumTopicsbotCallbackDeprecated since v10, replaced bysendBotCallbackgetStickerSetsgetStickerSet
v7:
pinMessageinstallStickerSet
v8:
getNotifySettingsnotificationsgetDiscussionMessagegetInfo
v9:
cancelUpdatesgetDialog
v10:
sendBotCallbackqrLogin
v11:
uninstallStickerSetgetMessageReadParticipantsgetExportedChatInvitesexportChatInviteaddChatUserdeleteChatUserinviteToChannelsendVotelogoutgetPeerInfo
v12: