Update content of files

This commit is contained in:
GitHub Action 2023-10-19 20:47:07 +00:00
parent 53f38ac52d
commit aa7f5c8e2c
33 changed files with 2020 additions and 457 deletions

View file

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Action-bar</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Sometimes, when interacting with Telegram users via private or secret chats, an action bar must be shown on top of the…">
<meta property="og:title" content="Action-bar">
<meta property="og:image" content="">
<meta property="og:description" content="Sometimes, when interacting with Telegram users via private or secret chats, an action bar must be shown on top of the…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/action-bar" >Action-bar</a></li></ul></div>
<h1 id="dev_page_title">Action-bar</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Sometimes, when interacting with Telegram users via private or secret chats, an action bar must be shown on top of the chat, offering convenient action buttons or notices regarding the user.</p>
<p>Schema:</p>
<pre><code><a href='/constructor/peerSettings'>peerSettings</a>#a518110d flags:<a href='/type/%23'>#</a> report_spam:flags.0?<a href='/constructor/true'>true</a> add_contact:flags.1?<a href='/constructor/true'>true</a> block_contact:flags.2?<a href='/constructor/true'>true</a> share_contact:flags.3?<a href='/constructor/true'>true</a> need_contacts_exception:flags.4?<a href='/constructor/true'>true</a> report_geo:flags.5?<a href='/constructor/true'>true</a> autoarchived:flags.7?<a href='/constructor/true'>true</a> invite_members:flags.8?<a href='/constructor/true'>true</a> request_chat_broadcast:flags.10?<a href='/constructor/true'>true</a> geo_distance:flags.6?<a href='/type/int'>int</a> request_chat_title:flags.9?<a href='/type/string'>string</a> request_chat_date:flags.9?<a href='/type/int'>int</a> = <a href='/type/PeerSettings'>PeerSettings</a>;
<a href='/constructor/userFull'>userFull</a>#b9b12c6c flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>&gt; wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> = <a href='/type/UserFull'>UserFull</a>;
<a href='/constructor/updatePeerSettings'>updatePeerSettings</a>#6a7e7366 peer:<a href='/type/Peer'>Peer</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/messages.peerSettings'>messages.peerSettings</a>#6880b94d settings:<a href='/type/PeerSettings'>PeerSettings</a> chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/messages.PeerSettings'>messages.PeerSettings</a>;
---functions---
<a href='/method/messages.getPeerSettings'>messages.getPeerSettings</a>#efd9a6a2 peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/messages.PeerSettings'>messages.PeerSettings</a>;</code></pre>
<p>The action bar is represented by the <a href="/constructor/peerSettings">peerSettings</a> constructor, fetchable using <a href="/method/messages.getPeerSettings">messages.getPeerSettings</a>; it is also contained in the <a href="/constructor/userFull">userFull</a> constructor returned by <a href="/method/users.getFullUser">users.getFullUser</a>.</p>
<p>Changes to the chat bar may also be notified by the server using <a href="/constructor/updatePeerSettings">updatePeerSettings</a>. </p>
<p>What follows is a list of the various (<em>mutually exclusive</em>) chat bar types, along with the <strong>condition</strong> used to identify each type, by checking the appropriate flags of <a href="/constructor/peerSettings">peerSettings</a>. </p>
<h2><a class="anchor" href="#report-spam-or-unarchive" id="report-spam-or-unarchive" name="report-spam-or-unarchive"><i class="anchor-icon"></i></a>Report spam or unarchive</h2>
<pre><code><a href='/constructor/inputReportReasonSpam'>inputReportReasonSpam</a>#58dbcab8 = <a href='/type/ReportReason'>ReportReason</a>;
---functions---
<a href='/method/account.reportPeer'>account.reportPeer</a>#c5ba3d86 peer:<a href='/type/InputPeer'>InputPeer</a> reason:<a href='/type/ReportReason'>ReportReason</a> message:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>This action bar, associated to a private or secret chat, offers the user a button to report the chat for spam using <a href="/method/account.reportPeer">account.reportPeer</a> and <a href="/constructor/inputReportReasonSpam">inputReportReasonSpam</a>. </p>
<p><strong>Condition</strong>: the <a href="/constructor/peerSettings">peerSettings</a>.<code>report_spam</code> flag must be set.</p>
<p>Additionally, if the chat was automatically <a href="/api/folders#peer-folders">archived »</a>, an extra button can be shown to unarchive the chat <a href="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</p>
<h2><a class="anchor" href="#report-spam-block-or-add-contact" id="report-spam-block-or-add-contact" name="report-spam-block-or-add-contact"><i class="anchor-icon"></i></a>Report spam, block or add contact</h2>
<h2><a class="anchor" href="#add-contact" id="add-contact" name="add-contact"><i class="anchor-icon"></i></a>Add contact</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/contacts.addContact'>contacts.addContact</a>#e8f463d0 flags:<a href='/type/%23'>#</a> add_phone_privacy_exception:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputUser'>InputUser</a> first_name:<a href='/type/string'>string</a> last_name:<a href='/type/string'>string</a> phone:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>This action bar, associated to a private or secret chat, offers the user a button to share their phone number with the other user using <a href="/method/contacts.acceptContact">contacts.acceptContact</a>. </p>
<p><strong>Conditions</strong>:</p>
<ul>
<li>For secret chats, the <a href="/constructor/peerSettings">peerSettings</a>.<code>add_contact</code> flag must be set and the chat must not be archived.</li>
<li>For private chats, the <a href="/constructor/peerSettings">peerSettings</a>.<code>add_contact</code> flag must be set, and the <code>block_contact</code> and <code>report_spam</code> flags must <strong>not</strong> be set.</li>
</ul>
<p>Optionally, the <a href="/constructor/peerSettings">peerSettings</a>.<code>need_contacts_exception</code> flag may also be set: if so, the <code>add_phone_privacy_exception</code> flag <strong>must</strong> be set if the user clicks on the add contact button, invoking <a href="/method/contacts.acceptContact">contacts.acceptContact</a>. </p>
<h2><a class="anchor" href="#share-phone-number" id="share-phone-number" name="share-phone-number"><i class="anchor-icon"></i></a>Share phone number</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/contacts.acceptContact'>contacts.acceptContact</a>#f831a20f id:<a href='/type/InputUser'>InputUser</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>This action bar, associated to a private or secret chat, offers the user a button to share their phone number with the other user using <a href="/method/contacts.acceptContact">contacts.acceptContact</a>. </p>
<p><strong>Condition</strong>: the <a href="/constructor/peerSettings">peerSettings</a>.<code>share_contact</code> flag must be set.</p>
<h2><a class="anchor" href="#report-irrelevant-geolocation" id="report-irrelevant-geolocation" name="report-irrelevant-geolocation"><i class="anchor-icon"></i></a>Report irrelevant geolocation</h2>
<pre><code><a href='/constructor/inputReportReasonGeoIrrelevant'>inputReportReasonGeoIrrelevant</a>#dbd4feed = <a href='/type/ReportReason'>ReportReason</a>;
---functions---
<a href='/method/account.reportPeer'>account.reportPeer</a>#c5ba3d86 peer:<a href='/type/InputPeer'>InputPeer</a> reason:<a href='/type/ReportReason'>ReportReason</a> message:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>This bar indicates that the associated location-based supergroup can be reported for having an unrelated location using a bar button that invokes <a href="/method/account.reportPeer">account.reportPeer</a> with <code>reason</code> <a href="/method/inputReportReasonGeoIrrelevant">inputReportReasonGeoIrrelevant</a>. </p>
<p><strong>Condition</strong>: the <a href="/constructor/peerSettings">peerSettings</a>.<code>report_geo</code> flag must be set.</p>
<h2><a class="anchor" href="#invite-new-members" id="invite-new-members" name="invite-new-members"><i class="anchor-icon"></i></a>Invite new members</h2>
<p>Schema:</p>
<pre><code>---functions---
<a href='/method/messages.addChatUser'>messages.addChatUser</a>#f24753e3 chat_id:<a href='/type/long'>long</a> user_id:<a href='/type/InputUser'>InputUser</a> fwd_limit:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/channels.inviteToChannel'>channels.inviteToChannel</a>#199f3a6c channel:<a href='/type/InputChannel'>InputChannel</a> users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>This bar indicates that the associated group was created recently, and it offers a bar button to invite new members using <a href="/method/messages.addChatUser">messages.addChatUser</a> or <a href="/method/channels.inviteToChannel">channels.inviteToChannel</a>, depending on whether the associated peer is a <a href="/api/channel">group or a supergroup</a>.</p>
<p><strong>Condition</strong>: the <a href="/constructor/peerSettings">peerSettings</a>.<code>invite_members</code> flag must be set.</p>
<h2><a class="anchor" href="#an-admin-from-a-recent-join-request-is-contacting-you" id="an-admin-from-a-recent-join-request-is-contacting-you" name="an-admin-from-a-recent-join-request-is-contacting-you"><i class="anchor-icon"></i></a>An admin from a recent join request is contacting you</h2>
<p>This bar indicates that the associated private or secret chat is a chat with an administrator of a <a href="/api/channel">group or channel</a> to which the user sent a <a href="/api/invites#join-requests">join request, see here for more info on join requests »</a>. </p>
<p><strong>Condition</strong>: the <code>request_chat_title</code> and <code>request_chat_date</code> fields of <a href="/constructor/peerSettings">peerSettings</a> must both be set; optionally <code>request_chat_broadcast</code> may also be set:</p>
<ul>
<li><code>request_chat_title</code> - Contains the group/channel's title.</li>
<li><code>request_chat_date</code> - Contains the timestamp indicating when the join request was sent.</li>
<li><code>request_chat_broadcast</code> - This flag is set if the join request is related to a channel (otherwise, the join request is related to a group).</li>
</ul></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -284,7 +284,6 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"chatlist_update_period": 300,
"small_queue_max_active_operations_count": 5,
"large_queue_max_active_operations_count": 2,
"story_expire_period": 86400,
"story_viewers_expire_period": 86400,
"story_expiring_limit_default": 3,
"story_expiring_limit_premium": 100,
@ -461,14 +460,16 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#large-queue-max-active-operations-count" id="large-queue-max-active-operations-count" name="large-queue-max-active-operations-count"><i class="anchor-icon"></i></a><code>large_queue_max_active_operations_count</code></h4>
<p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files bigger than 20MB. (integer)</p>
<h4><a class="anchor" href="#authorization-autoconfirm-period" id="authorization-autoconfirm-period" name="authorization-autoconfirm-period"><i class="anchor-icon"></i></a><code>authorization_autoconfirm_period</code></h4>
<h4><a class="anchor" href="#story-expire-period" id="story-expire-period" name="story-expire-period"><i class="anchor-icon"></i></a><code>story_expire_period</code></h4>
<h4><a class="anchor" href="#story-viewers-expire-period" id="story-viewers-expire-period" name="story-viewers-expire-period"><i class="anchor-icon"></i></a><code>story_viewers_expire_period</code></h4>
<p>The exact list of users that viewed the story will be hidden from the poster this many seconds after the story expires. (integer)</p>
<p>This limit applies <strong>only</strong> to non-<a href="/api/premium">Premium</a> users, <a href="/api/premium">Premium</a> users can <strong>always</strong> access the viewer list.</p>
<h4><a class="anchor" href="#story-expiring-limit-default" id="story-expiring-limit-default" name="story-expiring-limit-default"><i class="anchor-icon"></i></a><code>story_expiring_limit_default</code></h4>
<p>The maximum number of active stories </p>
<h4><a class="anchor" href="#story-expiring-limit-premium" id="story-expiring-limit-premium" name="story-expiring-limit-premium"><i class="anchor-icon"></i></a><code>story_expiring_limit_premium</code></h4>
<h4><a class="anchor" href="#story-caption-length-limit-premium" id="story-caption-length-limit-premium" name="story-caption-length-limit-premium"><i class="anchor-icon"></i></a><code>story_caption_length_limit_premium</code></h4>
<p>The maximum UTF-8 length of story captions for <a href="/api/premium">Premium</a> users (integer)</p>
<p>The maximum UTF-8 length of story captions for <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#story-caption-length-limit-default" id="story-caption-length-limit-default" name="story-caption-length-limit-default"><i class="anchor-icon"></i></a><code>story_caption_length_limit_default</code></h4>
<p>The maximum UTF-8 length of story captions for non-<a href="/api/premium">Premium</a> users (integer)</p>
<p>The maximum UTF-8 length of story captions for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-posting" id="stories-posting" name="stories-posting"><i class="anchor-icon"></i></a><code>stories_posting</code></h4>
<p>Indicates whether users can post stories. (string)</p>
<p>One of:</p>
@ -484,10 +485,15 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#stories-stealth-cooldown-period" id="stories-stealth-cooldown-period" name="stories-stealth-cooldown-period"><i class="anchor-icon"></i></a><code>stories_stealth_cooldown_period</code></h4>
<p>After enabling <a href="/api/stories#stealth-mode">stories stealth mode</a>, this many seconds must elapse before the user is allowed to enable it again. (integer)</p>
<h4><a class="anchor" href="#stories-sent-weekly-limit-default" id="stories-sent-weekly-limit-default" name="stories-sent-weekly-limit-default"><i class="anchor-icon"></i></a><code>stories_sent_weekly_limit_default</code></h4>
<p>Maximum number of stories that can be sent in a week by non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-sent-weekly-limit-premium" id="stories-sent-weekly-limit-premium" name="stories-sent-weekly-limit-premium"><i class="anchor-icon"></i></a><code>stories_sent_weekly_limit_premium</code></h4>
<p>Maximum number of stories that can be sent in a week by <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-sent-monthly-limit-default" id="stories-sent-monthly-limit-default" name="stories-sent-monthly-limit-default"><i class="anchor-icon"></i></a><code>stories_sent_monthly_limit_default</code></h4>
<p>Maximum number of stories that can be sent in a month by non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-sent-monthly-limit-premium" id="stories-sent-monthly-limit-premium" name="stories-sent-monthly-limit-premium"><i class="anchor-icon"></i></a><code>stories_sent_monthly_limit_premium</code></h4>
<p>Maximum number of stories that can be sent in a month by <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-venue-search-username" id="stories-venue-search-username" name="stories-venue-search-username"><i class="anchor-icon"></i></a><code>stories_venue_search_username</code></h4>
<p>Username of the inline bot to use to generate venue location tags for stories, see <a href="/api/stories#location-tags">here »</a> for more info. (string)</p>
<h4><a class="anchor" href="#stories-all-hidden" id="stories-all-hidden" name="stories-all-hidden"><i class="anchor-icon"></i></a><code>stories_all_hidden</code></h4>
<h4><a class="anchor" href="#stories-entities" id="stories-entities" name="stories-entities"><i class="anchor-icon"></i></a><code>stories_entities</code></h4>
<h4><a class="anchor" href="#stories-export-nopublic-link" id="stories-export-nopublic-link" name="stories-export-nopublic-link"><i class="anchor-icon"></i></a><code>stories_export_nopublic_link</code></h4>

View file

@ -0,0 +1,238 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Contacts</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Working with contacts.
Importing phone contacts
Schema:
inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string…">
<meta property="og:title" content="Contacts">
<meta property="og:image" content="">
<meta property="og:description" content="Working with contacts.
Importing phone contacts
Schema:
inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/contacts" >Contacts</a></li></ul></div>
<h1 id="dev_page_title">Contacts</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Working with contacts.</p>
<h2><a class="anchor" href="#importing-phone-contacts" id="importing-phone-contacts" name="importing-phone-contacts"><i class="anchor-icon"></i></a>Importing phone contacts</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/inputPhoneContact'>inputPhoneContact</a>#f392b7f4 client_id:<a href='/type/long'>long</a> phone:<a href='/type/string'>string</a> first_name:<a href='/type/string'>string</a> last_name:<a href='/type/string'>string</a> = <a href='/type/InputContact'>InputContact</a>;
<a href='/constructor/importedContact'>importedContact</a>#c13e3c50 user_id:<a href='/type/long'>long</a> client_id:<a href='/type/long'>long</a> = <a href='/type/ImportedContact'>ImportedContact</a>;
<a href='/constructor/popularContact'>popularContact</a>#5ce14175 client_id:<a href='/type/long'>long</a> importers:<a href='/type/int'>int</a> = <a href='/type/PopularContact'>PopularContact</a>;
<a href='/constructor/contacts.importedContacts'>contacts.importedContacts</a>#77d01c3b imported:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/ImportedContact'>ImportedContact</a>&gt; popular_invites:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PopularContact'>PopularContact</a>&gt; retry_contacts:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/contacts.ImportedContacts'>contacts.ImportedContacts</a>;
---functions---
<a href='/method/contacts.importContacts'>contacts.importContacts</a>#2c800be5 contacts:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputContact'>InputContact</a>&gt; = <a href='/type/contacts.ImportedContacts'>contacts.ImportedContacts</a>;</code></pre>
<p>To upload the local contact list to Telegram and see which contacts are already signed up on telegram, use <a href="/method/contacts.importContacts">contacts.importContacts</a>, passing an array of <a href="/constructor/inputPhoneContact">inputPhoneContact</a> constructors, containing:</p>
<ul>
<li><code>phone</code> - The phone number in international format</li>
<li><code>first_name</code> - First name</li>
<li><code>last_name</code> - Last name, can be empty</li>
<li><code>client_id</code> - An arbitrary 64-bit integer (<strong>not</strong> the contact's Telegram user ID, since we do not have it yet); make sure there are no collisions between the client_ids passed to a single <a href="/method/contacts.importContacts">contacts.importContacts</a> call (for example, use a simple incremental ID starting from 0)</li>
</ul>
<p>The method will return a <a href="/constructor/contacts.importedContacts">contacts.importedContacts</a> constructor, containing the following fields:</p>
<ul>
<li><code>imported</code> - A list of successfully imported contacts that have an associated Telegram account as <a href="/constructor/importedContact">importedContact</a> constructors.<br>
<code>user_id</code> is the Telegram user ID, <code>client_id</code> is the <code>client_id</code> associated to the contact, passed during the method call.
Note that according to the user's <a href="/api/privacy">privacy settings</a>, not all contacts which have an associated Telegram account may be returned here.</li>
<li><code>users</code> - Contains info about the Telegram users mentioned in <code>imported</code></li>
<li><code>popular_invites</code> - Contains info about popular contacts: each <a href="/constructor/popularContact">popularContact</a> constructor indicates that the contact with the specified <code>client_id</code> was imported <code>imported</code> times by that many Telegram users.</li>
<li><code>retry_contacts</code> - List of contact ids that could not be imported due to a server-side system limitation and have to be reimported with another call to <a href="/constructor/contacts.importedContacts">contacts.importedContacts</a>.</li>
</ul>
<h2><a class="anchor" href="#adding-telegram-users-as-contacts" id="adding-telegram-users-as-contacts" name="adding-telegram-users-as-contacts"><i class="anchor-icon"></i></a>Adding Telegram users as contacts</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/users.userFull'>users.userFull</a>#3b6d152e full_user:<a href='/type/UserFull'>UserFull</a> chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/users.UserFull'>users.UserFull</a>;
<a href='/constructor/inputUser'>inputUser</a>#f21158c6 user_id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputUser'>InputUser</a>;
<a href='/constructor/user'>user</a>#abb5f120 flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Username'>Username</a>&gt; stories_max_id:flags2.5?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
<a href='/constructor/peerSettings'>peerSettings</a>#a518110d flags:<a href='/type/%23'>#</a> report_spam:flags.0?<a href='/constructor/true'>true</a> add_contact:flags.1?<a href='/constructor/true'>true</a> block_contact:flags.2?<a href='/constructor/true'>true</a> share_contact:flags.3?<a href='/constructor/true'>true</a> need_contacts_exception:flags.4?<a href='/constructor/true'>true</a> report_geo:flags.5?<a href='/constructor/true'>true</a> autoarchived:flags.7?<a href='/constructor/true'>true</a> invite_members:flags.8?<a href='/constructor/true'>true</a> request_chat_broadcast:flags.10?<a href='/constructor/true'>true</a> geo_distance:flags.6?<a href='/type/int'>int</a> request_chat_title:flags.9?<a href='/type/string'>string</a> request_chat_date:flags.9?<a href='/type/int'>int</a> = <a href='/type/PeerSettings'>PeerSettings</a>;
<a href='/constructor/userFull'>userFull</a>#b9b12c6c flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>&gt; wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> = <a href='/type/UserFull'>UserFull</a>;
<a href='/constructor/updatePeerSettings'>updatePeerSettings</a>#6a7e7366 peer:<a href='/type/Peer'>Peer</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/users.getFullUser'>users.getFullUser</a>#b60f5918 id:<a href='/type/InputUser'>InputUser</a> = <a href='/type/users.UserFull'>users.UserFull</a>;
<a href='/method/contacts.addContact'>contacts.addContact</a>#e8f463d0 flags:<a href='/type/%23'>#</a> add_phone_privacy_exception:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputUser'>InputUser</a> first_name:<a href='/type/string'>string</a> last_name:<a href='/type/string'>string</a> phone:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/contacts.acceptContact'>contacts.acceptContact</a>#f831a20f id:<a href='/type/InputUser'>InputUser</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Telegram users may also be added to the contact list (even if we do not have access to their phone number!) using <a href="/method/contacts.addContact">contacts.addContact</a>. </p>
<p>Set the <code>add_phone_privacy_exception</code> flag if we wish to allow the other user to see our phone number: this flag <strong>must</strong> be set if the <code>need_contacts_exception</code> flag of [peerSettings] is set (see the <a href="/api/action-bar">action bar documentation »</a>). </p>
<h2><a class="anchor" href="#fetching-the-contact-list" id="fetching-the-contact-list" name="fetching-the-contact-list"><i class="anchor-icon"></i></a>Fetching the contact list</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/contact'>contact</a>#145ade0b user_id:<a href='/type/long'>long</a> mutual:<a href='/type/Bool'>Bool</a> = <a href='/type/Contact'>Contact</a>;
<a href='/constructor/user'>user</a>#abb5f120 flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Username'>Username</a>&gt; stories_max_id:flags2.5?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
<a href='/constructor/contacts.contacts'>contacts.contacts</a>#eae87e42 contacts:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Contact'>Contact</a>&gt; saved_count:<a href='/type/int'>int</a> users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/contacts.Contacts'>contacts.Contacts</a>;
<a href='/constructor/contacts.contactsNotModified'>contacts.contactsNotModified</a>#b74ba9d2 = <a href='/type/contacts.Contacts'>contacts.Contacts</a>;
<a href='/constructor/savedPhoneContact'>savedPhoneContact</a>#1142bd56 phone:<a href='/type/string'>string</a> first_name:<a href='/type/string'>string</a> last_name:<a href='/type/string'>string</a> date:<a href='/type/int'>int</a> = <a href='/type/SavedContact'>SavedContact</a>;
---functions---
<a href='/method/contacts.getContacts'>contacts.getContacts</a>#5dd69e12 hash:<a href='/type/long'>long</a> = <a href='/type/contacts.Contacts'>contacts.Contacts</a>;
<a href='/method/contacts.getSaved'>contacts.getSaved</a>#82f1e39f = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/SavedContact'>SavedContact</a>&gt;;</code></pre>
<p>Use <a href="/method/contacts.getContacts">contacts.getContacts</a> to obtain all members of the contact list that have an associated Telegram account. </p>
<p>To obtain the <em>full</em> contact list, including contacts which do not have an associated Telegram account, use <a href="/method/contacts.getSaved">contacts.getSaved</a> in combination with a <a href="/api/takeout">takeout session »</a>. </p>
<h2><a class="anchor" href="#getting-contact-statuses" id="getting-contact-statuses" name="getting-contact-statuses"><i class="anchor-icon"></i></a>Getting contact statuses</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/userStatusEmpty'>userStatusEmpty</a>#9d05049 = <a href='/type/UserStatus'>UserStatus</a>;
<a href='/constructor/userStatusOnline'>userStatusOnline</a>#edb93949 expires:<a href='/type/int'>int</a> = <a href='/type/UserStatus'>UserStatus</a>;
<a href='/constructor/userStatusOffline'>userStatusOffline</a>#8c703f was_online:<a href='/type/int'>int</a> = <a href='/type/UserStatus'>UserStatus</a>;
<a href='/constructor/userStatusRecently'>userStatusRecently</a>#e26f42f1 = <a href='/type/UserStatus'>UserStatus</a>;
<a href='/constructor/userStatusLastWeek'>userStatusLastWeek</a>#7bf09fc = <a href='/type/UserStatus'>UserStatus</a>;
<a href='/constructor/userStatusLastMonth'>userStatusLastMonth</a>#77ebc742 = <a href='/type/UserStatus'>UserStatus</a>;
<a href='/constructor/contactStatus'>contactStatus</a>#16d9703b user_id:<a href='/type/long'>long</a> status:<a href='/type/UserStatus'>UserStatus</a> = <a href='/type/ContactStatus'>ContactStatus</a>;
---functions---
<a href='/method/contacts.getStatuses'>contacts.getStatuses</a>#c4a353ee = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/ContactStatus'>ContactStatus</a>&gt;;</code></pre>
<p>Use <a href="/method/contacts.getStatuses">contacts.getStatuses</a> to obtain the online statuses of all contacts with a phone number.</p>
<h2><a class="anchor" href="#searching-for-contacts" id="searching-for-contacts" name="searching-for-contacts"><i class="anchor-icon"></i></a>Searching for contacts</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/contacts.found'>contacts.found</a>#b3134d9d my_results:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Peer'>Peer</a>&gt; results:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Peer'>Peer</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/contacts.Found'>contacts.Found</a>;
---functions---
<a href='/method/contacts.search'>contacts.search</a>#11f812d8 q:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/contacts.Found'>contacts.Found</a>;</code></pre>
<h2><a class="anchor" href="#deleting-contacts" id="deleting-contacts" name="deleting-contacts"><i class="anchor-icon"></i></a>Deleting contacts</h2>
<p>Schema:</p>
<pre><code>---functions---
<a href='/method/contacts.deleteContacts'>contacts.deleteContacts</a>#96a0e00 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/Updates'>Updates</a>;
<a href='/method/contacts.deleteByPhones'>contacts.deleteByPhones</a>#1013fd9e phones:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Use <a href="/method/contacts.deleteContacts">contacts.deleteContacts</a> to delete contacts with an associated Telegram account; the returned <a href="/constructor/Updates">Updates</a> will contain updated user information. </p>
<p>Use <a href="/method/contacts.deleteByPhones">contacts.deleteByPhones</a> to delete contacts by their phone number, even if they don't have an associated Telegram account.</p>
<h2><a class="anchor" href="#blocking-users" id="blocking-users" name="blocking-users"><i class="anchor-icon"></i></a>Blocking users</h2>
<pre><code><a href='/constructor/contacts.block'>contacts.block</a>#2e2e8734 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/constructor/contacts.unblock'>contacts.unblock</a>#b550d328 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/constructor/contacts.setBlocked'>contacts.setBlocked</a>#94c65c76 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPeer'>InputPeer</a>&gt; limit:<a href='/type/int'>int</a> = <a href='/type/Bool'>Bool</a>;
<a href='/constructor/contacts.getBlocked'>contacts.getBlocked</a>#9a868f80 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/contacts.Blocked'>contacts.Blocked</a>;</code></pre>
<h2><a class="anchor" href="#" id="" name=""><i class="anchor-icon"></i></a></h2>
<pre><code><a href='/constructor/contacts.getContactIDs'>contacts.getContactIDs</a>#7adc669d hash:<a href='/type/long'>long</a> = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;
<a href='/constructor/contacts.resetSaved'>contacts.resetSaved</a>#879537f1 = <a href='/type/Bool'>Bool</a>;
<a href='/constructor/contacts.getLocated'>contacts.getLocated</a>#d348bc44 flags:<a href='/type/%23'>#</a> background:flags.1?<a href='/constructor/true'>true</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> self_expires:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/constructor/contacts.blockFromReplies'>contacts.blockFromReplies</a>#29a8962c flags:<a href='/type/%23'>#</a> delete_message:flags.0?<a href='/constructor/true'>true</a> delete_history:flags.1?<a href='/constructor/true'>true</a> report_spam:flags.2?<a href='/constructor/true'>true</a> msg_id:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -99,12 +99,12 @@
<li>Added <a href="/constructor/updateNewAuthorization">updateNewAuthorization</a> - Authorized to the current user's account through an unknown device.</li>
<li>Added <a href="/constructor/storiesStealthMode">storiesStealthMode</a> - Information about the current <a href="/api/stories#stealth-mode">stealth mode</a> session.</li>
<li>Added <a href="/constructor/updateStoriesStealthMode">updateStoriesStealthMode</a> - Indicates that <a href="/api/stories#stealth-mode">stories stealth mode</a> was activated.</li>
<li>Added <a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a> - </li>
<li>Added <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> - </li>
<li>Added <a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a> - Coordinates and size of a clicable rectangular area on top of a story.</li>
<li>Added <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> - Represents a location tag attached to a <a href="/api/story">story</a>, with additional venue information.</li>
<li>Added <a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a> - </li>
<li>Added <a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a> - </li>
<li>Added <a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a> - Represents a geolocation tag attached to a <a href="/api/story">story</a>.</li>
<li>Added <a href="/constructor/updateSentStoryReaction">updateSentStoryReaction</a> - </li>
<li>Added <a href="/constructor/mediaAreaSuggestedReaction">mediaAreaSuggestedReaction</a> - </li>
<li>Added <a href="/constructor/mediaAreaSuggestedReaction">mediaAreaSuggestedReaction</a> - Represents a reaction bubble.</li>
<li>Added <a href="/constructor/peerStories">peerStories</a> - </li>
<li>Added <a href="/constructor/stories.peerStories">stories.peerStories</a> - </li>
<li>Added <a href="/constructor/stories.boostsStatus">stories.boostsStatus</a> - The current <a href="/api/stories#boosts">boost status »</a> of a channel.</li>

View file

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Privacy</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram allows users to specify granular privacy settings, choosing which users can or can&#39;t interact with them in certain…">
<meta property="og:title" content="Privacy">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram allows users to specify granular privacy settings, choosing which users can or can&#39;t interact with them in certain…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/privacy" >Privacy</a></li></ul></div>
<h1 id="dev_page_title">Privacy</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram allows users to specify granular privacy settings, choosing which users can or can't interact with them in certain ways.</p>
<h2><a class="anchor" href="#privacy-rules" id="privacy-rules" name="privacy-rules"><i class="anchor-icon"></i></a>Privacy rules</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/inputPrivacyValueAllowContacts'>inputPrivacyValueAllowContacts</a>#d09e07b = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowAll'>inputPrivacyValueAllowAll</a>#184b35ce = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowUsers'>inputPrivacyValueAllowUsers</a>#131cc67f users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowContacts'>inputPrivacyValueDisallowContacts</a>#ba52007 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowAll'>inputPrivacyValueDisallowAll</a>#d66b66c9 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowUsers'>inputPrivacyValueDisallowUsers</a>#90110467 users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowChatParticipants'>inputPrivacyValueAllowChatParticipants</a>#840649cf chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowChatParticipants'>inputPrivacyValueDisallowChatParticipants</a>#e94f0f86 chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowCloseFriends'>inputPrivacyValueAllowCloseFriends</a>#2f453e49 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/privacyValueAllowContacts'>privacyValueAllowContacts</a>#fffe1bac = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowAll'>privacyValueAllowAll</a>#65427b82 = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowUsers'>privacyValueAllowUsers</a>#b8905fb2 users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowContacts'>privacyValueDisallowContacts</a>#f888fa1a = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowAll'>privacyValueDisallowAll</a>#8b73e763 = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowUsers'>privacyValueDisallowUsers</a>#e4621141 users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowChatParticipants'>privacyValueAllowChatParticipants</a>#6b134e8e chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowChatParticipants'>privacyValueDisallowChatParticipants</a>#41c87565 chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowCloseFriends'>privacyValueAllowCloseFriends</a>#f7e8d89b = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/user'>user</a>#abb5f120 flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Username'>Username</a>&gt; stories_max_id:flags2.5?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
---functions---
<a href='/method/contacts.editCloseFriends'>contacts.editCloseFriends</a>#ba6705f0 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Privacy <strong>rules</strong> indicate <em>who</em> can or can't do something and are specified by a <a href="/type/PrivacyRule">PrivacyRule</a>, and its input counterpart <a href="/type/InputPrivacyRule">InputPrivacyRule</a>.<br>
<a href="/type/InputPrivacyRule">InputPrivacyRule</a> constructors are <em>passed</em> as input to methods that accept privacy rules, while <a href="/type/PrivacyRule">PrivacyRule</a>s are contained in constructors <em>returned</em> by the API. </p>
<p>See <a href="/type/InputPrivacyRule">the type page »</a> for a full list of privacy rules and their descriptions. </p>
<p>One privacy rule in particular should be mentioned separately, (input)<a href="/constructor/privacyValueAllowCloseFriends">privacyValueAllowCloseFriends</a>: this privacy rule, which can be used only when <a href="/api/stories">posting stories</a>, refers exclusively to a list of "close friends", that can be modified using <a href="/method/contacts.editCloseFriends">contacts.editCloseFriends</a>, passing the full close friend list as a list of user IDs: note that only users <a href="/api/contacts">in the contact list (even without a phone number) »</a> can be added to the close friends list. </p>
<p>The current list of close friends can be checking which users in our contact list have the <code>close_friend</code> flag set in the associated <a href="/constructor/user">user</a> constructor, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for more info on how to fetch the contact list.</p>
<h2><a class="anchor" href="#privacy-keys" id="privacy-keys" name="privacy-keys"><i class="anchor-icon"></i></a>Privacy keys</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/inputPrivacyKeyStatusTimestamp'>inputPrivacyKeyStatusTimestamp</a>#4f96cb18 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyChatInvite'>inputPrivacyKeyChatInvite</a>#bdfb0426 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyPhoneCall'>inputPrivacyKeyPhoneCall</a>#fabadc5f = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyPhoneP2P'>inputPrivacyKeyPhoneP2P</a>#db9e70d2 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyForwards'>inputPrivacyKeyForwards</a>#a4dd4c08 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyProfilePhoto'>inputPrivacyKeyProfilePhoto</a>#5719bacc = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyPhoneNumber'>inputPrivacyKeyPhoneNumber</a>#352dafa = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyAddedByPhone'>inputPrivacyKeyAddedByPhone</a>#d1219bdd = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyVoiceMessages'>inputPrivacyKeyVoiceMessages</a>#aee69d68 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyAbout'>inputPrivacyKeyAbout</a>#3823cc40 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/privacyKeyStatusTimestamp'>privacyKeyStatusTimestamp</a>#bc2eab30 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyChatInvite'>privacyKeyChatInvite</a>#500e6dfa = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyPhoneCall'>privacyKeyPhoneCall</a>#3d662b7b = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyPhoneP2P'>privacyKeyPhoneP2P</a>#39491cc8 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyForwards'>privacyKeyForwards</a>#69ec56a3 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyProfilePhoto'>privacyKeyProfilePhoto</a>#96151fed = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyPhoneNumber'>privacyKeyPhoneNumber</a>#d19ae46d = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyAddedByPhone'>privacyKeyAddedByPhone</a>#42ffd42b = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyVoiceMessages'>privacyKeyVoiceMessages</a>#697f414 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyAbout'>privacyKeyAbout</a>#a486b761 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/account.privacyRules'>account.privacyRules</a>#50a04e45 rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PrivacyRule'>PrivacyRule</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;
<a href='/constructor/updatePrivacy'>updatePrivacy</a>#ee3b272a key:<a href='/type/PrivacyKey'>PrivacyKey</a> rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PrivacyRule'>PrivacyRule</a>&gt; = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/account.getPrivacy'>account.getPrivacy</a>#dadbc950 key:<a href='/type/InputPrivacyKey'>InputPrivacyKey</a> = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;
<a href='/method/account.setPrivacy'>account.setPrivacy</a>#c9f81ce8 key:<a href='/type/InputPrivacyKey'>InputPrivacyKey</a> rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;</code></pre>
<p>Privacy <strong>keys</strong> together with <a href="#privacy-rules">privacy rules »</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>.<br>
<a href="/type/InputPrivacyKey">InputPrivacyKey</a> constructors are <em>passed</em> as input to methods that accept privacy keys, while <a href="/type/PrivacyKey">PrivacyKey</a>s are contained in constructors <em>returned</em> by the API. </p>
<p>See <a href="/type/InputPrivacyRule">the type page »</a> for a full list of privacy keys and their descriptions. </p>
<p>Use <a href="/method/account.getPrivacy">account.getPrivacy</a> to obtain the current set of <a href="#privacy-rules">rules</a> associated to a key, and <a href="/method/account.setPrivacy">account.setPrivacy</a> to change it.</p>
<p>Changing the privacy settings will trigger an <a href="/constructor/updatePrivacy">updatePrivacy</a>, sent to all currently logged in sessions of the current account.</p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -58,13 +58,126 @@
<a href='/method/stories.canSendStory'>stories.canSendStory</a>#c7dfdfdd peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/stories.sendStory'>stories.sendStory</a>#bcb73644 flags:<a href='/type/%23'>#</a> pinned:flags.2?<a href='/constructor/true'>true</a> noforwards:flags.4?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.5?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; random_id:<a href='/type/long'>long</a> period:flags.3?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/stories.editStory'>stories.editStory</a>#b583ba46 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> media:flags.0?<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.1?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:flags.2?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; = <a href='/type/Updates'>Updates</a>;
<a href='/method/stories.deleteStories'>stories.deleteStories</a>#ae59db5f peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;</code></pre>
<p>Before posting a story, clients should invoke <a href="/method/stories.canSendStory">stories.canSendStory</a>, to make sure </p>
<a href='/method/contacts.getBlocked'>contacts.getBlocked</a>#9a868f80 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/contacts.Blocked'>contacts.Blocked</a>;
<a href='/method/contacts.block'>contacts.block</a>#2e2e8734 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/contacts.unblock'>contacts.unblock</a>#b550d328 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Before posting a story, clients should invoke <a href="/method/stories.canSendStory">stories.canSendStory</a>, to make sure they can send stories to the specified <code>peer</code> (which can be <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to send the story as a normal user and <a href="/constructor/inputPeerChannel">inputPeerChannel</a> to send a story as a channel). </p>
<p>This methods returns <a href="/constructor/boolTrue">boolTrue</a> only if:</p>
<ul>
<li>The current user can is an administrator of the channel; otherwise, a <code>CHAT_ADMIN_REQUIRED</code> error is returned.</li>
<li>The current user has <a href="/constructor/chatAdminRights"><code>post_stories</code> admin rights</a>, and the </li>
<li>If we're trying to send a story as a channel:<ul>
<li>The current user is an administrator of the channel and has <a href="/constructor/chatAdminRights"><code>post_stories</code> admin rights</a>; otherwise, a <code>CHAT_ADMIN_REQUIRED</code> error is returned.</li>
<li>AND the channel has <a href="#boosts">received enough boosts to post the story »</a>; otherwise, a <code>BOOSTS_REQUIRED</code> error is returned.</li>
</ul>
</li>
<li>If we're trying to send a story as the current user:<ul>
<li>The user can post stories according to the <a href="/api/config#stories-posting"><code>stories_posting</code> client configuration parameter</a>; otherwise, a <code>PREMIUM_ACCOUNT_REQUIRED</code> error is returned.</li>
<li>AND The user hasn't hit the maximum active stories limit specified by the <a href="/api/config#stories-sent-weekly-limit-default"><code>story_expiring_limit_*</code> client configuration parameters</a>; otherwise a <code>STORIES_TOO_MUCH</code> error is returned, indicating that the user should buy a <a href="/api/premium">Premium</a> subscription, delete an active story, or wait for the oldest story to expire.</li>
<li>AND The user hasn't hit the weekly story limit specified by the <a href="/api/config#stories-sent-weekly-limit-default"><code>stories_sent_weekly_limit_*</code> client configuration parameters</a>; otherwise, a <code>STORY_SEND_FLOOD_WEEKLY_%d</code> error is returned, indicating the number of seconds to wait before posting a new story.</li>
<li>AND The user hasn't hit the monthly story limit specified by the <a href="/api/config#stories-sent-monthly-limit-default"><code>stories_sent_monthly_limit_*</code> client configuration parameters</a>; otherwise, a <code>STORY_SEND_FLOOD_MONTHLY_%d</code> error is returned, indicating the number of seconds to wait before posting a new story.</li>
</ul>
</li>
</ul>
<p>After checking if a story can be posted, the client may invoke <a href="/method/stories.sendStory">stories.sendStory</a> to upload the story.<br>
Note that if any of the conditions changes in the period between the call to <a href="/method/stories.canSendStory">stories.canSendStory</a> and <a href="/method/stories.sendStory">stories.sendStory</a> (for example, the user uploads a story from another client, reaching the weekly limit), the same errors listed above for <a href="/method/stories.canSendStory">stories.canSendStory</a> will be emitted by <a href="/method/stories.sendStory">stories.sendStory</a>. </p>
<p>The parameters of <a href="/method/stories.sendStory">stories.sendStory</a> are fully described on the <a href="/method/stories.sendStory">method page »</a>, here are some of the most important ones:</p>
<ul>
<li><code>peer</code>: The peer to send the story as.</li>
<li><code>media</code>: The story media.</li>
<li><code>media_areas</code>: <a href="/api/stories#media-areas">Media areas</a> associated to the story, see <a href="/api/stories#media-areas">here »</a> for more info.</li>
<li><code>privacy_rules</code>: A set of <a href="/api/privacy#privacy-rules">privacy rules »</a> for the story as an array of <a href="/type/InputPrivacyRule">InputPrivacyRule</a> constructors, indicating who can or can't view the story.</li>
<li><code>expire</code>: Period after which the story is moved to archive (and <a href="#pinned-stories">to the profile</a> if <code>pinned</code> is set), in seconds; must be one of <code>6 * 3600</code>, <code>12 * 3600</code>, <code>86400</code>, or <code>2 * 86400</code> for Telegram Premium users, and <code>86400</code> otherwise.</li>
<li><code>pinned</code>: Whether to also <a href="#pinned-stories">add the story to the profile</a> automatically upon expiration. If not set, the story will only be added to the archive. </li>
</ul>
<p>A story may also be edited using <a href="/method/stories.editStory">stories.editStory</a>. </p>
<h3><a class="anchor" href="#pinned-stories" id="pinned-stories" name="pinned-stories"><i class="anchor-icon"></i></a>Pinned stories</h3>
<pre><code>---functions---
<a href='/method/stories.togglePinned'>stories.togglePinned</a>#9a75a1ef peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; pinned:<a href='/type/Bool'>Bool</a> = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;
<a href='/method/stories.getStoriesArchive'>stories.getStoriesArchive</a>#b4352016 peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/stories.Stories'>stories.Stories</a>;
<a href='/method/stories.toggleAllStoriesHidden'>stories.toggleAllStoriesHidden</a>#7c2557c4 hidden:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/stories.togglePeerStoriesHidden'>stories.togglePeerStoriesHidden</a>#bd0415c4 peer:<a href='/type/InputPeer'>InputPeer</a> hidden:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<h2><a class="anchor" href="#deleting-stories" id="deleting-stories" name="deleting-stories"><i class="anchor-icon"></i></a>Deleting stories</h2>
<pre><code>---functions---
<a href='/method/stories.deleteStories'>stories.deleteStories</a>#ae59db5f peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;</code></pre>
<p>Use the <a href="/method/stories.deleteStories">stories.deleteStories</a> method to delete one or more stories by their IDs, passed in <code>id</code>.</p>
<h2><a class="anchor" href="#watching-stories" id="watching-stories" name="watching-stories"><i class="anchor-icon"></i></a>Watching stories</h2>
<pre><code>---functions---
<a href='/method/stories.getAllStories'>stories.getAllStories</a>#eeb0d625 flags:<a href='/type/%23'>#</a> next:flags.1?<a href='/constructor/true'>true</a> hidden:flags.2?<a href='/constructor/true'>true</a> state:flags.0?<a href='/type/string'>string</a> = <a href='/type/stories.AllStories'>stories.AllStories</a>;
<a href='/method/stories.getPinnedStories'>stories.getPinnedStories</a>#5821a5dc peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/stories.Stories'>stories.Stories</a>;
<a href='/method/stories.getStoriesByID'>stories.getStoriesByID</a>#5774ca74 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/stories.Stories'>stories.Stories</a>;
<a href='/method/stories.readStories'>stories.readStories</a>#a556dac8 peer:<a href='/type/InputPeer'>InputPeer</a> max_id:<a href='/type/int'>int</a> = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;
<a href='/method/stories.incrementStoryViews'>stories.incrementStoryViews</a>#b2028afb peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/Bool'>Bool</a>;
<a href='/method/stories.getStoryViewsList'>stories.getStoryViewsList</a>#7ed23c57 flags:<a href='/type/%23'>#</a> just_contacts:flags.0?<a href='/constructor/true'>true</a> reactions_first:flags.2?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> q:flags.1?<a href='/type/string'>string</a> id:<a href='/type/int'>int</a> offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/stories.StoryViewsList'>stories.StoryViewsList</a>;
<a href='/method/stories.getStoriesViews'>stories.getStoriesViews</a>#28e16cc8 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/stories.StoryViews'>stories.StoryViews</a>;
<a href='/method/stories.exportStoryLink'>stories.exportStoryLink</a>#7b8def20 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> = <a href='/type/ExportedStoryLink'>ExportedStoryLink</a>;
<a href='/method/stories.report'>stories.report</a>#1923fa8c peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; reason:<a href='/type/ReportReason'>ReportReason</a> message:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/stories.getPeerStories'>stories.getPeerStories</a>#2c4ada50 peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/stories.PeerStories'>stories.PeerStories</a>;
<a href='/method/stories.getAllReadPeerStories'>stories.getAllReadPeerStories</a>#9b5ae7f9 = <a href='/type/Updates'>Updates</a>;
<a href='/method/stories.getPeerMaxIDs'>stories.getPeerMaxIDs</a>#535983c3 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPeer'>InputPeer</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;</code></pre>
<h2><a class="anchor" href="#media-areas" id="media-areas" name="media-areas"><i class="anchor-icon"></i></a>Media areas</h2>
<p>Schema:</p>
<pre><code><a href='/constructor/mediaAreaCoordinates'>mediaAreaCoordinates</a>#3d1ea4e x:<a href='/type/double'>double</a> y:<a href='/type/double'>double</a> w:<a href='/type/double'>double</a> h:<a href='/type/double'>double</a> rotation:<a href='/type/double'>double</a> = <a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a>;
<a href='/constructor/mediaAreaVenue'>mediaAreaVenue</a>#be82db9c coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> geo:<a href='/type/GeoPoint'>GeoPoint</a> title:<a href='/type/string'>string</a> address:<a href='/type/string'>string</a> provider:<a href='/type/string'>string</a> venue_id:<a href='/type/string'>string</a> venue_type:<a href='/type/string'>string</a> = <a href='/type/MediaArea'>MediaArea</a>;
<a href='/constructor/inputMediaAreaVenue'>inputMediaAreaVenue</a>#b282217f coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> query_id:<a href='/type/long'>long</a> result_id:<a href='/type/string'>string</a> = <a href='/type/MediaArea'>MediaArea</a>;
<a href='/constructor/mediaAreaGeoPoint'>mediaAreaGeoPoint</a>#df8b3b22 coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> geo:<a href='/type/GeoPoint'>GeoPoint</a> = <a href='/type/MediaArea'>MediaArea</a>;
<a href='/constructor/mediaAreaSuggestedReaction'>mediaAreaSuggestedReaction</a>#14455871 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> flipped:flags.1?<a href='/constructor/true'>true</a> coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> reaction:<a href='/type/Reaction'>Reaction</a> = <a href='/type/MediaArea'>MediaArea</a>;
<a href='/constructor/storyItem'>storyItem</a>#44c457ce flags:<a href='/type/%23'>#</a> pinned:flags.5?<a href='/constructor/true'>true</a> public:flags.7?<a href='/constructor/true'>true</a> close_friends:flags.8?<a href='/constructor/true'>true</a> min:flags.9?<a href='/constructor/true'>true</a> noforwards:flags.10?<a href='/constructor/true'>true</a> edited:flags.11?<a href='/constructor/true'>true</a> contacts:flags.12?<a href='/constructor/true'>true</a> selected_contacts:flags.13?<a href='/constructor/true'>true</a> out:flags.16?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> date:<a href='/type/int'>int</a> expire_date:<a href='/type/int'>int</a> caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; media:<a href='/type/MessageMedia'>MessageMedia</a> media_areas:flags.14?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; privacy:flags.2?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PrivacyRule'>PrivacyRule</a>&gt; views:flags.3?<a href='/type/StoryViews'>StoryViews</a> sent_reaction:flags.15?<a href='/type/Reaction'>Reaction</a> = <a href='/type/StoryItem'>StoryItem</a>;
---functions---
<a href='/method/stories.sendStory'>stories.sendStory</a>#bcb73644 flags:<a href='/type/%23'>#</a> pinned:flags.2?<a href='/constructor/true'>true</a> noforwards:flags.4?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.5?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; random_id:<a href='/type/long'>long</a> period:flags.3?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/stories.editStory'>stories.editStory</a>#b583ba46 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> media:flags.0?<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.1?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:flags.2?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Stories can have so-called "media areas": clickable rectangular areas with animated overlays on top of the story offering functionality like location tags or reactions. </p>
<p>The coordinates and size of each media area is specified in a <a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a> constructor attached to each <a href="/type/MediaArea">MediaArea</a>, see <a href="/constructor/mediaAreaCoordinates">the constructor page »</a> for more info. </p>
<p>After construction, the vector of <a href="/type/MediaArea">MediaArea</a> constructors can be passed to <a href="/method/stories.sendStory">stories.sendStory</a> or <a href="/method/stories.editStory">stories.editStory</a>.</p>
<h3><a class="anchor" href="#location-tags" id="location-tags" name="location-tags"><i class="anchor-icon"></i></a>Location tags</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/geoPoint'>geoPoint</a>#b2a2f663 flags:<a href='/type/%23'>#</a> long:<a href='/type/double'>double</a> lat:<a href='/type/double'>double</a> access_hash:<a href='/type/long'>long</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/GeoPoint'>GeoPoint</a>;
<a href='/constructor/mediaAreaGeoPoint'>mediaAreaGeoPoint</a>#df8b3b22 coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> geo:<a href='/type/GeoPoint'>GeoPoint</a> = <a href='/type/MediaArea'>MediaArea</a>;
<a href='/constructor/mediaAreaVenue'>mediaAreaVenue</a>#be82db9c coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> geo:<a href='/type/GeoPoint'>GeoPoint</a> title:<a href='/type/string'>string</a> address:<a href='/type/string'>string</a> provider:<a href='/type/string'>string</a> venue_id:<a href='/type/string'>string</a> venue_type:<a href='/type/string'>string</a> = <a href='/type/MediaArea'>MediaArea</a>;
<a href='/constructor/inputMediaAreaVenue'>inputMediaAreaVenue</a>#b282217f coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> query_id:<a href='/type/long'>long</a> result_id:<a href='/type/string'>string</a> = <a href='/type/MediaArea'>MediaArea</a>;</code></pre>
<p>Location tags are represented by a <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> or <a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a>, associated to a location sticker on top of the story media with an associated <a href="#media-area">clickable media area</a>. </p>
<p>Both constructors have an associated geolocation represented as a <a href="/constructor/geoPoint">geoPoint</a>, and information about the clickable media area on top of the story media as a <a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a> constructor. </p>
<p><a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a> is used to represent a simple geolocation without any extra information.<br>
<a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> is used to represent the location of a specific venue (i.e. a mall, a shop, a dance school et cetera), and apart from the venue's coordinates, it also contains a textual representation of the address, the venue name (<code>title</code>) and a venue type/ID (<code>venue_id</code>/<code>venue_type</code>) in a format supported by the venue provider specified in <code>provider</code>. </p>
<p>Currently, the only provider that needs to be supported is <code>foursquare</code>. </p>
<p>To send a <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a>, clients should use <a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a>, constructed as follows:</p>
<ul>
<li>If the user gives permission to share their location with the location provider, query the inline bot specified in the <a href="/api/config#stories-venue-search-username"><code>stories_venue_search_username</code> client configuration parameter »</a>, as described as the <a href="/api/bots/inline">inline queries documentation »</a>, populating the <code>geo_point</code>.<br>
Note that this should be done transparently in a map UI, not in the usual inline query UI in the chat text bar. </li>
<li>The results returned by the bot, containing a list of venues close to the specified <code>geo_point</code>, should be listed in the lower section of the map UI: upon selection, construct the <a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a> with:<ul>
<li><code>query_id</code>: the <code>query_id</code> from <a href="/constructor/messages.botResults">messages.botResults</a>.</li>
<li><code>result_id</code>: the <code>id</code> of the chosen result.</li>
</ul>
</li>
</ul>
<p>Clients may also re-use an existing <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> from a previously uploaded story.</p>
<h3><a class="anchor" href="#reactions" id="reactions" name="reactions"><i class="anchor-icon"></i></a>Reactions</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/reactionEmoji'>reactionEmoji</a>#1b2286b8 emoticon:<a href='/type/string'>string</a> = <a href='/type/Reaction'>Reaction</a>;
<a href='/constructor/reactionCustomEmoji'>reactionCustomEmoji</a>#8935fc73 document_id:<a href='/type/long'>long</a> = <a href='/type/Reaction'>Reaction</a>;
<a href='/constructor/mediaAreaSuggestedReaction'>mediaAreaSuggestedReaction</a>#14455871 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> flipped:flags.1?<a href='/constructor/true'>true</a> coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> reaction:<a href='/type/Reaction'>Reaction</a> = <a href='/type/MediaArea'>MediaArea</a>;
---functions---
<a href='/method/stories.sendReaction'>stories.sendReaction</a>#7fd736b2 flags:<a href='/type/%23'>#</a> add_to_recent:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> story_id:<a href='/type/int'>int</a> reaction:<a href='/type/Reaction'>Reaction</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Story <a href="/api/reactions">reactions</a> are implemented using a simple in-UI button that allows the user to send any reaction using <a href="/method/stories.sendReaction">stories.sendReaction</a>. </p>
<p>However, the poster of a story may also use <a href="/constructor/mediaAreaSuggestedReaction">mediaAreaSuggestedReaction</a> <a href="#media-areas">media areas »</a> to suggest some specific reactions as simple clickable buttons: they're rendered as a round comic-style thought bubble with its "tail" on the right, white background and the <a href="/api/reactions">reaction »</a> from the <code>reaction</code> field located in its center.<br>
If the <code>dark</code> flag is set, the background should by black.<br>
If the <code>flipped</code> flag is set, the "tail" should be located on the left.</p>
<p>Clicking it should invoke <a href="/method/stories.sendReaction">stories.sendReaction</a> as usual.</p>
<h2><a class="anchor" href="#stealth-mode" id="stealth-mode" name="stealth-mode"><i class="anchor-icon"></i></a>Stealth mode</h2>
<p><a href="/api/premium">Premium users</a> may enable <a href="https://telegram.org/tour/stories#stealth-mode">stealth mode</a>, erasing their views from any stories they opened in the past <a href="/api/config#stories-stealth-past-period"><code>stories_stealth_past_period</code> seconds »</a>, and hiding their views on stories for the next <a href="/api/config#stories-stealth-future-period"><code>stories_stealth_future_period</code> seconds »</a>, as specified by the <a href="/api/config#client-configuration">client configuration »</a>.</p>
<p>Schema:</p>
@ -119,13 +232,13 @@ A <code>BOOST_NOT_MODIFIED</code> RPC error will be returned when calling any of
<h3><a class="anchor" href="#posting-stories-as-a-channel" id="posting-stories-as-a-channel" name="posting-stories-as-a-channel"><i class="anchor-icon"></i></a>Posting stories as a channel</h3>
<pre><code><a href='/constructor/inputPeerChannel'>inputPeerChannel</a>#27bcbbfc channel_id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputPeer'>InputPeer</a>;
<a href='/constructor/messages.chats'>messages.chats</a>#64ff9fd5 chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; = <a href='/type/messages.Chats'>messages.Chats</a>;
---functions---
<a href='/method/stories.canSendStory'>stories.canSendStory</a>#c7dfdfdd peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/stories.sendStory'>stories.sendStory</a>#bcb73644 flags:<a href='/type/%23'>#</a> pinned:flags.2?<a href='/constructor/true'>true</a> noforwards:flags.4?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.5?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; random_id:<a href='/type/long'>long</a> period:flags.3?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/stories.editStory'>stories.editStory</a>#b583ba46 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> media:flags.0?<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.1?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:flags.2?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; = <a href='/type/Updates'>Updates</a>;
<a href='/method/stories.deleteStories'>stories.deleteStories</a>#ae59db5f peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt;;</code></pre>
<p>Everything works exactly the same as when <a href="#posting-stories">posting stories as a user</a>, with the only difference that clients should pass the appropriate <a href="/constructor/inputPeerChannel">inputPeerChannel</a> instead of <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <a href="/method/stories.canSendStory">stories.canSendStory</a>, <a href="/method/stories.sendStory">stories.sendStory</a> and all the other story methods, see the <a href="#posting-stories">main documentation »</a> for more info.</p></div>
<a href='/method/stories.getChatsToSend'>stories.getChatsToSend</a>#a56a8b60 = <a href='/type/messages.Chats'>messages.Chats</a>;</code></pre>
<p>Everything works exactly the same as when <a href="#posting-stories">posting stories as a user</a>, with the only difference that clients should pass the appropriate <a href="/constructor/inputPeerChannel">inputPeerChannel</a> instead of <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <a href="/method/stories.canSendStory">stories.canSendStory</a>, <a href="/method/stories.sendStory">stories.sendStory</a> and all the other story methods, see the <a href="#posting-stories">main documentation »</a> for more info. </p>
<p>Use <a href="/method/stories.getChatsToSend">stories.getChatsToSend</a> to obtain a list of channels where the user can post stories; <a href="/method/stories.canSendStory">stories.canSendStory</a> must still be used before uploading a story to make sure no other limit was reached, as described in the <a href="#posting-stories">main documentation »</a>.</p></div>
</div>

View file

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="">
<meta property="og:title" content="Page not found">
<meta property="og:image" content="">
<meta property="og:description" content="">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li></li></ul></div>
<h1 id="dev_page_title">Page not found</h1>
<div id="dev_page_content">The page has not been saved</div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,156 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Takeout</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram&#39;s API allows users to export all of their information through the takeout API.
account.takeout#4dba4501 id:long…">
<meta property="og:title" content="Takeout">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram&#39;s API allows users to export all of their information through the takeout API.
account.takeout#4dba4501 id:long…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/takeout" >Takeout</a></li></ul></div>
<h1 id="dev_page_title">Takeout</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram's API allows users to export all of their information through the takeout API.</p>
<pre><code><a href='/constructor/account.takeout'>account.takeout</a>#4dba4501 id:<a href='/type/long'>long</a> = <a href='/type/account.Takeout'>account.Takeout</a>;
<a href='/constructor/inputTakeoutFileLocation'>inputTakeoutFileLocation</a>#29be5899 = <a href='/type/InputFileLocation'>InputFileLocation</a>;
---functions---
<a href='/method/account.initTakeoutSession'>account.initTakeoutSession</a>#8ef3eab0 flags:<a href='/type/%23'>#</a> contacts:flags.0?<a href='/constructor/true'>true</a> message_users:flags.1?<a href='/constructor/true'>true</a> message_chats:flags.2?<a href='/constructor/true'>true</a> message_megagroups:flags.3?<a href='/constructor/true'>true</a> message_channels:flags.4?<a href='/constructor/true'>true</a> files:flags.5?<a href='/constructor/true'>true</a> file_max_size:flags.5?<a href='/type/long'>long</a> = <a href='/type/account.Takeout'>account.Takeout</a>;
invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X;
invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X;
<a href='/method/account.finishTakeoutSession'>account.finishTakeoutSession</a>#1d2652ee flags:<a href='/type/%23'>#</a> success:flags.0?<a href='/constructor/true'>true</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Use <a href="/method/account.initTakeoutSession">account.initTakeoutSession</a> to initialize a takeout session: pass the appropriate flags to enable usage of the corresponding methods, as described below. </p>
<p>When invoking the methods described below, each query must be wrapped using <a href="/method/invokeWithTakeout">invokeWithTakeout</a>, with the <code>id</code> returned by <a href="/method/account.initTakeoutSession">account.initTakeoutSession</a>. </p>
<p>After finishing the export, terminate the session using <a href="/method/account.finishTakeoutSession">account.finishTakeoutSession</a>. </p>
<h2><a class="anchor" href="#contacts" id="contacts" name="contacts"><i class="anchor-icon"></i></a>Contacts</h2>
<pre><code><a href='/constructor/savedPhoneContact'>savedPhoneContact</a>#1142bd56 phone:<a href='/type/string'>string</a> first_name:<a href='/type/string'>string</a> last_name:<a href='/type/string'>string</a> date:<a href='/type/int'>int</a> = <a href='/type/SavedContact'>SavedContact</a>;
---functions---
<a href='/method/contacts.getSaved'>contacts.getSaved</a>#82f1e39f = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/SavedContact'>SavedContact</a>&gt;;</code></pre>
<p>Use <a href="/method/contacts.getSaved">contacts.getSaved</a> to export the full contact list, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for another alternative method that may be used to fetch the full list of all contacts with a Telegram account, without using a takeout session.</p>
<h2><a class="anchor" href="#left-channels" id="left-channels" name="left-channels"><i class="anchor-icon"></i></a>Left channels</h2>
<pre><code><a href='/constructor/messages.chats'>messages.chats</a>#64ff9fd5 chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; = <a href='/type/messages.Chats'>messages.Chats</a>;
<a href='/constructor/messages.chatsSlice'>messages.chatsSlice</a>#9cd81144 count:<a href='/type/int'>int</a> chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; = <a href='/type/messages.Chats'>messages.Chats</a>;
---functions---
<a href='/method/channels.getLeftChannels'>channels.getLeftChannels</a>#8341ecc0 offset:<a href='/type/int'>int</a> = <a href='/type/messages.Chats'>messages.Chats</a>;</code></pre>
<p>Use <a href="/method/channels.getLeftChannels">channels.getLeftChannels</a> to get a list of channels or supergroups we left.</p>
<h2><a class="anchor" href="#" id="" name=""><i class="anchor-icon"></i></a></h2></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -44,9 +44,7 @@
<div id="dev_page_content"><p>If <a href="/method/contacts.toggleTopPeers">enabled</a>, the rating of <a href="/constructor/topPeer">top peers</a> indicates the relevance of a frequently used peer in a certain <a href="/type/TopPeerCategory">category</a> (frequently messaged users, frequently used bots, inline bots, frequently visited channels and so on).</p>
<p>Schema: </p>
<pre><code><a href='/constructor/topPeer'>topPeer</a>#edcdc05b peer:<a href='/type/Peer'>Peer</a> rating:<a href='/type/double'>double</a> = <a href='/type/TopPeer'>TopPeer</a>;
<a href='/constructor/topPeerCategoryBotsPM'>topPeerCategoryBotsPM</a>#ab661b5b = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
<pre><code><a href='/constructor/topPeerCategoryBotsPM'>topPeerCategoryBotsPM</a>#ab661b5b = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
<a href='/constructor/topPeerCategoryBotsInline'>topPeerCategoryBotsInline</a>#148677e2 = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
<a href='/constructor/topPeerCategoryCorrespondents'>topPeerCategoryCorrespondents</a>#637b7ed = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
<a href='/constructor/topPeerCategoryGroups'>topPeerCategoryGroups</a>#bd17a14a = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
@ -55,6 +53,8 @@
<a href='/constructor/topPeerCategoryForwardUsers'>topPeerCategoryForwardUsers</a>#a8406ca9 = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
<a href='/constructor/topPeerCategoryForwardChats'>topPeerCategoryForwardChats</a>#fbeec0f0 = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
<a href='/constructor/topPeer'>topPeer</a>#edcdc05b peer:<a href='/type/Peer'>Peer</a> rating:<a href='/type/double'>double</a> = <a href='/type/TopPeer'>TopPeer</a>;
<a href='/constructor/topPeerCategoryPeers'>topPeerCategoryPeers</a>#fb834291 category:<a href='/type/TopPeerCategory'>TopPeerCategory</a> count:<a href='/type/int'>int</a> peers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/TopPeer'>TopPeer</a>&gt; = <a href='/type/TopPeerCategoryPeers'>TopPeerCategoryPeers</a>;
<a href='/constructor/contacts.topPeersNotModified'>contacts.topPeersNotModified</a>#de266ef5 = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
@ -63,7 +63,10 @@
---functions---
<a href='/method/contacts.getTopPeers'>contacts.getTopPeers</a>#973478b6 flags:<a href='/type/%23'>#</a> correspondents:flags.0?<a href='/constructor/true'>true</a> bots_pm:flags.1?<a href='/constructor/true'>true</a> bots_inline:flags.2?<a href='/constructor/true'>true</a> phone_calls:flags.3?<a href='/constructor/true'>true</a> forward_users:flags.4?<a href='/constructor/true'>true</a> forward_chats:flags.5?<a href='/constructor/true'>true</a> groups:flags.10?<a href='/constructor/true'>true</a> channels:flags.15?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;</code></pre>
<a href='/method/contacts.toggleTopPeers'>contacts.toggleTopPeers</a>#8514bdda enabled:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/contacts.getTopPeers'>contacts.getTopPeers</a>#973478b6 flags:<a href='/type/%23'>#</a> correspondents:flags.0?<a href='/constructor/true'>true</a> bots_pm:flags.1?<a href='/constructor/true'>true</a> bots_inline:flags.2?<a href='/constructor/true'>true</a> phone_calls:flags.3?<a href='/constructor/true'>true</a> forward_users:flags.4?<a href='/constructor/true'>true</a> forward_chats:flags.5?<a href='/constructor/true'>true</a> groups:flags.10?<a href='/constructor/true'>true</a> channels:flags.15?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
<a href='/method/contacts.resetTopPeerRating'>contacts.resetTopPeerRating</a>#1ae373ac category:<a href='/type/TopPeerCategory'>TopPeerCategory</a> peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Use <a href="/method/contacts.toggleTopPeers">contacts.toggleTopPeers</a> to enable or disable top peer ratings. </p>
<p>The rate delta is computed by taking the time delta between the last time the user used a certain peer and the last time the rating for that peer was received and dividing it by the <a href="/constructor/config">exponential decay from config</a>.</p>
<p>Example:
Client-side, every time a user opens chat <code>123456789</code> the following operation must be done on the cached top peer info.</p>
@ -72,7 +75,8 @@ Client-side, every time a user opens chat <code>123456789</code> the following o
<li><code>normalizeRate</code> is an arbitrary time in the recent past.
When ratings are received from the server using <a href="/method/contacts.getTopPeers">contacts.getTopPeers</a> and the schema described above, it is the time when they were received.</li>
</ul>
<pre><code>topPeer.rating += e^((dateOpened - normalizeRate) / config.rating_e_decay)</code></pre></div>
<pre><code>topPeer.rating += e^((dateOpened - normalizeRate) / config.rating_e_decay)</code></pre>
<p>Use <a href="/method/contacts.resetTopPeerRating">contacts.resetTopPeerRating</a> to reset the top peer rating of a certain peer, in a certain category.</p></div>
</div>

View file

@ -89,7 +89,7 @@
<tr>
<td><strong>provider</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Venue provider: currently only "foursquare" needs to be supported</td>
<td>Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be supported</td>
</tr>
<tr>
<td><strong>venue_id</strong></td>

View file

@ -90,7 +90,7 @@
<tr>
<td><strong>provider</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Venue provider: currently only "foursquare" needs to be supported</td>
<td>Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be supported</td>
</tr>
<tr>
<td><strong>venue_id</strong></td>

View file

@ -89,7 +89,7 @@
<tr>
<td><strong>provider</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Venue provider: currently only "foursquare" needs to be supported</td>
<td>Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be supported</td>
</tr>
<tr>
<td><strong>venue_id</strong></td>

View file

@ -84,7 +84,7 @@
<tr>
<td><strong>provider</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Venue provider: currently only "foursquare" needs to be supported</td>
<td>Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be supported</td>
</tr>
<tr>
<td><strong>venue_id</strong></td>

View file

@ -4,50 +4,10 @@
<meta charset="utf-8">
<title>mediaAreaCoordinates</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
x
double
 
y
double
 
w
double
 
h
double
 
rotation
double
 
Type
MediaAreaCoordinates">
<meta property="description" content="Coordinates and size of a clicable rectangular area on top of a story.">
<meta property="og:title" content="mediaAreaCoordinates">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
x
double
 
y
double
 
w
double
 
h
double
 
rotation
double
 
Type
MediaAreaCoordinates">
<meta property="og:description" content="Coordinates and size of a clicable rectangular area on top of a story.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -82,7 +42,8 @@ MediaAreaCoordinates">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/mediaAreaCoordinates" >mediaAreaCoordinates</a></li></ul></div>
<h1 id="dev_page_title">mediaAreaCoordinates</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Coordinates and size of a clicable rectangular area on top of a story.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -108,27 +69,27 @@ MediaAreaCoordinates">
<tr>
<td><strong>x</strong></td>
<td style="text-align: center;"><a href="/type/double">double</a></td>
<td> </td>
<td>The abscissa of the rectangle's center, as a percentage of the media width (0-100).</td>
</tr>
<tr>
<td><strong>y</strong></td>
<td style="text-align: center;"><a href="/type/double">double</a></td>
<td> </td>
<td>The ordinate of the rectangle's center, as a percentage of the media height (0-100).</td>
</tr>
<tr>
<td><strong>w</strong></td>
<td style="text-align: center;"><a href="/type/double">double</a></td>
<td> </td>
<td>The width of the rectangle, as a percentage of the media width (0-100).</td>
</tr>
<tr>
<td><strong>h</strong></td>
<td style="text-align: center;"><a href="/type/double">double</a></td>
<td> </td>
<td>The height of the rectangle, as a percentage of the media height (0-100).</td>
</tr>
<tr>
<td><strong>rotation</strong></td>
<td style="text-align: center;"><a href="/type/double">double</a></td>
<td> </td>
<td>Clockwise rotation angle of the rectangle, in degrees (0-360).</td>
</tr>
</tbody>
</table>

View file

@ -4,32 +4,10 @@
<meta charset="utf-8">
<title>mediaAreaGeoPoint</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
coordinates
MediaAreaCoordinates
 
geo
GeoPoint
 
Type
MediaArea">
<meta property="description" content="Represents a geolocation tag attached to a story.">
<meta property="og:title" content="mediaAreaGeoPoint">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
coordinates
MediaAreaCoordinates
 
geo
GeoPoint
 
Type
MediaArea">
<meta property="og:description" content="Represents a geolocation tag attached to a story.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -64,7 +42,8 @@ MediaArea">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/mediaAreaGeoPoint" >mediaAreaGeoPoint</a></li></ul></div>
<h1 id="dev_page_title">mediaAreaGeoPoint</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Represents a geolocation tag attached to a <a href="/api/story">story</a>.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -90,12 +69,12 @@ MediaArea">
<tr>
<td><strong>coordinates</strong></td>
<td style="text-align: center;"><a href="/type/MediaAreaCoordinates">MediaAreaCoordinates</a></td>
<td> </td>
<td>The size and position of the media area corresponding to the location sticker on top of the story media.</td>
</tr>
<tr>
<td><strong>geo</strong></td>
<td style="text-align: center;"><a href="/type/GeoPoint">GeoPoint</a></td>
<td> </td>
<td>Coordinates of the geolocation tag.</td>
</tr>
</tbody>
</table>

View file

@ -4,36 +4,10 @@
<meta charset="utf-8">
<title>mediaAreaSuggestedReaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
dark
flags.0?true
 
flipped
flags.1?true
 
coordinates…">
<meta property="description" content="Represents a reaction bubble.">
<meta property="og:title" content="mediaAreaSuggestedReaction">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
dark
flags.0?true
 
flipped
flags.1?true
 
coordinates…">
<meta property="og:description" content="Represents a reaction bubble.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -68,7 +42,8 @@ coordinates…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/mediaAreaSuggestedReaction" >mediaAreaSuggestedReaction</a></li></ul></div>
<h1 id="dev_page_title">mediaAreaSuggestedReaction</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Represents a reaction bubble.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -99,27 +74,30 @@ coordinates…">
<tr>
<td><strong>dark</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether the reaction bubble has a dark background.</td>
</tr>
<tr>
<td><strong>flipped</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether the reaction bubble is mirrored (see <a href="/api/stories#reactions">here »</a> for more info).</td>
</tr>
<tr>
<td><strong>coordinates</strong></td>
<td style="text-align: center;"><a href="/type/MediaAreaCoordinates">MediaAreaCoordinates</a></td>
<td> </td>
<td>The coordinates of the media area corresponding to the reaction button.</td>
</tr>
<tr>
<td><strong>reaction</strong></td>
<td style="text-align: center;"><a href="/type/Reaction">Reaction</a></td>
<td> </td>
<td>The reaction that should be sent when this area is clicked.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/MediaArea">MediaArea</a></p></div>
<p><a href="/type/MediaArea">MediaArea</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#stories" id="stories" name="stories"><i class="anchor-icon"></i></a><a href="/api/stories">Stories</a></h4>
<p>Telegram users and channels can easily post and view stories through the API.</p></div>
</div>

View file

@ -4,42 +4,10 @@
<meta charset="utf-8">
<title>mediaAreaVenue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
coordinates
MediaAreaCoordinates
 
geo
GeoPoint
 
title
string
 
address
string
 
provider…">
<meta property="description" content="Represents a location tag attached to a story, with additional venue information.">
<meta property="og:title" content="mediaAreaVenue">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
coordinates
MediaAreaCoordinates
 
geo
GeoPoint
 
title
string
 
address
string
 
provider…">
<meta property="og:description" content="Represents a location tag attached to a story, with additional venue information.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -74,7 +42,8 @@ provider…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/mediaAreaVenue" >mediaAreaVenue</a></li></ul></div>
<h1 id="dev_page_title">mediaAreaVenue</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Represents a location tag attached to a <a href="/api/story">story</a>, with additional venue information.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -100,37 +69,37 @@ provider…">
<tr>
<td><strong>coordinates</strong></td>
<td style="text-align: center;"><a href="/type/MediaAreaCoordinates">MediaAreaCoordinates</a></td>
<td> </td>
<td>The size and location of the media area corresponding to the location sticker on top of the story media.</td>
</tr>
<tr>
<td><strong>geo</strong></td>
<td style="text-align: center;"><a href="/type/GeoPoint">GeoPoint</a></td>
<td> </td>
<td>Coordinates of the venue</td>
</tr>
<tr>
<td><strong>title</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td>
<td>Venue name</td>
</tr>
<tr>
<td><strong>address</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td>
<td>Address</td>
</tr>
<tr>
<td><strong>provider</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td>
<td>Venue provider: currently only "foursquare" needs to be supported.</td>
</tr>
<tr>
<td><strong>venue_id</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td>
<td>Venue ID in the provider's database</td>
</tr>
<tr>
<td><strong>venue_type</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td>
<td>Venue type in the provider's database</td>
</tr>
</tbody>
</table>

View file

@ -119,7 +119,7 @@
<tr>
<td><strong>noforwards</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.26?<a href="/constructor/true">true</a></td>
<td>Whether this message is <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more">protected</a> and thus cannot be forwarded</td>
<td>Whether this message is <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more">protected</a> and thus cannot be forwarded; clients should also prevent users from saving attached media (i.e. videos should only be streamed, photos should be kept in RAM, et cetera).</td>
</tr>
<tr>
<td><strong>id</strong></td>

View file

@ -84,7 +84,7 @@
<tr>
<td><strong>provider</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Venue provider: currently only "foursquare" needs to be supported</td>
<td>Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be supported</td>
</tr>
<tr>
<td><strong>venue_id</strong></td>

View file

@ -4,7 +4,8 @@
<meta charset="utf-8">
<title>storyItem</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
<meta property="description" content="Represents a story.
Parameters
Name
Type
Description
@ -14,13 +15,11 @@ Flags, see TL conditional fields
pinned
flags.5?true
 
public
flags.7?true
 
close_friends…">
public…">
<meta property="og:title" content="storyItem">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
<meta property="og:description" content="Represents a story.
Parameters
Name
Type
Description
@ -30,10 +29,7 @@ Flags, see TL conditional fields
pinned
flags.5?true
 
public
flags.7?true
 
close_friends…">
public…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -68,7 +64,8 @@ close_friends…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/storyItem" >storyItem</a></li></ul></div>
<h1 id="dev_page_title">storyItem</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Represents a <a href="/api/story">story</a>.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -119,12 +116,12 @@ close_friends…">
<tr>
<td><strong>noforwards</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.10?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether this story is <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more">protected</a> and thus cannot be forwarded; clients should also prevent users from saving attached media (i.e. videos should only be streamed, photos should be kept in RAM, et cetera).</td>
</tr>
<tr>
<td><strong>edited</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.11?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Indicates whether the story was edited.</td>
</tr>
<tr>
<td><strong>contacts</strong></td>
@ -139,27 +136,27 @@ close_friends…">
<tr>
<td><strong>out</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.16?<a href="/constructor/true">true</a></td>
<td> </td>
<td>indicates whether we sent this story.</td>
</tr>
<tr>
<td><strong>id</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td> </td>
<td>ID of the story.</td>
</tr>
<tr>
<td><strong>date</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td> </td>
<td>When was the story posted.</td>
</tr>
<tr>
<td><strong>expire_date</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td> </td>
<td>When does the story expire.</td>
</tr>
<tr>
<td><strong>caption</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/string">string</a></td>
<td> </td>
<td>Story caption.</td>
</tr>
<tr>
<td><strong>entities</strong></td>
@ -169,12 +166,12 @@ close_friends…">
<tr>
<td><strong>media</strong></td>
<td style="text-align: center;"><a href="/type/MessageMedia">MessageMedia</a></td>
<td> </td>
<td>Story media.</td>
</tr>
<tr>
<td><strong>media_areas</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/MediaArea">MediaArea</a>&gt;</td>
<td> </td>
<td>List of media areas, see <a href="/api/stories#media-areas">here »</a> for more info on media areas.</td>
</tr>
<tr>
<td><strong>privacy</strong></td>
@ -189,7 +186,7 @@ close_friends…">
<tr>
<td><strong>sent_reaction</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.15?<a href="/type/Reaction">Reaction</a></td>
<td> </td>
<td>The reaction we sent.</td>
</tr>
</tbody>
</table>

View file

@ -103,7 +103,7 @@
<tr>
<td><strong>phone</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>User's phone number</td>
<td>User's phone number, may be omitted to simply add the user to the contact list, without a phone number.</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="">
<meta property="og:title" content="Page not found">
<meta property="og:image" content="">
<meta property="og:description" content="">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li></li></ul></div>
<h1 id="dev_page_title">Page not found</h1>
<div id="dev_page_content">The page has not been saved</div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -114,7 +114,7 @@ Peer where the story was posted.…">
<tr>
<td><strong>media_areas</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/MediaArea">MediaArea</a>&gt;</td>
<td> </td>
<td><a href="/api/stories#media-areas">Media areas</a> associated to the story, see <a href="/api/stories#media-areas">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>caption</strong></td>
@ -129,7 +129,7 @@ Peer where the story was posted.…">
<tr>
<td><strong>privacy_rules</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/InputPrivacyRule">InputPrivacyRule</a>&gt;</td>
<td>If specified, alters the privacy settings of the story.</td>
<td>If specified, alters the <a href="/api/privacy">privacy settings »</a> of the story, changing who can or can't view the story.</td>
</tr>
</tbody>
</table>

View file

@ -82,12 +82,12 @@
<tr>
<td><strong>pinned</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether to add the story to the profile automatically upon expiration. If not set, the story will only be added to the archive, see <a href="/api/stories">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>noforwards</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/constructor/true">true</a></td>
<td>If set, disables forwards and story download functionality.</td>
<td>If set, disables forwards, screenshots, and downloads.</td>
</tr>
<tr>
<td><strong>peer</strong></td>
@ -97,12 +97,12 @@
<tr>
<td><strong>media</strong></td>
<td style="text-align: center;"><a href="/type/InputMedia">InputMedia</a></td>
<td>The media file.</td>
<td>The story media.</td>
</tr>
<tr>
<td><strong>media_areas</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.5?<a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/MediaArea">MediaArea</a>&gt;</td>
<td> </td>
<td><a href="/api/stories#media-areas">Media areas</a> associated to the story, see <a href="/api/stories#media-areas">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>caption</strong></td>
@ -117,7 +117,7 @@
<tr>
<td><strong>privacy_rules</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/InputPrivacyRule">InputPrivacyRule</a>&gt;</td>
<td> </td>
<td><a href="/api/privacy">Privacy rules</a> for the story, indicating who can or can't view the story.</td>
</tr>
<tr>
<td><strong>random_id</strong></td>
@ -127,7 +127,7 @@
<tr>
<td><strong>period</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/int">int</a></td>
<td> </td>
<td>Period after which the story is moved to archive (and to the profile if <code>pinned</code> is set), in seconds; must be one of <code>6 * 3600</code>, <code>12 * 3600</code>, <code>86400</code>, or <code>2 * 86400</code> for Telegram Premium users, and <code>86400</code> otherwise.</td>
</tr>
</tbody>
</table>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 CC 7D 0D 00 D2 5E 20 65
0010 | 14 00 00 00 F1 8E 7E BE 44 89 D8 96 B9 08 80 A8
0020 | A6 23 F7 43 BD FB 19 7A</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 90 45 05 00 71 F5 22 65
0010 | 14 00 00 00 F1 8E 7E BE 58 C2 89 3D 19 63 D1 36
0020 | 4C 49 F9 69 1D 09 67 FA</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table">
@ -77,7 +77,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>CC7D0D00D25E2065</code></td>
<td><code>9045050071F52265</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -95,7 +95,7 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,11 +104,11 @@
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
<!-- start resPQ -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 1C 2A C6 D2 5E 20 65
0010 | 68 00 00 00 63 24 16 05 44 89 D8 96 B9 08 80 A8
0020 | A6 23 F7 43 BD FB 19 7A 4C 57 92 83 D0 EA 21 D4
0030 | 47 21 8B 38 DC 9C 55 08 08 2C E5 C2 08 76 5A C5
0040 | ED 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 30 7E 28 71 F5 22 65
0010 | 90 00 00 00 63 24 16 05 58 C2 89 3D 19 63 D1 36
0020 | 4C 49 F9 69 1D 09 67 FA 54 54 54 07 99 FB 06 6A
0030 | D9 0A E7 F9 A5 F7 E0 48 08 32 F8 EA 1A 81 A9 22
0040 | C9 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
0060 | 85 1D 9D D0</code></pre>
<p>Payload (de)serialization:</p>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>011C2AC6D25E2065</code></td>
<td><code>01307E2871F52265</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>68000000</code> (104 in decimal)</td>
<td><code>90000000</code> (144 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>082CE5C208765AC5ED000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3235205248936756717</td>
<td><code>0832F8EA1A81A922C9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3672942895686034121</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -208,22 +208,22 @@
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq -->
<pre><code>pq = 3235205248936756717</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>3235205248936756717 = 1720569787 * 1880310391</code></p>
<pre><code>p = 1720569787
q = 1880310391</code></pre>
<pre><code>pq = 3672942895686034121</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>3672942895686034121 = 1863829003 * 1970643707</code></p>
<pre><code>p = 1863829003
q = 1970643707</code></pre>
<!-- end pq -->
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 2C E5 C2 08 76 5A C5 ED 00 00 00
0010 | 04 66 8D CF BB 00 00 00 04 70 13 42 77 00 00 00
0020 | 44 89 D8 96 B9 08 80 A8 A6 23 F7 43 BD FB 19 7A
0030 | 4C 57 92 83 D0 EA 21 D4 47 21 8B 38 DC 9C 55 08
0040 | 3C 48 26 39 41 0D E8 BC 5E B6 D9 D7 E5 40 F3 49
0050 | 77 5A E1 B4 33 6D 7C 7B 31 F4 F1 BD C8 F0 D7 B3
<pre><code>0000 | 95 5F F5 A9 08 32 F8 EA 1A 81 A9 22 C9 00 00 00
0010 | 04 6F 17 C6 0B 00 00 00 04 75 75 A2 FB 00 00 00
0020 | 58 C2 89 3D 19 63 D1 36 4C 49 F9 69 1D 09 67 FA
0030 | 54 54 54 07 99 FB 06 6A D9 0A E7 F9 A5 F7 E0 48
0040 | E7 A0 8A 34 DB A6 8A C4 08 C8 5D 58 75 F1 60 66
0050 | B0 12 D8 E7 77 A3 15 07 83 CF 00 F4 58 8B 2E 05
0060 | 02 00 00 00</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre>
@ -246,37 +246,37 @@ q = 1880310391</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>082CE5C208765AC5ED000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3235205248936756717</td>
<td><code>0832F8EA1A81A922C9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3672942895686034121</td>
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>p</td>
<td>16, 8</td>
<td><code>04668DCFBB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1720569787</td>
<td><code>046F17C60B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1863829003</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>24, 8</td>
<td><code>0470134277000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1880310391</td>
<td><code>047575A2FB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1970643707</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>nonce</td>
<td>32, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>3C482639410DE8BC5EB6D9D7E540F349</code> <code>775AE1B4336D7C7B31F4F1BDC8F0D7B3</code></td>
<td><code>E7A08A34DBA68AC408C85D5875F16066</code> <code>B012D8E777A3150783CF00F4588B2E05</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1880310391</code></pre>
<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br>
These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p>
<!-- start p_q_inner_data_input -->
<pre><code>data = 955FF5A9082CE5C208765AC5ED00000004668DCFBB00000004701342770000004489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C55083C482639410DE8BC5EB6D9D7E540F349775AE1B4336D7C7B31F4F1BDC8F0D7B302000000
random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8FE283DDCA235C1B6976A28031B30FE08420D732446B5CA6555D3D45CAC537E3718D9C66F2FFE03648056033E3E40975BEF2FB50D19B37A05AB4EF0A8A47C962</code></pre>
<pre><code>data = 955FF5A90832F8EA1A81A922C9000000046F17C60B000000047575A2FB00000058C2893D1963D1364C49F9691D0967FA5454540799FB066AD90AE7F9A5F7E048E7A08A34DBA68AC408C85D5875F16066B012D8E777A3150783CF00F4588B2E0502000000
random_padding_bytes = 2C5439FD410845A070327817A7AA56C71C9FD27F2663B1701FB8B31D26E0AEE1CBCFB9930CF6CB8213A89F0453E5F6CCDCA8B00E6DE243C5DD40C3615A184A52A3BB2EDD2DDD67F32EFF805EFDC085FECCB384A2A11EFF269AF2C18C</code></pre>
<!-- end p_q_inner_data_input -->
<p>And this is the output:</p>
<!-- start p_q_inner_data_output -->
<pre><code>encrypted_data = D177563F10EFE0AA71F81FA917FE234D3995C71C486C33EB265C2BE218EF78E485FD8A5C88EB70F6EA7161FEAA85443BD690CA865C4EB7242F2FD8D3C76E8BF61C85FFACC985DC350726AD9D7D1A9B4830C184ED313CE355E9404420D2318C6912921895797D22790AC2780EA1AE38C3B04BEC379799CDD0819D378E6662B8C75449EA2226ED355E9645B83A60F4CD115BCCCFE7584241F904BE4A70A06B03B72ED74703780465D8E8386CF1E0915739981FC984C4CFE31137FDEF2BD8F87B6F01E70BA3E0113B01C338C80F7E0CC800FE8CE464F71B9BB97BB9EEDE308480142F72F75582BB5B78ED995C7D1A9C70CD531AB0077DADD342D507CAFB5E7F6E34</code></pre>
<pre><code>encrypted_data = 1D332697DD5742DA60F7620B959BCF6239EBF5DB882924327EF2B6D4BC7F72EE4FFC6FB012EF6FB9C3D0FB43DA1DD8AB7B7DAB4E9497B4F9D084D54EDC13174A1243122757731EFCB059F8FF69FD369F03D621E190CFB2589B726C636A1810B1D5032F9B7EEA5C686FB3D9C06EA241DECF5BAF480910B8E31B2F9CA2DD703BC7D551DF2E1DBB2B46026FD629E3A1CAA330A72D8B98C8C41FC77E56F29BB6CAB036BF8B235DA5DF8E16685AC822B365E3DE3F56450E7055F38D2F163BD2FD1453D3F698720126CB53CD7A5E036D5109D2CCF8DA7ECC28D8FC3884809ACF510F247429106F2CE6C896615E858C64D176C96FFF9920BAFAA61681F3052D06D5F6BA</code></pre>
<!-- end p_q_inner_data_output -->
<p>The length of the final string is 256 bytes.</p>
<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5>
<!-- start req_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 28 A2 0E 00 D2 5E 20 65
0010 | 40 01 00 00 BE E4 12 D7 44 89 D8 96 B9 08 80 A8
0020 | A6 23 F7 43 BD FB 19 7A 4C 57 92 83 D0 EA 21 D4
0030 | 47 21 8B 38 DC 9C 55 08 04 66 8D CF BB 00 00 00
0040 | 04 70 13 42 77 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 D1 77 56 3F 10 EF E0 AA 71 F8 1F A9
0060 | 17 FE 23 4D 39 95 C7 1C 48 6C 33 EB 26 5C 2B E2
0070 | 18 EF 78 E4 85 FD 8A 5C 88 EB 70 F6 EA 71 61 FE
0080 | AA 85 44 3B D6 90 CA 86 5C 4E B7 24 2F 2F D8 D3
0090 | C7 6E 8B F6 1C 85 FF AC C9 85 DC 35 07 26 AD 9D
00A0 | 7D 1A 9B 48 30 C1 84 ED 31 3C E3 55 E9 40 44 20
00B0 | D2 31 8C 69 12 92 18 95 79 7D 22 79 0A C2 78 0E
00C0 | A1 AE 38 C3 B0 4B EC 37 97 99 CD D0 81 9D 37 8E
00D0 | 66 62 B8 C7 54 49 EA 22 26 ED 35 5E 96 45 B8 3A
00E0 | 60 F4 CD 11 5B CC CF E7 58 42 41 F9 04 BE 4A 70
00F0 | A0 6B 03 B7 2E D7 47 03 78 04 65 D8 E8 38 6C F1
0100 | E0 91 57 39 98 1F C9 84 C4 CF E3 11 37 FD EF 2B
0110 | D8 F8 7B 6F 01 E7 0B A3 E0 11 3B 01 C3 38 C8 0F
0120 | 7E 0C C8 00 FE 8C E4 64 F7 1B 9B B9 7B B9 EE DE
0130 | 30 84 80 14 2F 72 F7 55 82 BB 5B 78 ED 99 5C 7D
0140 | 1A 9C 70 CD 53 1A B0 07 7D AD D3 42 D5 07 CA FB
0150 | 5E 7F 6E 34</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 14 61 0B 00 71 F5 22 65
0010 | 40 01 00 00 BE E4 12 D7 58 C2 89 3D 19 63 D1 36
0020 | 4C 49 F9 69 1D 09 67 FA 54 54 54 07 99 FB 06 6A
0030 | D9 0A E7 F9 A5 F7 E0 48 04 6F 17 C6 0B 00 00 00
0040 | 04 75 75 A2 FB 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 1D 33 26 97 DD 57 42 DA 60 F7 62 0B
0060 | 95 9B CF 62 39 EB F5 DB 88 29 24 32 7E F2 B6 D4
0070 | BC 7F 72 EE 4F FC 6F B0 12 EF 6F B9 C3 D0 FB 43
0080 | DA 1D D8 AB 7B 7D AB 4E 94 97 B4 F9 D0 84 D5 4E
0090 | DC 13 17 4A 12 43 12 27 57 73 1E FC B0 59 F8 FF
00A0 | 69 FD 36 9F 03 D6 21 E1 90 CF B2 58 9B 72 6C 63
00B0 | 6A 18 10 B1 D5 03 2F 9B 7E EA 5C 68 6F B3 D9 C0
00C0 | 6E A2 41 DE CF 5B AF 48 09 10 B8 E3 1B 2F 9C A2
00D0 | DD 70 3B C7 D5 51 DF 2E 1D BB 2B 46 02 6F D6 29
00E0 | E3 A1 CA A3 30 A7 2D 8B 98 C8 C4 1F C7 7E 56 F2
00F0 | 9B B6 CA B0 36 BF 8B 23 5D A5 DF 8E 16 68 5A C8
0100 | 22 B3 65 E3 DE 3F 56 45 0E 70 55 F3 8D 2F 16 3B
0110 | D2 FD 14 53 D3 F6 98 72 01 26 CB 53 CD 7A 5E 03
0120 | 6D 51 09 D2 CC F8 DA 7E CC 28 D8 FC 38 84 80 9A
0130 | CF 51 0F 24 74 29 10 6F 2C E6 C8 96 61 5E 85 8C
0140 | 64 D1 76 C9 6F FF 99 20 BA FA A6 16 81 F3 05 2D
0150 | 06 D5 F6 BA</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
<table class="table">
@ -345,7 +345,7 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>28A20E00D25E2065</code></td>
<td><code>14610B0071F52265</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -363,25 +363,25 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>04668DCFBB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1720569787</td>
<td><code>046F17C60B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1863829003</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>64, 8</td>
<td><code>0470134277000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1880310391</td>
<td><code>047575A2FB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1970643707</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -393,7 +393,7 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100D177563F10EFE0AA71F81FA9</code> <code>17FE234D3995C71C486C33EB265C2BE2</code> <code>18EF78E485FD8A5C88EB70F6EA7161FE</code> <code>AA85443BD690CA865C4EB7242F2FD8D3</code> <code>C76E8BF61C85FFACC985DC350726AD9D</code> <code>7D1A9B4830C184ED313CE355E9404420</code> <code>D2318C6912921895797D22790AC2780E</code> <code>A1AE38C3B04BEC379799CDD0819D378E</code> <code>6662B8C75449EA2226ED355E9645B83A</code> <code>60F4CD115BCCCFE7584241F904BE4A70</code> <code>A06B03B72ED74703780465D8E8386CF1</code> <code>E0915739981FC984C4CFE31137FDEF2B</code> <code>D8F87B6F01E70BA3E0113B01C338C80F</code> <code>7E0CC800FE8CE464F71B9BB97BB9EEDE</code> <code>308480142F72F75582BB5B78ED995C7D</code> <code>1A9C70CD531AB0077DADD342D507CAFB</code><br> <code>5E7F6E34</code></td>
<td><code>FE0001001D332697DD5742DA60F7620B</code> <code>959BCF6239EBF5DB882924327EF2B6D4</code> <code>BC7F72EE4FFC6FB012EF6FB9C3D0FB43</code> <code>DA1DD8AB7B7DAB4E9497B4F9D084D54E</code> <code>DC13174A1243122757731EFCB059F8FF</code> <code>69FD369F03D621E190CFB2589B726C63</code> <code>6A1810B1D5032F9B7EEA5C686FB3D9C0</code> <code>6EA241DECF5BAF480910B8E31B2F9CA2</code> <code>DD703BC7D551DF2E1DBB2B46026FD629</code> <code>E3A1CAA330A72D8B98C8C41FC77E56F2</code> <code>9BB6CAB036BF8B235DA5DF8E16685AC8</code> <code>22B365E3DE3F56450E7055F38D2F163B</code> <code>D2FD1453D3F698720126CB53CD7A5E03</code> <code>6D5109D2CCF8DA7ECC28D8FC3884809A</code> <code>CF510F247429106F2CE6C896615E858C</code> <code>64D176C96FFF9920BAFAA61681F3052D</code><br> <code>06D5F6BA</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
<!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B8 68 78 D3 5E 20 65
0010 | E4 02 00 00 5C 07 E8 D0 44 89 D8 96 B9 08 80 A8
0020 | A6 23 F7 43 BD FB 19 7A 4C 57 92 83 D0 EA 21 D4
0030 | 47 21 8B 38 DC 9C 55 08 FE 50 02 00 D8 A8 77 B2
0040 | 68 75 1F A9 EC BD A5 D5 A8 A8 67 46 48 10 AD 8F
0050 | CB 6B 3E 36 FD DA B9 BB E6 E9 3B D3 83 2F 75 BB
0060 | F9 CD DE EE 28 42 59 37 55 FF 04 DC 87 27 8B 73
0070 | 78 96 2C 21 86 DD 37 94 50 64 05 CA 0A 73 CB B1
0080 | 31 95 90 B5 6C D0 F1 5E A0 5E DF 4F 96 7E 48 9E
0090 | 11 BB 88 43 EF 09 0D 08 4F CF 0D 4E 00 16 7D 8B
00A0 | 20 3F 83 9F FD 5F 5C DB 5A 16 35 2D 78 17 42 92
00B0 | 4B 12 CE 68 F0 4D BD 6C 54 1D 34 BA A9 1E 50 9E
00C0 | 46 29 AF 32 81 67 86 0F 76 62 8B 12 F1 BB 76 E6
00D0 | E0 07 FF 53 00 9B 05 16 BD 3C C0 52 F3 A6 83 F3
00E0 | 1D 42 7C 55 30 59 7E 15 DF DA 3F A0 39 D3 AE 53
00F0 | F4 08 7E 2C 8B 3B 8D EA 58 28 38 39 53 9F B2 E5
0100 | 7D 9F B2 8D 39 4A 46 75 B8 AD 1E 83 03 66 63 14
0110 | 27 DB 2C 98 7F 4B 33 C2 7C 92 51 F5 A7 80 8B 60
0120 | 28 06 14 2F 1F FB D3 21 53 29 D8 A1 C8 12 44 E2
0130 | 27 D2 6C AD 12 B5 45 8C 11 41 D2 DB A5 7B DA E3
0140 | 5C 4F C4 8B 3A EE DB A3 50 DE 91 B9 8F 9E 5A 41
0150 | 9A E2 E7 E3 1D 47 A3 EC 9E 19 AC F6 5B A3 39 CF
0160 | 8A D4 C9 44 AB 4C F3 FC DC EE 2E 72 61 71 37 87
0170 | 6F C7 E5 4E 62 A9 C4 DD 88 26 A4 76 C6 AA 23 AB
0180 | CF AE 66 98 BB E9 86 22 18 F6 F4 22 01 CB CE 6F
0190 | A3 AF 9A F6 11 8E DD 74 DE 25 EF C4 AB 6B AB A3
01A0 | D9 60 6C 66 EC 90 D3 C1 99 FC AB C3 44 28 41 FC
01B0 | 20 24 DB 95 07 7D 66 73 ED 1F 46 5B 3E 7E AE 19
01C0 | 91 9A 84 09 04 14 8F B0 73 C2 81 56 72 B4 BB 92
01D0 | D2 1E A0 03 C8 12 12 63 D7 9D 4A 75 3C 16 90 FC
01E0 | 4C 45 5D 03 35 0D 61 2F C5 13 FC 79 7E 9E A3 E0
01F0 | 02 09 F0 86 10 75 72 95 40 F2 BA 5E 21 C6 7A 57
0200 | A9 53 DB 5E 0B 6A 0E 20 13 71 3D 7E 53 21 BE 56
0210 | 66 73 10 7B 11 3C 71 21 B9 33 71 C6 60 8A 48 D4
0220 | C9 E2 9D 39 88 D7 50 B7 99 83 B5 3F D9 84 03 B6
0230 | 21 AC 0E 00 6D 4D EB C6 61 AA A3 34 21 4A 8F AF
0240 | 17 C1 32 BE E0 25 95 18 A9 3F D5 DC 45 C2 82 C7
0250 | 3A 40 29 A2 0C 18 D7 CE A4 BD CF 56 1A D7 3C 29
0260 | 2A AF 62 70 F2 60 64 69 B5 25 76 A8 6A 39 7A 1A
0270 | 25 7A 0D DD 3F 76 22 17 E8 C8 4B B9 EA 2E 78 29
0280 | 3D 66 9C 5C DA 8C 46 E9 20 28 E4 64</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 20 E3 71 F5 22 65
0010 | E4 02 00 00 5C 07 E8 D0 58 C2 89 3D 19 63 D1 36
0020 | 4C 49 F9 69 1D 09 67 FA 54 54 54 07 99 FB 06 6A
0030 | D9 0A E7 F9 A5 F7 E0 48 FE 50 02 00 71 58 0A 8A
0040 | 83 C3 BC FE F0 D7 83 EC 01 0E C2 ED 5C 17 2A E2
0050 | D3 FB A6 A9 8B 25 57 4D CE 59 AF 7F 46 B6 39 6D
0060 | F1 69 C8 80 C1 E4 5F 5A 5F C6 97 9F 4F DA FE 2A
0070 | 1F 7A 72 11 FA 82 02 C0 59 98 84 A5 69 24 0B 7F
0080 | A6 E7 3E 40 4B 3C B0 E9 E1 6C 04 69 6A C4 CF 3F
0090 | C4 78 5D 68 2A 3C 3C 44 C4 EA D9 3F 3B 67 9C 6D
00A0 | 99 9E EB A2 01 12 3B F0 3C 84 E8 8C 4B C1 41 F6
00B0 | 77 25 DF CB B4 A9 54 30 3E 9B A3 92 3F 41 26 9B
00C0 | 76 2B DB C8 A8 36 42 DF 37 81 C7 E5 F4 C1 22 17
00D0 | B5 80 01 E6 86 F4 4F B6 8A 07 04 9B E0 5B B9 15
00E0 | B7 97 36 71 0C 8D 2F D7 59 DC F2 BA 73 A8 A7 DB
00F0 | 5B 42 45 E7 05 CF 8B C9 C5 76 7B 9C C5 94 38 F6
0100 | EF 09 C5 E9 92 99 5C 23 39 CE 5B 40 8D 35 28 EB
0110 | A9 E8 60 B2 AC D2 10 53 4A 39 03 3E B6 BA 6B DA
0120 | D6 C5 C6 E6 60 4A 10 6F 6D 53 0B DD E3 74 83 71
0130 | 45 D7 4B E0 47 95 35 2E 24 65 B2 3E A4 BD 24 F5
0140 | D2 F6 92 D1 71 4B 5A 40 CE 9E 1B 3A D2 3C C1 C3
0150 | 70 2B 5B FF B6 10 4B 24 91 87 55 0E C0 7D EE 92
0160 | 94 8D D0 FC 0C 76 02 6E 17 3A 72 D8 8D DD F2 AA
0170 | 67 4E 05 56 7A C7 E1 96 A6 F4 DE A3 74 EE 51 C8
0180 | 42 C4 FE 2A 79 C5 8B 82 F1 8D E7 8D 72 2D D2 25
0190 | 42 FC 95 F0 47 02 1C 81 24 FE 9B 50 EB F5 3C 12
01A0 | 9F 4B F4 7B B3 AB 7C 1F AC 68 B0 00 D9 2C B9 BD
01B0 | A5 37 E8 3E C8 4E 00 3B A2 B8 D3 68 3F 7B 7D 1C
01C0 | 2E 9A 26 AC 9B 5F 5B B1 59 DF A4 3D 6A 89 B5 6D
01D0 | 9C 34 79 E3 90 3D 8F C0 58 6D E9 AB C3 82 9A 53
01E0 | 76 68 DC 74 54 AD FC 7A FC BC 06 DF 0E 33 94 A9
01F0 | B8 EE 50 AA F5 33 E8 AC 15 73 66 63 C5 1F 3A 1F
0200 | AB D5 DC DD E5 46 47 AE 4D 34 C2 2D 64 A7 8E B5
0210 | BD DB 44 9C FE 8D 37 DB F0 EE 40 67 93 F2 F2 A3
0220 | 48 D3 A1 E8 84 03 A8 00 2B 31 FA 90 6C C6 11 19
0230 | 92 B9 D0 3F FE 75 6D 32 A2 80 D6 92 EE 61 6F 89
0240 | 75 EC 55 4E 79 0F E7 C1 5F 57 11 35 72 55 35 A1
0250 | AF FE F4 2E B5 06 68 C9 71 29 D9 ED 58 63 23 88
0260 | A9 2D 94 98 1B 0E 53 39 6E 7F 4F 79 0B D5 F7 B3
0270 | C7 FB F1 F5 A4 14 9B 97 01 79 A1 CD 04 4A 62 48
0280 | 58 DC FD B4 45 D5 E6 AD 0D 5C D8 59</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table">
@ -464,7 +464,7 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01B86878D35E2065</code></td>
<td><code>01E020E371F52265</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200D8A877B268751FA9ECBDA5D5</code> <code>A8A867464810AD8FCB6B3E36FDDAB9BB</code> <code>E6E93BD3832F75BBF9CDDEEE28425937</code> <code>55FF04DC87278B7378962C2186DD3794</code> <code>506405CA0A73CBB1319590B56CD0F15E</code> <code>A05EDF4F967E489E11BB8843EF090D08</code> <code>4FCF0D4E00167D8B203F839FFD5F5CDB</code> <code>5A16352D781742924B12CE68F04DBD6C</code> <code>541D34BAA91E509E4629AF328167860F</code> <code>76628B12F1BB76E6E007FF53009B0516</code> <code>BD3CC052F3A683F31D427C5530597E15</code> <code>DFDA3FA039D3AE53F4087E2C8B3B8DEA</code> <code>58283839539FB2E57D9FB28D394A4675</code> <code>B8AD1E830366631427DB2C987F4B33C2</code> <code>7C9251F5A7808B602806142F1FFBD321</code> <code>5329D8A1C81244E227D26CAD12B5458C</code> <code>1141D2DBA57BDAE35C4FC48B3AEEDBA3</code> <code>50DE91B98F9E5A419AE2E7E31D47A3EC</code> <code>9E19ACF65BA339CF8AD4C944AB4CF3FC</code> <code>DCEE2E72617137876FC7E54E62A9C4DD</code> <code>8826A476C6AA23ABCFAE6698BBE98622</code> <code>18F6F42201CBCE6FA3AF9AF6118EDD74</code> <code>DE25EFC4AB6BABA3D9606C66EC90D3C1</code> <code>99FCABC3442841FC2024DB95077D6673</code> <code>ED1F465B3E7EAE19919A840904148FB0</code> <code>73C2815672B4BB92D21EA003C8121263</code> <code>D79D4A753C1690FC4C455D03350D612F</code> <code>C513FC797E9EA3E00209F08610757295</code> <code>40F2BA5E21C67A57A953DB5E0B6A0E20</code> <code>13713D7E5321BE566673107B113C7121</code> <code>B93371C6608A48D4C9E29D3988D750B7</code> <code>9983B53FD98403B621AC0E006D4DEBC6</code> <code>61AAA334214A8FAF17C132BEE0259518</code> <code>A93FD5DC45C282C73A4029A20C18D7CE</code> <code>A4BDCF561AD73C292AAF6270F2606469</code> <code>B52576A86A397A1A257A0DDD3F762217</code> <code>E8C84BB9EA2E78293D669C5CDA8C46E9</code><br> <code>2028E464</code></td>
<td><code>FE50020071580A8A83C3BCFEF0D783EC</code> <code>010EC2ED5C172AE2D3FBA6A98B25574D</code> <code>CE59AF7F46B6396DF169C880C1E45F5A</code> <code>5FC6979F4FDAFE2A1F7A7211FA8202C0</code> <code>599884A569240B7FA6E73E404B3CB0E9</code> <code>E16C04696AC4CF3FC4785D682A3C3C44</code> <code>C4EAD93F3B679C6D999EEBA201123BF0</code> <code>3C84E88C4BC141F67725DFCBB4A95430</code> <code>3E9BA3923F41269B762BDBC8A83642DF</code> <code>3781C7E5F4C12217B58001E686F44FB6</code> <code>8A07049BE05BB915B79736710C8D2FD7</code> <code>59DCF2BA73A8A7DB5B4245E705CF8BC9</code> <code>C5767B9CC59438F6EF09C5E992995C23</code> <code>39CE5B408D3528EBA9E860B2ACD21053</code> <code>4A39033EB6BA6BDAD6C5C6E6604A106F</code> <code>6D530BDDE374837145D74BE04795352E</code> <code>2465B23EA4BD24F5D2F692D1714B5A40</code> <code>CE9E1B3AD23CC1C3702B5BFFB6104B24</code> <code>9187550EC07DEE92948DD0FC0C76026E</code> <code>173A72D88DDDF2AA674E05567AC7E196</code> <code>A6F4DEA374EE51C842C4FE2A79C58B82</code> <code>F18DE78D722DD22542FC95F047021C81</code> <code>24FE9B50EBF53C129F4BF47BB3AB7C1F</code> <code>AC68B000D92CB9BDA537E83EC84E003B</code> <code>A2B8D3683F7B7D1C2E9A26AC9B5F5BB1</code> <code>59DFA43D6A89B56D9C3479E3903D8FC0</code> <code>586DE9ABC3829A537668DC7454ADFC7A</code> <code>FCBC06DF0E3394A9B8EE50AAF533E8AC</code> <code>15736663C51F3A1FABD5DCDDE54647AE</code> <code>4D34C22D64A78EB5BDDB449CFE8D37DB</code> <code>F0EE406793F2F2A348D3A1E88403A800</code> <code>2B31FA906CC6111992B9D03FFE756D32</code> <code>A280D692EE616F8975EC554E790FE7C1</code> <code>5F571135725535A1AFFEF42EB50668C9</code> <code>7129D9ED58632388A92D94981B0E5339</code> <code>6E7F4F790BD5F7B3C7FBF1F5A4149B97</code> <code>0179A1CD044A624858DCFDB445D5E6AD</code><br> <code>0D5CD859</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 7585D30C5A72A7367FB7EC2E2026379851BB73A8F326B98D387602DB8
<!-- end server_DH_params_ok -->
<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p>
<!-- start server_DH_inner_data_input -->
<pre><code>encrypted_answer = D8A877B268751FA9ECBDA5D5A8A867464810AD8FCB6B3E36FDDAB9BBE6E93BD3832F75BBF9CDDEEE2842593755FF04DC87278B7378962C2186DD3794506405CA0A73CBB1319590B56CD0F15EA05EDF4F967E489E11BB8843EF090D084FCF0D4E00167D8B203F839FFD5F5CDB5A16352D781742924B12CE68F04DBD6C541D34BAA91E509E4629AF328167860F76628B12F1BB76E6E007FF53009B0516BD3CC052F3A683F31D427C5530597E15DFDA3FA039D3AE53F4087E2C8B3B8DEA58283839539FB2E57D9FB28D394A4675B8AD1E830366631427DB2C987F4B33C27C9251F5A7808B602806142F1FFBD3215329D8A1C81244E227D26CAD12B5458C1141D2DBA57BDAE35C4FC48B3AEEDBA350DE91B98F9E5A419AE2E7E31D47A3EC9E19ACF65BA339CF8AD4C944AB4CF3FCDCEE2E72617137876FC7E54E62A9C4DD8826A476C6AA23ABCFAE6698BBE9862218F6F42201CBCE6FA3AF9AF6118EDD74DE25EFC4AB6BABA3D9606C66EC90D3C199FCABC3442841FC2024DB95077D6673ED1F465B3E7EAE19919A840904148FB073C2815672B4BB92D21EA003C8121263D79D4A753C1690FC4C455D03350D612FC513FC797E9EA3E00209F0861075729540F2BA5E21C67A57A953DB5E0B6A0E2013713D7E5321BE566673107B113C7121B93371C6608A48D4C9E29D3988D750B79983B53FD98403B621AC0E006D4DEBC661AAA334214A8FAF17C132BEE0259518A93FD5DC45C282C73A4029A20C18D7CEA4BDCF561AD73C292AAF6270F2606469B52576A86A397A1A257A0DDD3F762217E8C84BB9EA2E78293D669C5CDA8C46E92028E464
tmp_aes_key = E22A39733A0CA04AC31617FEFD7E5A3C54CF06AE3FF1DF7E2B5DF48EF7F937E9
tmp_aes_iv = 63828DB4E00117FD643F872C5B4975BC013A065BD691CFA5640C797A3C482639</code></pre>
<pre><code>encrypted_answer = 71580A8A83C3BCFEF0D783EC010EC2ED5C172AE2D3FBA6A98B25574DCE59AF7F46B6396DF169C880C1E45F5A5FC6979F4FDAFE2A1F7A7211FA8202C0599884A569240B7FA6E73E404B3CB0E9E16C04696AC4CF3FC4785D682A3C3C44C4EAD93F3B679C6D999EEBA201123BF03C84E88C4BC141F67725DFCBB4A954303E9BA3923F41269B762BDBC8A83642DF3781C7E5F4C12217B58001E686F44FB68A07049BE05BB915B79736710C8D2FD759DCF2BA73A8A7DB5B4245E705CF8BC9C5767B9CC59438F6EF09C5E992995C2339CE5B408D3528EBA9E860B2ACD210534A39033EB6BA6BDAD6C5C6E6604A106F6D530BDDE374837145D74BE04795352E2465B23EA4BD24F5D2F692D1714B5A40CE9E1B3AD23CC1C3702B5BFFB6104B249187550EC07DEE92948DD0FC0C76026E173A72D88DDDF2AA674E05567AC7E196A6F4DEA374EE51C842C4FE2A79C58B82F18DE78D722DD22542FC95F047021C8124FE9B50EBF53C129F4BF47BB3AB7C1FAC68B000D92CB9BDA537E83EC84E003BA2B8D3683F7B7D1C2E9A26AC9B5F5BB159DFA43D6A89B56D9C3479E3903D8FC0586DE9ABC3829A537668DC7454ADFC7AFCBC06DF0E3394A9B8EE50AAF533E8AC15736663C51F3A1FABD5DCDDE54647AE4D34C22D64A78EB5BDDB449CFE8D37DBF0EE406793F2F2A348D3A1E88403A8002B31FA906CC6111992B9D03FFE756D32A280D692EE616F8975EC554E790FE7C15F571135725535A1AFFEF42EB50668C97129D9ED58632388A92D94981B0E53396E7F4F790BD5F7B3C7FBF1F5A4149B970179A1CD044A624858DCFDB445D5E6AD0D5CD859
tmp_aes_key = 1EF31FDD893F3FC4802877BC105FC0B01A14753EEFF15E0BA1913BA164820A34
tmp_aes_iv = 5AF4537C03BE9A55811DD73015B491B2EDE87FD1499AD57E1C7F0C81E7A08A34</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 0B0DD724989BE1A322EC2A4A920D30F1A9C59528BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010081626BD4F644F37B9C05189C924A9DBFF73E82493AE0301961F1FD0AE568D51AD760C54D5B9181CCDB65CF5D912D634CA6E90A67331D4DE4C9AC9534267667E786FEA07F48685ECA15DDEF41DD57415A35F6D40049BD0C62E6653F958230A8223709001B06F579E328EDC8F1AF54275A8B903DDE6E2BF59617F81582D6D496312E97C039A9A531CD629397D630FADE7F5A4D76BDE6E068A73D62688DFE18FB10DF6B4D64CB3E4F5269F01A54098EF37356759FF01A5EF59D8532E47DEA41D8035E5CFE7B6569A8ABAED534523002E1EF85FE2DC1249103B543F9633F3744F30D5BF7150851C0A5EED21FC6D19D3CB4AB3BF56ED08A458D00EFC22CB9AA1BB7F6D35E206597622EE6713630B8
answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010081626BD4F644F37B9C05189C924A9DBFF73E82493AE0301961F1FD0AE568D51AD760C54D5B9181CCDB65CF5D912D634CA6E90A67331D4DE4C9AC9534267667E786FEA07F48685ECA15DDEF41DD57415A35F6D40049BD0C62E6653F958230A8223709001B06F579E328EDC8F1AF54275A8B903DDE6E2BF59617F81582D6D496312E97C039A9A531CD629397D630FADE7F5A4D76BDE6E068A73D62688DFE18FB10DF6B4D64CB3E4F5269F01A54098EF37356759FF01A5EF59D8532E47DEA41D8035E5CFE7B6569A8ABAED534523002E1EF85FE2DC1249103B543F9633F3744F30D5BF7150851C0A5EED21FC6D19D3CB4AB3BF56ED08A458D00EFC22CB9AA1BB7F6D35E206597622EE6713630B8</code></pre>
<pre><code>answer_with_hash = CD0A715DF80D8CB2F130ACA5407D2862E209972CBA0D89B558C2893D1963D1364C49F9691D0967FA5454540799FB066AD90AE7F9A5F7E04803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100985AF8E2C6F85D3F92DFA2AAF64E043E3670DC584FC7786A26C7B14DB98AF9595382F790BF9B8F3EFBD3A20D7600581C32A4E0EC581D098CB2C39B5321A4A59DE58597B517A1D4BC58EF0ABFF3D324C0D0C01AC667FC5DCB5FEC1E01E72A14682A494324FFD027C1D96298D1C3050F4A22179243CC5810F0EAC060DCDE13148CD159D1ABE9D013304535088786AA3D62B988FD94101F8EB07350A2427CBED7B4498DB95195D307623D9500B1A194BD9DC04E8603B17352EDA6469DD7EC0A694DCD291BD6DD31ADA6E29916ED96E0F3C777C51D22E5A35E72A96796B8E0196E54BF83F2F03A70324DCBD305A80E72846F7C52C2816EA76C5F663969D1EE76003471F52265348B7E126F692E2C
answer = BA0D89B558C2893D1963D1364C49F9691D0967FA5454540799FB066AD90AE7F9A5F7E04803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100985AF8E2C6F85D3F92DFA2AAF64E043E3670DC584FC7786A26C7B14DB98AF9595382F790BF9B8F3EFBD3A20D7600581C32A4E0EC581D098CB2C39B5321A4A59DE58597B517A1D4BC58EF0ABFF3D324C0D0C01AC667FC5DCB5FEC1E01E72A14682A494324FFD027C1D96298D1C3050F4A22179243CC5810F0EAC060DCDE13148CD159D1ABE9D013304535088786AA3D62B988FD94101F8EB07350A2427CBED7B4498DB95195D307623D9500B1A194BD9DC04E8603B17352EDA6469DD7EC0A694DCD291BD6DD31ADA6E29916ED96E0F3C777C51D22E5A35E72A96796B8E0196E54BF83F2F03A70324DCBD305A80E72846F7C52C2816EA76C5F663969D1EE76003471F52265348B7E126F692E2C</code></pre>
<!-- end server_DH_inner_data_output -->
<!-- start server_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | BA 0D 89 B5 44 89 D8 96 B9 08 80 A8 A6 23 F7 43
0010 | BD FB 19 7A 4C 57 92 83 D0 EA 21 D4 47 21 8B 38
0020 | DC 9C 55 08 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 58 C2 89 3D 19 63 D1 36 4C 49 F9 69
0010 | 1D 09 67 FA 54 54 54 07 99 FB 06 6A D9 0A E7 F9
0020 | A5 F7 E0 48 03 00 00 00 FE 00 01 00 C7 1C AE B9
0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23
0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
@ -532,23 +532,23 @@ answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
0130 | 81 62 6B D4 F6 44 F3 7B 9C 05 18 9C 92 4A 9D BF
0140 | F7 3E 82 49 3A E0 30 19 61 F1 FD 0A E5 68 D5 1A
0150 | D7 60 C5 4D 5B 91 81 CC DB 65 CF 5D 91 2D 63 4C
0160 | A6 E9 0A 67 33 1D 4D E4 C9 AC 95 34 26 76 67 E7
0170 | 86 FE A0 7F 48 68 5E CA 15 DD EF 41 DD 57 41 5A
0180 | 35 F6 D4 00 49 BD 0C 62 E6 65 3F 95 82 30 A8 22
0190 | 37 09 00 1B 06 F5 79 E3 28 ED C8 F1 AF 54 27 5A
01A0 | 8B 90 3D DE 6E 2B F5 96 17 F8 15 82 D6 D4 96 31
01B0 | 2E 97 C0 39 A9 A5 31 CD 62 93 97 D6 30 FA DE 7F
01C0 | 5A 4D 76 BD E6 E0 68 A7 3D 62 68 8D FE 18 FB 10
01D0 | DF 6B 4D 64 CB 3E 4F 52 69 F0 1A 54 09 8E F3 73
01E0 | 56 75 9F F0 1A 5E F5 9D 85 32 E4 7D EA 41 D8 03
01F0 | 5E 5C FE 7B 65 69 A8 AB AE D5 34 52 30 02 E1 EF
0200 | 85 FE 2D C1 24 91 03 B5 43 F9 63 3F 37 44 F3 0D
0210 | 5B F7 15 08 51 C0 A5 EE D2 1F C6 D1 9D 3C B4 AB
0220 | 3B F5 6E D0 8A 45 8D 00 EF C2 2C B9 AA 1B B7 F6
0230 | D3 5E 20 65</code></pre>
0130 | 98 5A F8 E2 C6 F8 5D 3F 92 DF A2 AA F6 4E 04 3E
0140 | 36 70 DC 58 4F C7 78 6A 26 C7 B1 4D B9 8A F9 59
0150 | 53 82 F7 90 BF 9B 8F 3E FB D3 A2 0D 76 00 58 1C
0160 | 32 A4 E0 EC 58 1D 09 8C B2 C3 9B 53 21 A4 A5 9D
0170 | E5 85 97 B5 17 A1 D4 BC 58 EF 0A BF F3 D3 24 C0
0180 | D0 C0 1A C6 67 FC 5D CB 5F EC 1E 01 E7 2A 14 68
0190 | 2A 49 43 24 FF D0 27 C1 D9 62 98 D1 C3 05 0F 4A
01A0 | 22 17 92 43 CC 58 10 F0 EA C0 60 DC DE 13 14 8C
01B0 | D1 59 D1 AB E9 D0 13 30 45 35 08 87 86 AA 3D 62
01C0 | B9 88 FD 94 10 1F 8E B0 73 50 A2 42 7C BE D7 B4
01D0 | 49 8D B9 51 95 D3 07 62 3D 95 00 B1 A1 94 BD 9D
01E0 | C0 4E 86 03 B1 73 52 ED A6 46 9D D7 EC 0A 69 4D
01F0 | CD 29 1B D6 DD 31 AD A6 E2 99 16 ED 96 E0 F3 C7
0200 | 77 C5 1D 22 E5 A3 5E 72 A9 67 96 B8 E0 19 6E 54
0210 | BF 83 F2 F0 3A 70 32 4D CB D3 05 A8 0E 72 84 6F
0220 | 7C 52 C2 81 6E A7 6C 5F 66 39 69 D1 EE 76 00 34
0230 | 71 F5 22 65</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010081626BD4F644F37B9C05189C</code> <code>924A9DBFF73E82493AE0301961F1FD0A</code> <code>E568D51AD760C54D5B9181CCDB65CF5D</code> <code>912D634CA6E90A67331D4DE4C9AC9534</code> <code>267667E786FEA07F48685ECA15DDEF41</code> <code>DD57415A35F6D40049BD0C62E6653F95</code> <code>8230A8223709001B06F579E328EDC8F1</code> <code>AF54275A8B903DDE6E2BF59617F81582</code> <code>D6D496312E97C039A9A531CD629397D6</code> <code>30FADE7F5A4D76BDE6E068A73D62688D</code> <code>FE18FB10DF6B4D64CB3E4F5269F01A54</code> <code>098EF37356759FF01A5EF59D8532E47D</code> <code>EA41D8035E5CFE7B6569A8ABAED53452</code> <code>3002E1EF85FE2DC1249103B543F9633F</code> <code>3744F30D5BF7150851C0A5EED21FC6D1</code> <code>9D3CB4AB3BF56ED08A458D00EFC22CB9</code><br> <code>AA1BB7F6</code></td>
<td><code>FE000100985AF8E2C6F85D3F92DFA2AA</code> <code>F64E043E3670DC584FC7786A26C7B14D</code> <code>B98AF9595382F790BF9B8F3EFBD3A20D</code> <code>7600581C32A4E0EC581D098CB2C39B53</code> <code>21A4A59DE58597B517A1D4BC58EF0ABF</code> <code>F3D324C0D0C01AC667FC5DCB5FEC1E01</code> <code>E72A14682A494324FFD027C1D96298D1</code> <code>C3050F4A22179243CC5810F0EAC060DC</code> <code>DE13148CD159D1ABE9D0133045350887</code> <code>86AA3D62B988FD94101F8EB07350A242</code> <code>7CBED7B4498DB95195D307623D9500B1</code> <code>A194BD9DC04E8603B17352EDA6469DD7</code> <code>EC0A694DCD291BD6DD31ADA6E29916ED</code> <code>96E0F3C777C51D22E5A35E72A96796B8</code> <code>E0196E54BF83F2F03A70324DCBD305A8</code> <code>0E72846F7C52C2816EA76C5F663969D1</code><br> <code>EE760034</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>D35E2065</code> (1696620243 in decimal)</td>
<td><code>71F52265</code> (1696789873 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550
<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5>
<p>First, generate a secure random 2048-bit number b:</p>
<!-- start b -->
<pre><code>b = 58C9AB82916CFB407C6038854490D5A8910CEDA18103DDA1468EDD2F996D841B62066E72FE29A7245DA3DE39DDDD319433B1275E101A23493B2E084537BD9F3DE53F7BDDB3F49200118842713F3EEFE39C141DF302ED1DD6EECC1F7B89B4703C3671BBB332159E9CDB025358FE1773A4CCC1EB42E4413606C3F519DB760A8FBC941777729CFF0F894D1BCBB1E6F423C998ACEA2A18A334BF46832D3AAC105304843DAF61373BBA3E3E83A400D53A991BFBA08F64B46FB7336906B1F38BE4D1B6CD67045EE01C6642090F3F91731EAEB0757D9636838C6556D3C2D880F511875C8F55271ECBDBDF922907139FF30C44693A99969FBCB5DBDD15331656A3430FE5</code></pre>
<pre><code>b = 6D1E82DDAC9F80DECE92BC7A42D8E94014D5CF84A9428931A064BD731E92CF0DA08067E1B7BE172CCEF799064E69D7FFD89720494C74E09411284C3B6B8CE946F028869B859BB78B956B0C120442F70BDE77504866EEE955EC558F66B248C8E41C5EC19D0F7836051B7EF74D325281B2DA916B961668FF215DF3D6C4694D7AD793F2FED7AFEA47C85C71C2A6FED3EFBAC3B284C85FEDDA12B3DD0DAC7FDAEDF9D4FA09A3E421FC227F68DCE53D721EF3CF1BE23A6FAF0D46954E1C16B074D44712429911E24DB18D7E18A48689976A5622BB754C52A41D7C00DC374B7C417D64678C1F0F06773016856CDC4C91BC04A0E02E3054EC0B4A0D62198F16E03FBB00</code></pre>
<!-- end b -->
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
<!-- start g_b -->
<pre><code>g_b = 9CACAC715E89F072F01C3CF7B9FD8BC8B7242BBCE6A68BB576BC0431387894245A4499354A6B5CFAB18A9E00BDB0E56E2EAEF108FE5C65F54F8F7EA194E62727EC248B3A60CFD96E17C0CA54F00657D20CA1B700F46A0D7A66210E5F039DC626B698D553DA70BAFA6A13B81562DF550EBE6F2683DF86B4C6FEBEF378165D1A48203A93E607C5B74C9BC191700836C59C9B275D06B22FCD6D70AB447F91C9B6A979DABE601B9ED0C8C1326C4EBF44A67DD1EE6CE8A1730C72C227FB3DD51F6A75CFC0DB0B2768006884F9F9837842ADC45CD9EDE3972BC230DCC461406492489343B7228C8560A014F8FA89B8173AF37273BB7897D89BAC1B88CDE0FDD6427CCC</code></pre>
<pre><code>g_b = C1FA6C6108A690D57884A07623800F29B976346C7FAF707299B186F72628781D1C4DD1EA9FD326C1896FBAC6506D534F89335B13FCEC4626184BC4F9CFD55895DA8D5C74A8D1E1F981FC9992217E93EEB55535DF90FC100F8D7FFA1278A286FB01EE5D107B69A39D1068A96B95322E4C9F9F1DC27AD90EFCF8DBABF9C8639644F9E392BD964FC32FE918F86D00585D3F13FAC7090294CB2222EE1766B9001FF22CC11D28FB0AE9CD589E0DC710F5DBB695C303876793838ACFB39E49DF1C9D6F99328918DA28559A02AB40791AAE5CE6AFBBD047AE4C8B57ADB1512738F35646D627840669C043D0DC0777D7B347B0FEA33A3D86198F81863A15E04632C9D737</code></pre>
<!-- end g_b -->
<h6>7.1) generation of encrypted_data</h6>
<!-- start client_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 54 B6 43 66 44 89 D8 96 B9 08 80 A8 A6 23 F7 43
0010 | BD FB 19 7A 4C 57 92 83 D0 EA 21 D4 47 21 8B 38
0020 | DC 9C 55 08 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 9C AC AC 71 5E 89 F0 72 F0 1C 3C F7 B9 FD 8B C8
0040 | B7 24 2B BC E6 A6 8B B5 76 BC 04 31 38 78 94 24
0050 | 5A 44 99 35 4A 6B 5C FA B1 8A 9E 00 BD B0 E5 6E
0060 | 2E AE F1 08 FE 5C 65 F5 4F 8F 7E A1 94 E6 27 27
0070 | EC 24 8B 3A 60 CF D9 6E 17 C0 CA 54 F0 06 57 D2
0080 | 0C A1 B7 00 F4 6A 0D 7A 66 21 0E 5F 03 9D C6 26
0090 | B6 98 D5 53 DA 70 BA FA 6A 13 B8 15 62 DF 55 0E
00A0 | BE 6F 26 83 DF 86 B4 C6 FE BE F3 78 16 5D 1A 48
00B0 | 20 3A 93 E6 07 C5 B7 4C 9B C1 91 70 08 36 C5 9C
00C0 | 9B 27 5D 06 B2 2F CD 6D 70 AB 44 7F 91 C9 B6 A9
00D0 | 79 DA BE 60 1B 9E D0 C8 C1 32 6C 4E BF 44 A6 7D
00E0 | D1 EE 6C E8 A1 73 0C 72 C2 27 FB 3D D5 1F 6A 75
00F0 | CF C0 DB 0B 27 68 00 68 84 F9 F9 83 78 42 AD C4
0100 | 5C D9 ED E3 97 2B C2 30 DC C4 61 40 64 92 48 93
0110 | 43 B7 22 8C 85 60 A0 14 F8 FA 89 B8 17 3A F3 72
0120 | 73 BB 78 97 D8 9B AC 1B 88 CD E0 FD D6 42 7C CC</code></pre>
<pre><code>0000 | 54 B6 43 66 58 C2 89 3D 19 63 D1 36 4C 49 F9 69
0010 | 1D 09 67 FA 54 54 54 07 99 FB 06 6A D9 0A E7 F9
0020 | A5 F7 E0 48 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | C1 FA 6C 61 08 A6 90 D5 78 84 A0 76 23 80 0F 29
0040 | B9 76 34 6C 7F AF 70 72 99 B1 86 F7 26 28 78 1D
0050 | 1C 4D D1 EA 9F D3 26 C1 89 6F BA C6 50 6D 53 4F
0060 | 89 33 5B 13 FC EC 46 26 18 4B C4 F9 CF D5 58 95
0070 | DA 8D 5C 74 A8 D1 E1 F9 81 FC 99 92 21 7E 93 EE
0080 | B5 55 35 DF 90 FC 10 0F 8D 7F FA 12 78 A2 86 FB
0090 | 01 EE 5D 10 7B 69 A3 9D 10 68 A9 6B 95 32 2E 4C
00A0 | 9F 9F 1D C2 7A D9 0E FC F8 DB AB F9 C8 63 96 44
00B0 | F9 E3 92 BD 96 4F C3 2F E9 18 F8 6D 00 58 5D 3F
00C0 | 13 FA C7 09 02 94 CB 22 22 EE 17 66 B9 00 1F F2
00D0 | 2C C1 1D 28 FB 0A E9 CD 58 9E 0D C7 10 F5 DB B6
00E0 | 95 C3 03 87 67 93 83 8A CF B3 9E 49 DF 1C 9D 6F
00F0 | 99 32 89 18 DA 28 55 9A 02 AB 40 79 1A AE 5C E6
0100 | AF BB D0 47 AE 4C 8B 57 AD B1 51 27 38 F3 56 46
0110 | D6 27 84 06 69 C0 43 D0 DC 07 77 D7 B3 47 B0 FE
0120 | A3 3A 3D 86 19 8F 81 86 3A 15 E0 46 32 C9 D7 37</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
<table class="table">
@ -658,19 +658,19 @@ answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001009CACAC715E89F072F01C3CF7</code> <code>B9FD8BC8B7242BBCE6A68BB576BC0431</code> <code>387894245A4499354A6B5CFAB18A9E00</code> <code>BDB0E56E2EAEF108FE5C65F54F8F7EA1</code> <code>94E62727EC248B3A60CFD96E17C0CA54</code> <code>F00657D20CA1B700F46A0D7A66210E5F</code> <code>039DC626B698D553DA70BAFA6A13B815</code> <code>62DF550EBE6F2683DF86B4C6FEBEF378</code> <code>165D1A48203A93E607C5B74C9BC19170</code> <code>0836C59C9B275D06B22FCD6D70AB447F</code> <code>91C9B6A979DABE601B9ED0C8C1326C4E</code> <code>BF44A67DD1EE6CE8A1730C72C227FB3D</code> <code>D51F6A75CFC0DB0B2768006884F9F983</code> <code>7842ADC45CD9EDE3972BC230DCC46140</code> <code>6492489343B7228C8560A014F8FA89B8</code> <code>173AF37273BB7897D89BAC1B88CDE0FD</code><br> <code>D6427CCC</code></td>
<td><code>FE000100C1FA6C6108A690D57884A076</code> <code>23800F29B976346C7FAF707299B186F7</code> <code>2628781D1C4DD1EA9FD326C1896FBAC6</code> <code>506D534F89335B13FCEC4626184BC4F9</code> <code>CFD55895DA8D5C74A8D1E1F981FC9992</code> <code>217E93EEB55535DF90FC100F8D7FFA12</code> <code>78A286FB01EE5D107B69A39D1068A96B</code> <code>95322E4C9F9F1DC27AD90EFCF8DBABF9</code> <code>C8639644F9E392BD964FC32FE918F86D</code> <code>00585D3F13FAC7090294CB2222EE1766</code> <code>B9001FF22CC11D28FB0AE9CD589E0DC7</code> <code>10F5DBB695C303876793838ACFB39E49</code> <code>DF1C9D6F99328918DA28559A02AB4079</code> <code>1AAE5CE6AFBBD047AE4C8B57ADB15127</code> <code>38F35646D627840669C043D0DC0777D7</code> <code>B347B0FEA33A3D86198F81863A15E046</code><br> <code>32C9D737</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr>
<tr>
@ -684,47 +684,47 @@ answer = BA0D89B54489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C550
<!-- end client_DH_inner_data -->
<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p>
<!-- start client_DH_inner_data_input -->
<pre><code>data = 54B643664489D896B90880A8A623F743BDFB197A4C579283D0EA21D447218B38DC9C55080000000000000000FE0001009CACAC715E89F072F01C3CF7B9FD8BC8B7242BBCE6A68BB576BC0431387894245A4499354A6B5CFAB18A9E00BDB0E56E2EAEF108FE5C65F54F8F7EA194E62727EC248B3A60CFD96E17C0CA54F00657D20CA1B700F46A0D7A66210E5F039DC626B698D553DA70BAFA6A13B81562DF550EBE6F2683DF86B4C6FEBEF378165D1A48203A93E607C5B74C9BC191700836C59C9B275D06B22FCD6D70AB447F91C9B6A979DABE601B9ED0C8C1326C4EBF44A67DD1EE6CE8A1730C72C227FB3DD51F6A75CFC0DB0B2768006884F9F9837842ADC45CD9EDE3972BC230DCC461406492489343B7228C8560A014F8FA89B8173AF37273BB7897D89BAC1B88CDE0FDD6427CCC
padding = 3A68BCDA93B6A10751FDB547
tmp_aes_key = E22A39733A0CA04AC31617FEFD7E5A3C54CF06AE3FF1DF7E2B5DF48EF7F937E9
tmp_aes_iv = 63828DB4E00117FD643F872C5B4975BC013A065BD691CFA5640C797A3C482639</code></pre>
<pre><code>data = 54B6436658C2893D1963D1364C49F9691D0967FA5454540799FB066AD90AE7F9A5F7E0480000000000000000FE000100C1FA6C6108A690D57884A07623800F29B976346C7FAF707299B186F72628781D1C4DD1EA9FD326C1896FBAC6506D534F89335B13FCEC4626184BC4F9CFD55895DA8D5C74A8D1E1F981FC9992217E93EEB55535DF90FC100F8D7FFA1278A286FB01EE5D107B69A39D1068A96B95322E4C9F9F1DC27AD90EFCF8DBABF9C8639644F9E392BD964FC32FE918F86D00585D3F13FAC7090294CB2222EE1766B9001FF22CC11D28FB0AE9CD589E0DC710F5DBB695C303876793838ACFB39E49DF1C9D6F99328918DA28559A02AB40791AAE5CE6AFBBD047AE4C8B57ADB1512738F35646D627840669C043D0DC0777D7B347B0FEA33A3D86198F81863A15E04632C9D737
padding = ECD9B8E57F405F4DA52369ED
tmp_aes_key = 1EF31FDD893F3FC4802877BC105FC0B01A14753EEFF15E0BA1913BA164820A34
tmp_aes_iv = 5AF4537C03BE9A55811DD73015B491B2EDE87FD1499AD57E1C7F0C81E7A08A34</code></pre>
<!-- end client_DH_inner_data_input -->
<p>Process:</p>
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
<p>Output:</p>
<!-- start client_DH_inner_data_output -->
<pre><code>encrypted_data = 251F8A30247E4F706052B4ED166B8A3543F6335F56881F4450E329B3B65A4163CC304561C3C0A6AE6BDD02E239D038E4455EAEDE525C3F29ABE8225943B85759A043F464148AA2C3D5E8137CE3B19EB2583A9BC88396F12678A1A916254374806D052F8D30135E5D58C1C67296268A562775AFB164157F55B3AA45CCF1E7D45BABC06D3FCD5A441C362102A6915B6487E12F55BE46F35F0DA1C24BB49A552A32D4F15FB16755B8658583FB00FD2B64C7429016483E850A5D0BD1F5F584A2EAB1DD24A6A6B7AD3C4A4193318C2014E8EA6DAB6685D67F7C2611189E3C7C2A705A54159E82A9A150CEE6161E90D1F2167657481A72F6C96D5C141AEAD665411CC7F9F3C89A495B0268329F1D806A51010B08124B75938FE5EB3ED1DB58C6D7D8F9F4E2203738988758CA57B0FED7B2D7F92048E242ACFC389703DA023064A2A9891B3DB5F3113C20D492B53EFD0B826F28</code></pre>
<pre><code>encrypted_data = 45D326B8F0CCBA2FEE4F2B8F8F1098F45B851027507B03D61DD7A6341B66F97E8B4B504B8161652687947B7735C13192D5076BDBA37B76D33EA1E55581F22C348F4B4139B8D55729BE66CDDEAE811F677018109FB1AC1A4EA6164FBA0B1418E29A331BFEFB7CBE7A835D17082DAF985193ECC1EBBDCAD055C147290B3D28B89C095382F9A81A0E72AC7035D402A9F40A5D5880EB4916C8175FCC6B8E2C29416320DE75D84FED182F9EF42EF6EC5BED09999703F9854390892051FEF25B7D27F5844A18DFA7C09AEB75D88223DFFB418B1740A5E31058F77839E1E801D3DCA237F29381F47DFDB3318F7899DFE267C879496DED11C2F405D1CBE93280B44E768BF4A2F030B1900DB1409C06615A2B8F092E3FB1518D98355A4EE5DB0C1BC487ADA77A06D9C3171B9ECD7E59CD47ABF017832E26B91264B3BC4302FD5FFE98408966395BB437254DE26D7989A4AD957909</code></pre>
<!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 E8 34 00 00 D3 5E 20 65
0010 | 78 01 00 00 1F 5F 04 F5 44 89 D8 96 B9 08 80 A8
0020 | A6 23 F7 43 BD FB 19 7A 4C 57 92 83 D0 EA 21 D4
0030 | 47 21 8B 38 DC 9C 55 08 FE 50 01 00 25 1F 8A 30
0040 | 24 7E 4F 70 60 52 B4 ED 16 6B 8A 35 43 F6 33 5F
0050 | 56 88 1F 44 50 E3 29 B3 B6 5A 41 63 CC 30 45 61
0060 | C3 C0 A6 AE 6B DD 02 E2 39 D0 38 E4 45 5E AE DE
0070 | 52 5C 3F 29 AB E8 22 59 43 B8 57 59 A0 43 F4 64
0080 | 14 8A A2 C3 D5 E8 13 7C E3 B1 9E B2 58 3A 9B C8
0090 | 83 96 F1 26 78 A1 A9 16 25 43 74 80 6D 05 2F 8D
00A0 | 30 13 5E 5D 58 C1 C6 72 96 26 8A 56 27 75 AF B1
00B0 | 64 15 7F 55 B3 AA 45 CC F1 E7 D4 5B AB C0 6D 3F
00C0 | CD 5A 44 1C 36 21 02 A6 91 5B 64 87 E1 2F 55 BE
00D0 | 46 F3 5F 0D A1 C2 4B B4 9A 55 2A 32 D4 F1 5F B1
00E0 | 67 55 B8 65 85 83 FB 00 FD 2B 64 C7 42 90 16 48
00F0 | 3E 85 0A 5D 0B D1 F5 F5 84 A2 EA B1 DD 24 A6 A6
0100 | B7 AD 3C 4A 41 93 31 8C 20 14 E8 EA 6D AB 66 85
0110 | D6 7F 7C 26 11 18 9E 3C 7C 2A 70 5A 54 15 9E 82
0120 | A9 A1 50 CE E6 16 1E 90 D1 F2 16 76 57 48 1A 72
0130 | F6 C9 6D 5C 14 1A EA D6 65 41 1C C7 F9 F3 C8 9A
0140 | 49 5B 02 68 32 9F 1D 80 6A 51 01 0B 08 12 4B 75
0150 | 93 8F E5 EB 3E D1 DB 58 C6 D7 D8 F9 F4 E2 20 37
0160 | 38 98 87 58 CA 57 B0 FE D7 B2 D7 F9 20 48 E2 42
0170 | AC FC 38 97 03 DA 02 30 64 A2 A9 89 1B 3D B5 F3
0180 | 11 3C 20 D4 92 B5 3E FD 0B 82 6F 28</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 61 0B 00 71 F5 22 65
0010 | 78 01 00 00 1F 5F 04 F5 58 C2 89 3D 19 63 D1 36
0020 | 4C 49 F9 69 1D 09 67 FA 54 54 54 07 99 FB 06 6A
0030 | D9 0A E7 F9 A5 F7 E0 48 FE 50 01 00 45 D3 26 B8
0040 | F0 CC BA 2F EE 4F 2B 8F 8F 10 98 F4 5B 85 10 27
0050 | 50 7B 03 D6 1D D7 A6 34 1B 66 F9 7E 8B 4B 50 4B
0060 | 81 61 65 26 87 94 7B 77 35 C1 31 92 D5 07 6B DB
0070 | A3 7B 76 D3 3E A1 E5 55 81 F2 2C 34 8F 4B 41 39
0080 | B8 D5 57 29 BE 66 CD DE AE 81 1F 67 70 18 10 9F
0090 | B1 AC 1A 4E A6 16 4F BA 0B 14 18 E2 9A 33 1B FE
00A0 | FB 7C BE 7A 83 5D 17 08 2D AF 98 51 93 EC C1 EB
00B0 | BD CA D0 55 C1 47 29 0B 3D 28 B8 9C 09 53 82 F9
00C0 | A8 1A 0E 72 AC 70 35 D4 02 A9 F4 0A 5D 58 80 EB
00D0 | 49 16 C8 17 5F CC 6B 8E 2C 29 41 63 20 DE 75 D8
00E0 | 4F ED 18 2F 9E F4 2E F6 EC 5B ED 09 99 97 03 F9
00F0 | 85 43 90 89 20 51 FE F2 5B 7D 27 F5 84 4A 18 DF
0100 | A7 C0 9A EB 75 D8 82 23 DF FB 41 8B 17 40 A5 E3
0110 | 10 58 F7 78 39 E1 E8 01 D3 DC A2 37 F2 93 81 F4
0120 | 7D FD B3 31 8F 78 99 DF E2 67 C8 79 49 6D ED 11
0130 | C2 F4 05 D1 CB E9 32 80 B4 4E 76 8B F4 A2 F0 30
0140 | B1 90 0D B1 40 9C 06 61 5A 2B 8F 09 2E 3F B1 51
0150 | 8D 98 35 5A 4E E5 DB 0C 1B C4 87 AD A7 7A 06 D9
0160 | C3 17 1B 9E CD 7E 59 CD 47 AB F0 17 83 2E 26 B9
0170 | 12 64 B3 BC 43 02 FD 5F FE 98 40 89 66 39 5B B4
0180 | 37 25 4D E2 6D 79 89 A4 AD 95 79 09</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>E8340000D35E2065</code></td>
<td><code>18610B0071F52265</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100251F8A30247E4F706052B4ED</code> <code>166B8A3543F6335F56881F4450E329B3</code> <code>B65A4163CC304561C3C0A6AE6BDD02E2</code> <code>39D038E4455EAEDE525C3F29ABE82259</code> <code>43B85759A043F464148AA2C3D5E8137C</code> <code>E3B19EB2583A9BC88396F12678A1A916</code> <code>254374806D052F8D30135E5D58C1C672</code> <code>96268A562775AFB164157F55B3AA45CC</code> <code>F1E7D45BABC06D3FCD5A441C362102A6</code> <code>915B6487E12F55BE46F35F0DA1C24BB4</code> <code>9A552A32D4F15FB16755B8658583FB00</code> <code>FD2B64C7429016483E850A5D0BD1F5F5</code> <code>84A2EAB1DD24A6A6B7AD3C4A4193318C</code> <code>2014E8EA6DAB6685D67F7C2611189E3C</code> <code>7C2A705A54159E82A9A150CEE6161E90</code> <code>D1F2167657481A72F6C96D5C141AEAD6</code> <code>65411CC7F9F3C89A495B0268329F1D80</code> <code>6A51010B08124B75938FE5EB3ED1DB58</code> <code>C6D7D8F9F4E2203738988758CA57B0FE</code> <code>D7B2D7F92048E242ACFC389703DA0230</code> <code>64A2A9891B3DB5F3113C20D492B53EFD</code><br> <code>0B826F28</code></td>
<td><code>FE50010045D326B8F0CCBA2FEE4F2B8F</code> <code>8F1098F45B851027507B03D61DD7A634</code> <code>1B66F97E8B4B504B8161652687947B77</code> <code>35C13192D5076BDBA37B76D33EA1E555</code> <code>81F22C348F4B4139B8D55729BE66CDDE</code> <code>AE811F677018109FB1AC1A4EA6164FBA</code> <code>0B1418E29A331BFEFB7CBE7A835D1708</code> <code>2DAF985193ECC1EBBDCAD055C147290B</code> <code>3D28B89C095382F9A81A0E72AC7035D4</code> <code>02A9F40A5D5880EB4916C8175FCC6B8E</code> <code>2C29416320DE75D84FED182F9EF42EF6</code> <code>EC5BED09999703F9854390892051FEF2</code> <code>5B7D27F5844A18DFA7C09AEB75D88223</code> <code>DFFB418B1740A5E31058F77839E1E801</code> <code>D3DCA237F29381F47DFDB3318F7899DF</code> <code>E267C879496DED11C2F405D1CBE93280</code> <code>B44E768BF4A2F030B1900DB1409C0661</code> <code>5A2B8F092E3FB1518D98355A4EE5DB0C</code> <code>1BC487ADA77A06D9C3171B9ECD7E59CD</code> <code>47ABF017832E26B91264B3BC4302FD5F</code> <code>FE98408966395BB437254DE26D7989A4</code><br> <code>AD957909</code></td>
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
</tr>
</tbody>
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5>
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
<!-- start auth_key -->
<pre><code>auth_key = 5CC8D1130D85E6F0322C0421A2922E2298C7B5C968BA54F1F541E44DD1FD8F1ED82BC7DF72321E28A180624C4B746478B480B16AB3990519A9D9285ED9DD7B5D126172D5D5043B5590A55317F1BF657C46CD002F1D86BD08F9E8DAA471A437D40DA98D0A01E6B3C327A03B6505700067FA4CF627008EACFAE8A40F81F75022208C47A0098F2519917165B16319B105000AD33D5F2A34ECD582FE7DE9C3E46B9975009CC407685734F0D737186B1435F59413DCF9A6297BDAE0BBC50DC5A653E49CEF4EFF78E0B9527D6B1C7AB2203A168B4E6E05AB7EBE60D69A01EAC5DACDCC102EEC578BDF3CBA906CCC3F0C184024B17BD01F9214B3D4A837233C632BAF4B</code></pre>
<pre><code>auth_key = 4956DE0A117E360E7E8C90B071E36CBB7E87D584BA43D5B11E3F8B256B71CD411531237092606FDB1E43DFC9AFE5AEA404BC70DBCFED48DEC78978D8A7ABB71C723E1C9C39B70B9AE10ED76F884A58B4486B6A7539AFCBA0A64FFDB8A5D8DD8879DCC83DF0A66EA0769E17DE2B0F883A8554183F145397DABD927628C0D51BDED2210281224BAFC8D73728DE4C8A228D22C6158F7CBDCF0E0017C21D593F038481E5B3EE7C35B7046D4267AB6827FD636B94090F434C3DB47D4341BC7D10DA2ADBA037CA539173EB1F441CCF2D73AD0E8AE83EF611ACE77B42D87F201C02F39E5EF06569D686E9322DEF58E51F9AE9FF1A8B6F4D9F53EED73F9D6DADB1760E4D</code></pre>
<!-- end auth_key -->
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
<!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 70 DE BF D3 5E 20 65
0010 | 64 00 00 00 34 F7 CB 3B 44 89 D8 96 B9 08 80 A8
0020 | A6 23 F7 43 BD FB 19 7A 4C 57 92 83 D0 EA 21 D4
0030 | 47 21 8B 38 DC 9C 55 08 11 80 E7 9B 75 AB DA F8
0040 | B9 D6 48 90 66 E9 C1 7A</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 28 AB 2E 72 F5 22 65
0010 | A4 00 00 00 34 F7 CB 3B 58 C2 89 3D 19 63 D1 36
0020 | 4C 49 F9 69 1D 09 67 FA 54 54 54 07 99 FB 06 6A
0030 | D9 0A E7 F9 A5 F7 E0 48 64 28 4A BB 5E 5C 33 0A
0040 | 2B 7E D3 31 26 77 06 B5</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0170DEBFD35E2065</code></td>
<td><code>0128AB2E72F52265</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>64000000</code> (100 in decimal)</td>
<td><code>A4000000</code> (164 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4489D896B90880A8A623F743BDFB197A</code></td>
<td><code>58C2893D1963D1364C49F9691D0967FA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4C579283D0EA21D447218B38DC9C5508</code></td>
<td><code>5454540799FB066AD90AE7F9A5F7E048</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>1180E79B75ABDAF8B9D6489066E9C17A</code></td>
<td><code>64284ABB5E5C330A2B7ED331267706B5</code></td>
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
</tr>
</tbody>

View file

@ -42,7 +42,8 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/InputPrivacyKey" >InputPrivacyKey</a></li></ul></div>
<h1 id="dev_page_title">InputPrivacyKey</h1>
<div id="dev_page_content"><p>Privacy key</p>
<div id="dev_page_content"><p>Privacy <strong>keys</strong> together with <a href="/api/privacy-rules#privacy-rules">privacy rules »</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>. </p>
<p>See the <a href="/api/privacy">privacy documentation »</a> for more info.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">

View file

@ -42,7 +42,8 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/InputPrivacyRule" >InputPrivacyRule</a></li></ul></div>
<h1 id="dev_page_title">InputPrivacyRule</h1>
<div id="dev_page_content"><p>Privacy rule</p>
<div id="dev_page_content"><p>Privacy <strong>rules</strong> indicate <em>who</em> can or can't do something and are specified by a <a href="/type/PrivacyRule">PrivacyRule</a>, and its input counterpart <a href="/type/InputPrivacyRule">InputPrivacyRule</a>. </p>
<p>See the <a href="/api/privacy">privacy documentation »</a> for more info.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">

View file

@ -8,24 +8,14 @@
Constructor
Description
mediaAreaVenue
 
inputMediaAreaVenue
 
mediaAreaGeoPoint
 
mediaAreaSuggestedReaction…">
Represents a location tag attached to a story, with additional venue…">
<meta property="og:title" content="MediaArea">
<meta property="og:image" content="">
<meta property="og:description" content="Constructors
Constructor
Description
mediaAreaVenue
 
inputMediaAreaVenue
 
mediaAreaGeoPoint
 
mediaAreaSuggestedReaction…">
Represents a location tag attached to a story, with additional venue…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -87,7 +77,7 @@ mediaAreaSuggestedReaction…">
<tbody>
<tr>
<td><a href="/constructor/mediaAreaVenue">mediaAreaVenue</a></td>
<td> </td>
<td>Represents a location tag attached to a <a href="/api/story">story</a>, with additional venue information.</td>
</tr>
<tr>
<td><a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a></td>
@ -95,11 +85,11 @@ mediaAreaSuggestedReaction…">
</tr>
<tr>
<td><a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a></td>
<td> </td>
<td>Represents a geolocation tag attached to a <a href="/api/story">story</a>.</td>
</tr>
<tr>
<td><a href="/constructor/mediaAreaSuggestedReaction">mediaAreaSuggestedReaction</a></td>
<td> </td>
<td>Represents a reaction bubble.</td>
</tr>
</tbody>
</table></div>

View file

@ -4,18 +4,10 @@
<meta charset="utf-8">
<title>MediaAreaCoordinates</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Constructors
Constructor
Description
mediaAreaCoordinates
 ">
<meta property="description" content="Coordinates and size of a clicable rectangular area on top of a story.">
<meta property="og:title" content="MediaAreaCoordinates">
<meta property="og:image" content="">
<meta property="og:description" content="Constructors
Constructor
Description
mediaAreaCoordinates
 ">
<meta property="og:description" content="Coordinates and size of a clicable rectangular area on top of a story.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -50,7 +42,8 @@ mediaAreaCoordinates
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/MediaAreaCoordinates" >MediaAreaCoordinates</a></li></ul></div>
<h1 id="dev_page_title">MediaAreaCoordinates</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Coordinates and size of a clicable rectangular area on top of a story.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -74,7 +67,7 @@ mediaAreaCoordinates
<tbody>
<tr>
<td><a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a></td>
<td> </td>
<td>Coordinates and size of a clicable rectangular area on top of a story.</td>
</tr>
</tbody>
</table></div>

View file

@ -42,7 +42,8 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/PrivacyKey" >PrivacyKey</a></li></ul></div>
<h1 id="dev_page_title">PrivacyKey</h1>
<div id="dev_page_content"><p>Privacy key</p>
<div id="dev_page_content"><p>Privacy <strong>keys</strong> together with <a href="/api/privacy-rules#privacy-rules">privacy rules »</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>. </p>
<p>See the <a href="/api/privacy">privacy documentation »</a> for more info.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">

View file

@ -42,7 +42,8 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/PrivacyRule" >PrivacyRule</a></li></ul></div>
<h1 id="dev_page_title">PrivacyRule</h1>
<div id="dev_page_content"><p>Privacy rule</p>
<div id="dev_page_content"><p>Privacy <strong>rules</strong> together with <a href="/api/privacy-rules#privacy-rules">privacy</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>. </p>
<p>See the <a href="/api/privacy">privacy documentation »</a> for more info.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">

File diff suppressed because one or more lines are too long

View file

@ -147,7 +147,7 @@ var Main = {
size = parseInt(size);
while (this.scrollWidth > this.offsetWidth) {
size -= 0.5;
if (size >= init_size * 0.75) {
if (size >= init_size * 0.65) {
$(this).css('font-size', size + 'px');
} else {
break;
@ -1563,6 +1563,29 @@ var MyBids = {
}
};
var PremiumHistory = {
init: function() {
Aj.onLoad(function(state) {
$(document).on('click.curPage', '.js-load-more-rows', PremiumHistory.eLoadMoreRows);
});
},
eLoadMoreRows: function(e) {
e.preventDefault();
var $table = $(this).closest('table');
var offset_id = $(this).attr('data-next-offset');
Aj.apiRequest('getPremiumHistory', {
type: Aj.state.type || '',
offset_id: offset_id
}, function(result) {
if (result.error) {
return showAlert(result.error);
}
$('tbody', $table).append(result.body);
$('tfoot', $table).html(result.foot);
});
}
};
var Sessions = {
init: function() {
Aj.onLoad(function(state) {
@ -1751,7 +1774,7 @@ var Premium = {
}
if (result.found.name) {
var $form = Aj.state.$premiumSearchForm;
$form.field('query').value(result.found.name);
$form.field('query').value(uncleanHTML(result.found.name));
}
$form.toggleClass('myself', result.found.myself);
$form.field('recipient').value(result.found.recipient);
@ -1870,6 +1893,325 @@ var Premium = {
}
};
var PremiumGiveaway = {
init: function() {
Aj.onLoad(function(state) {
var cont = Aj.ajContainer;
$(cont).on('click.curPage', '.js-another-giveaway-btn', PremiumGiveaway.eMoreGiveawayPremium);
$(cont).on('click.curPage', '.js-giveaway-premium-btn', PremiumGiveaway.eGiveawayPremium);
state.$giveawayPremiumPopup = $('.js-giveaway-premium-popup');
$(cont).on('submit.curPage', '.js-giveaway-premium-form', PremiumGiveaway.eGiveawayPremiumSubmit);
state.$giveawayPremiumForm = $('.js-giveaway-premium-form');
state.$premiumSearchField = $('.js-premium-search-field');
state.$premiumSearchForm = $('.js-premium-form');
state.$premiumSearchForm.on('submit', PremiumGiveaway.eSearchSubmit);
state.$premiumSearchForm.field('query').on('input', PremiumGiveaway.eSearchInput);
state.$premiumSearchForm.field('query').on('change', PremiumGiveaway.eSearchChange);
$('.js-form-clear', state.$premiumSearchForm).on('click', PremiumGiveaway.eSearchClear);
state.$premiumQuantityField = $('.js-premium-quantity-field');
state.$premiumSearchForm.field('quantity').on('change', PremiumGiveaway.eQuantityChanged);
state.$premiumSearchForm.on('change', '.js-premium-options input.radio', PremiumGiveaway.eRadioChanged);
state.$giveawayPremiumBtn = $('.js-giveaway-premium-btn');
state.curQuantity = state.$premiumSearchForm.field('quantity').value();
state.updLastReq = +Date.now();
if (state.needUpdate) {
state.updStateTo = setTimeout(PremiumGiveaway.updateState, Main.UPDATE_PERIOD);
}
$(cont).on('click.curPage', '.js-preview-sticker', function() {
RLottie.playUntilEnd(this);
});
$('.js-preview-sticker').each(function() {
RLottie.init(this, {playUntilEnd: true});
});
RLottie.init();
});
Aj.onUnload(function(state) {
clearTimeout(state.updStateTo);
state.needUpdate = false;
Main.destroyForm(state.$giveawayPremiumForm);
state.$premiumSearchForm.off('submit', PremiumGiveaway.eSearchSubmit);
state.$premiumSearchForm.field('query').off('input', PremiumGiveaway.eSearchInput);
state.$premiumSearchForm.field('query').on('change', PremiumGiveaway.eSearchChange);
$('.js-form-clear', state.$premiumSearchForm).off('click', PremiumGiveaway.eSearchClear);
state.$premiumSearchForm.field('quantity').off('change', PremiumGiveaway.eQuantityChanged);
state.$premiumSearchForm.off('change', '.js-premium-options input.radio', PremiumGiveaway.eRadioChanged);
state.$giveawayPremiumForm.off('change', 'input.checkbox', PremiumGiveaway.eCheckboxChanged);
$('.js-preview-sticker').each(function() {
RLottie.destroy(this);
});
});
},
updateState: function() {
var now = +Date.now();
if (document.hasFocus() ||
Aj.state.updLastReq && (now - Aj.state.updLastReq) > Main.FORCE_UPDATE_PERIOD) {
Aj.state.updLastReq = now;
Aj.apiRequest('updatePremiumGiveawayState', {
mode: Aj.state.mode,
lv: Aj.state.lastVer,
dh: Aj.state.lastDh,
quantity: Aj.state.curQuantity
}, function(result) {
if (result.mode) {
Aj.state.mode = result.mode;
}
if (result.html) {
PremiumGiveaway.updateContent(result.html);
} else {
if (result.history_html) {
PremiumGiveaway.updateHistory(result.history_html);
}
if (result.options_html) {
PremiumGiveaway.updateOptions(result.options_html);
}
}
if (result.lv) {
Aj.state.lastVer = result.lv;
if (Aj.state.$sentPopup) {
closePopup(Aj.state.$sentPopup);
}
}
if (result.dh) {
Aj.state.lastDh = result.dh;
}
if (Aj.state.needUpdate && result.need_update) {
Aj.state.updStateTo = setTimeout(PremiumGiveaway.updateState, Main.UPDATE_PERIOD);
}
});
} else {
if (Aj.state.needUpdate) {
Aj.state.updStateTo = setTimeout(PremiumGiveaway.updateState, Main.CHECK_PERIOD);
}
}
},
eSearchInput: function(e) {
var $field = Aj.state.$premiumSearchField;
$('.js-search-field-error').html('');
$field.removeClass('error');
},
eSearchChange: function(e) {
PremiumGiveaway.searchSubmit();
},
eSearchClear: function(e) {
var $form = Aj.state.$premiumSearchForm;
var $field = Aj.state.$premiumSearchField;
var $btn = Aj.state.$giveawayPremiumBtn;
$form.field('recipient').value('');
$form.field('query').value('').prop('disabled', false);
$btn.prop('disabled', true);
$field.removeClass('found');
$('.js-search-field-error').html('');
$field.removeClass('error');
PremiumGiveaway.updateUrl();
},
eQuantityChanged: function() {
var $form = Aj.state.$premiumSearchForm;
var quantity = +$form.field('quantity').value();
Aj.state.$premiumQuantityField.addClass('loading').removeClass('play').redraw().addClass('play');
Aj.apiRequest('updatePremiumGiveawayPrices', {
quantity: quantity
}, function(result) {
var $form = Aj.state.$premiumSearchForm;
var $field = Aj.state.$premiumQuantityField;
var $btn = Aj.state.$giveawayPremiumBtn;
if (result.error) {
$('.js-quantity-field-error').html(result.error);
$field.addClass('error').removeClass('found');
quantity = 0;
} else {
$('.js-quantity-field-error').html('');
$field.removeClass('error');
}
$('.js-boost-value').html(result.boosts);
if (result.button_label) {
$('.js-prepay-premium-label').html(result.button_label);
}
if (result.options_html) {
PremiumGiveaway.updateOptions(result.options_html);
}
if (result.dh) {
Aj.state.lastDh = result.dh;
}
if (quantity > 0 && $form.field('recipient').value()) {
$btn.prop('disabled', false);
} else {
$btn.prop('disabled', true);
}
Aj.state.curQuantity = quantity;
PremiumGiveaway.updateUrl();
Aj.state.$premiumQuantityField.removeClass('loading');
});
},
eRadioChanged: function() {
PremiumGiveaway.updateUrl();
},
eSearchSubmit: function(e) {
e.preventDefault();
PremiumGiveaway.searchSubmit();
},
searchSubmit: function() {
var $form = Aj.state.$premiumSearchForm;
var recipient = $form.field('recipient').value();
var quantity = $form.field('quantity').value();
var query = $form.field('query').value();
var months = $form.field('months').value();
if (!query.length) {
$form.field('query').focus();
return;
}
Aj.state.$premiumSearchField.addClass('loading').removeClass('play').redraw().addClass('play');
Aj.showProgress();
Aj.apiRequest('searchPremiumGiveawayRecipient', {
query: recipient || query,
quantity: quantity,
months: months
}, function(result) {
Aj.hideProgress();
PremiumGiveaway.updateResult(result);
Aj.state.$premiumSearchField.removeClass('loading');
});
},
updateResult: function(result) {
var $form = Aj.state.$premiumSearchForm;
var $field = Aj.state.$premiumSearchField;
var $btn = Aj.state.$giveawayPremiumBtn;
if (result.error) {
$('.js-search-field-error').html(result.error);
$field.addClass('error').removeClass('found');
$form.field('query').prop('disabled', false);
} else {
$('.js-search-field-error').html('');
$field.removeClass('error');
if (result.found) {
if (result.found.photo) {
$('.js-premium-search-photo', $field).html(result.found.photo);
}
if (result.found.name) {
var $form = Aj.state.$premiumSearchForm;
$form.field('query').value(uncleanHTML(result.found.name));
}
$form.field('recipient').value(result.found.recipient);
$field.addClass('found');
$form.field('query').prop('disabled', true);
if (Aj.state.curQuantity > 0) {
$btn.prop('disabled', false);
} else {
$btn.prop('disabled', true);
}
} else {
$form.field('recipient').value('');
$field.removeClass('found');
$form.field('query').prop('disabled', false);
$btn.prop('disabled', true);
}
}
PremiumGiveaway.updateUrl();
},
updateUrl: function() {
var new_url = '';
var $form = Aj.state.$premiumSearchForm;
var recipient = $form.field('recipient').value();
var quantity = Aj.state.curQuantity;
var months = $form.field('months').value();
if (recipient) {
new_url += '&recipient=' + encodeURIComponent(recipient);
}
if (quantity) {
new_url += '&quantity=' + encodeURIComponent(quantity);
}
if (months) {
new_url += '&months=' + encodeURIComponent(months);
}
if (new_url) {
new_url = '?' + new_url.substr(1);
}
var loc = Aj.location(), path = loc.pathname + loc.search;
Aj.setLocation(new_url, path != '/premium/giveaway');
},
updateOptions: function(html) {
var $form = Aj.state.$premiumSearchForm;
var months = $form.field('months').value();
$('.js-premium-options').replaceWith(html);
$form.field('months').value(months);
},
updateHistory: function(html) {
$('.js-premium-history').replaceWith(html);
},
updateContent: function(html) {
$('.js-main-content').html(html).find('.js-preview-sticker').each(function() {
RLottie.init(this, {playUntilEnd: true});
});
},
eGiveawayPremium: function(e) {
e.stopImmediatePropagation();
e.preventDefault();
var $form = Aj.state.$premiumSearchForm;
var recipient = $form.field('recipient').value();
var quantity = $form.field('quantity').value();
var months = $form.field('months').value();
Aj.apiRequest('initGiveawayPremiumRequest', {
recipient: recipient,
quantity: quantity,
months: months
}, function(result) {
if (result.error) {
return showAlert(result.error);
}
$('.js-giveaway-premium-content', Aj.state.$giveawayPremiumPopup).html(result.content);
$('.js-giveaway-premium-button', Aj.state.$giveawayPremiumPopup).html(result.button);
Aj.state.giveawayPrice = result.amount;
Aj.state.itemTitle = result.item_title;
Aj.state.$giveawayPremiumForm.field('id').value(result.req_id);
RLottie.WORKERS_LIMIT = 1;
openPopup(Aj.state.$giveawayPremiumPopup, {
onOpen: function() {
$('.js-preview-sticker').each(function() {
RLottie.init(this, {playUntilEnd: true});
});
},
onClose: function() {
$('.js-preview-sticker').each(function() {
RLottie.destroy(this);
});
}
});
});
},
eGiveawayPremiumSubmit: function(e) {
e.preventDefault();
var $form = $(this);
var item_title = Aj.state.itemTitle;
var req_id = $form.field('id').value();
closePopup(Aj.state.$giveawayPremiumPopup);
QR.showPopup({
request: {
method: 'getGiveawayPremiumLink',
params: {
id: req_id
}
},
title: l('WEB_POPUP_QR_GIVEAWAY_HEADER'),
description: l('WEB_POPUP_QR_GIVEAWAY_TEXT', {
amount: '<span class="icon-before icon-ton-text js-amount_fee">' + Aj.state.giveawayPrice + '</span>'
}),
qr_label: item_title,
tk_label: l('WEB_POPUP_QR_GIVEAWAY_TK_BUTTON'),
terms_label: l('WEB_POPUP_QR_PROCEED_TERMS')
});
Aj.state.needUpdate = true;
},
eMoreGiveawayPremium: function(e) {
e.preventDefault();
e.stopImmediatePropagation();
Aj.apiRequest('repeatPremiumGiveaway', {}, function(result) {
if (result.error) {
return showAlert(result.error);
}
Aj.location('/premium/giveaway');
});
}
};
var QR = {
showPopup: function(options) {
options = $.extend({