Update content of files

This commit is contained in:
GitHub Action 2024-02-10 14:36:22 +00:00
parent 7bffacfd88
commit 9b4cbca9a5
63 changed files with 3659 additions and 3379 deletions

View file

@ -46,35 +46,36 @@
<p>Interactive <a href="/bots/webapps">HTML5 Mini Apps</a> on Telegram can completely replace <strong>any website</strong>. </p>
<p>They support <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">seamless authorization</a>, <a href="https://core.telegram.org/bots/payments">integrated payments</a> via multiple payment providers (with <em>Google Pay</em> and <em>Apple Pay</em> out of the box), delivering tailored push notifications to users, and <a href="https://core.telegram.org/bots">much more</a>.</p>
<p>This article offers a client-side overview of the implementation of bot mini apps using the MTProto API: see <a href="/bots/webapps">here for an overview of the mini-app side JS API &raquo;</a>. </p>
<h3><a class="anchor" name="outgoing-events-mini-app-to-client" href="#outgoing-events-mini-app-to-client"><i class="anchor-icon"></i></a>Outgoing events: Mini App to client</h3>
<p>Both <a href="#simple-web-apps">simple</a> and <a href="#normal-web-apps">normal</a> Mini Apps can <em>send</em> web events starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for the full list of events that can be <em>sent</em> by the Mini App to the client &raquo;</a>. </p>
<h3><a class="anchor" name="incoming-events-client-to-mini-app" href="#incoming-events-client-to-mini-app"><i class="anchor-icon"></i></a>Incoming events: Client to Mini App</h3>
<p>Mini Apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent(&quot;event_name&quot;, params)</code> method. </p>
<p>Here&#39;s the full list of events that can be <em>received</em> by a Mini App from the client, by calling the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" name="main-button-pressed" href="#main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>This article offers a client-side overview of the implementation of bot mini apps using the MTProto API: see <a href="/bots/webapps">here for an overview of the mini-app side JS API »</a>. </p>
<h3><a class="anchor" href="#outgoing-events-mini-app-to-client" id="outgoing-events-mini-app-to-client" name="outgoing-events-mini-app-to-client"><i class="anchor-icon"></i></a>Outgoing events: Mini App to client</h3>
<p>Mini Apps can <em>send</em> web events starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for the full list of events that can be <em>sent</em> by the Mini App to the client »</a>. </p>
<h3><a class="anchor" href="#incoming-events-client-to-mini-app" id="incoming-events-client-to-mini-app" name="incoming-events-client-to-mini-app"><i class="anchor-icon"></i></a>Incoming events: Client to Mini App</h3>
<p>Mini Apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent("event_name", params)</code> method. </p>
<p>Here's the full list of events that can be <em>received</em> by a Mini App from the client, if the client invokes the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" href="#main-button-pressed" id="main-button-pressed" name="main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the main button located at the bottom of the webview, handle this event only if the main button was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event &raquo;</a>.</p>
<h4><a class="anchor" name="settings-button-pressed" href="#settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
<p>Sent by the client when the user presses the main button located at the bottom of the webview, handle this event only if the main button was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event »</a>.</p>
<h4><a class="anchor" href="#back-button-pressed" id="back-button-pressed" name="back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the settings button, if it was previously enabled in <a href="https://t.me/BotFather">@BotFather</a>, as specified by the <code>has_settings</code> flag of <a href="/constructor/attachMenuBot">attachMenuBot &raquo;</a>. </p>
<h4><a class="anchor" name="back-button-pressed" href="#back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
<p>Sent by the client when the user presses the (OS or UI) back button, if it was <a href="/api/web-events#web-app-setup-back-button">previously enabled by a <code>web_app_setup_back_button</code> event »</a>.</p>
<h4><a class="anchor" href="#settings-button-pressed" id="settings-button-pressed" name="settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the (OS or UI) back button, if it was <a href="/api/web-events#web-app-setup-back-button">previously enabled by a <code>web_app_setup_back_button</code> event &raquo;</a>.</p>
<h4><a class="anchor" name="invoice-closed" href="#invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
<p>Sent by the client when the user presses the settings button, if it was <a href="/api/web-events#web-app-setup-settings-button">previously enabled by a <code>web_app_setup_settings_button</code> event »</a>.</p>
<h4><a class="anchor" href="#invoice-closed" id="invoice-closed" name="invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
<p>Params: JSON object with the following fields:</p>
<ul>
<li><code>slug</code> - Invoice identifier (string)</li>
<li><code>status</code> - One of the following values (string):<ul>
<li><code>cancelled</code> The user closed the invoice popup without paying, before the call to <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a>.</li>
<li><code>failed</code> The user tried to pay, but the payment failed: the call to <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> returned an RPC error and the popup was closed.</li>
<li><code>pending</code> The payment is still processing: the bot will receive a further service message about a successful payment. <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> was successfully invoked returning <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>, the user completed all additional verification forms returned by the method and the invoice popup was closed, but the client hasn&#39;t received a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message yet.<br>Note that eventual errors will not be sent as a <code>failed</code> event if the user fails additional validation (ie 3-D Secure) returned by <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>: the state will remaing <code>pending</code>. </li>
<li><code>paid</code> The invoice was paid successfully: the client completed the <a href="/api/payments">payment flow &raquo;</a>, the invoice popup was closed and a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message was received by the client.</li>
<li><code>pending</code> The payment is still processing: the bot will receive a further service message about a successful payment. <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> was successfully invoked returning <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>, the user completed all additional verification forms returned by the method and the invoice popup was closed, but the client hasn't received a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message yet.<br>
Note that eventual errors will not be sent as a <code>failed</code> event if the user fails additional validation (ie 3-D Secure) returned by <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>: the state will remaing <code>pending</code>. </li>
<li><code>paid</code> The invoice was paid successfully: the client completed the <a href="/api/payments">payment flow »</a>, the invoice popup was closed and a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message was received by the client.</li>
</ul>
</li>
</ul>
<p>Sent by the client to report the <a href="/api/payments">payment status</a> of an invoice obtained from a <a href="/api/web-events#web-app-open-invoice"><code>web_app_open_invoice</code> event &raquo;</a>. </p>
<h4><a class="anchor" name="viewport-changed" href="#viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
<p>Sent by the client to report the <a href="/api/payments">payment status</a> of an invoice obtained from a <a href="/api/web-events#web-app-open-invoice"><code>web_app_open_invoice</code> event »</a>. </p>
<h4><a class="anchor" href="#viewport-changed" id="viewport-changed" name="viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>height</code> - The current height of the visible area of the Mini App (excluding the bottom <a href="#main-button-pressed">main button</a>, if visible) (integer)</li>
@ -82,104 +83,14 @@
<li><code>is_expanded</code> - Whether the Mini App is expanded to its maximum height after the user swiped up or after the Mini App emitted a <a href="/api/web-events#web-app-expand">web_app_expand</a> event (boolean)</li>
</ul>
<p>Emitted when the viewport is changed. </p>
<h4><a class="anchor" name="theme-changed" href="#theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
<h4><a class="anchor" href="#theme-changed" id="theme-changed" name="theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>theme_params</code>: A <a href="#theme-parameters">theme parameters object &raquo;</a> (object)</li>
<li><code>theme_params</code> - A <a href="#theme-parameters">theme parameters object »</a> (object)</li>
</ul>
<p>Emitted when requested by the Mini App using a <a href="/api/web-events#web-app-request-theme"><code>web_app_request_theme</code> event &raquo;</a>, or when the app theme changes. </p>
<h4><a class="anchor" name="popup-closed" href="#popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web-app-open-popup"><code>web_app_open_popup</code> event &raquo;</a>. </p>
<h3><a class="anchor" name="simple-mini-apps" href="#simple-mini-apps"><i class="anchor-icon"></i></a>Simple Mini Apps</h3>
<p>Schema:</p>
<pre><code>replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector&lt;KeyboardButtonRow&gt; placeholder:flags.3?string = ReplyMarkup;
keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
simpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult;
---functions---
messages.requestSimpleWebView#299bec8e flags:# from_switch_webview:flags.1?true bot:InputUser url:string theme_params:flags.0?DataJSON platform:string = SimpleWebViewResult;
messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;</code></pre>
<p>Simple Mini Apps can only send data back to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event &raquo;</a>. </p>
<p>Simple Mini Apps can be opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> button contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, or by clicking on the <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button on top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
<p>To open them, users should call <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the original <code>url</code>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>If and only if the Mini App was opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> reply keyboard button, upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event &raquo;</a> from the Mini App, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
<ul>
<li><code>bot</code> - Bot ID</li>
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple Mini App</li>
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
</ul>
<p>Always ignore all <code>web_app_data_send</code> events received from <a href="/constructor/inlineBotWebView">inlineBotWebView</a> Mini Apps, as only <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> Mini Apps can send this event.</p>
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once. The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
<h3><a class="anchor" name="normal-mini-apps" href="#normal-mini-apps"><i class="anchor-icon"></i></a>Normal Mini Apps</h3>
<p>Schema:</p>
<pre><code>keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
botMenuButton#c7b57ce6 text:string url:string = BotMenuButton;
webViewResultUrl#c14557c query_id:long url:string = WebViewResult;
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;
updateWebViewResultSent#1592b79d query_id:long = Update;
webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;
---functions---
messages.requestWebView#178b480b flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = WebViewResult;
messages.prolongWebView#7ff34309 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = Bool;
messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;</code></pre>
<p>Normal Mini Apps work similarly to <a href="/api/bots/inline">inline bots &raquo;</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>Normal Mini Apps can be opened from:</p>
<ul>
<li>A <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor: in this case, <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>url</code>.</li>
<li>A <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button &raquo;</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set.</li>
<li>An <a href="/api/bots/attach">attachment menu &raquo;</a>: in this case, no special flag should be set, unless the attachment menu is opened via a with a <a href="/api/links#bot-attachment-menu-links">bot attachment menu deep link</a>, in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code>, if present.</li>
</ul>
<p>To open them, clients should call <a href="/method/messages.requestWebView">messages.requestWebView</a>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds: if the method call returns <code>QUERY_ID_INVALID</code>, the webview must be closed. </p>
<p>The opened URL&#39;s fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot Mini Apps JS library</a>: this <code>query_id</code> can then be used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p>
<h3><a class="anchor" name="named-bot-mini-apps" href="#named-bot-mini-apps"><i class="anchor-icon"></i></a>Named bot Mini Apps</h3>
<p>Schema:</p>
<pre><code>inputBotAppID#a920bd7a id:long access_hash:long = InputBotApp;
inputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp;
botAppNotModified#5da674b7 = BotApp;
botApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp;
messages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true app:BotApp = messages.BotApp;
appWebViewResultUrl#3c1b4f0d url:string = AppWebViewResult;
---functions---
messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;
messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult;</code></pre>
<p>Another way to open Mini Apps is by using <a href="/api/links#named-bot-web-app-links">named bot Mini App links &raquo;</a>. </p>
<p>These links are different from <a href="/api/links#bot-attachment-menu-links">bot attachment menu deep links &raquo;</a>, because they don&#39;t require the user to install an attachment menu, and a single bot can offer multiple Mini Apps, distinguished by their <code>short_name</code>. </p>
<p>These links should be handled as follows:<br><em> Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then
</em> Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.<br> If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.<br><em> If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned and its <code>request_write_access</code> flag is set, show a prompt to the user, indicating that the bot is asking permission to send messages to the user.<br> If the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> in the next step.
</em> If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the Mini App by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned.<br> <em> If the client has clicked on the link in a Telegram chat, pass the chat&#39;s peer information into <code>peer</code>; otherwise pass the bot&#39;s peer information, instead.
</em> If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, <strong>ask confirmation from the user</strong> before opening the Mini App; the <code>request_write_access</code> checkbox should be shown in this prompt, if needed.<br> Confirmation should <strong>always</strong> be asked, even if the <code>inactive</code> flag is not set, when opening the link from places where the full link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.).<br> <em> If the <code>startapp</code> query string parameter is present, pass it to <code>start_param</code> when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.
</em> If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>request_write_access</code> flag is set, the bot is asking permission to send messages to the user: if the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
<p>Finally, open the webview using the <code>url</code> contained in the returned <a href="/constructor/appWebViewResultUrl">appWebViewResultUrl</a>. </p>
<p>Since there is no linked inline query, <code>web_app_data_send</code> events must be ignored.<br>The bot can, however, write to the user directly if it already has a chat with the user or if it requested permission via <code>request_write_access</code> and the user granted it with <code>write_allowed</code>. </p>
<h3><a class="anchor" name="theme-parameters" href="#theme-parameters"><i class="anchor-icon"></i></a>Theme parameters</h3>
<p>Bot Mini Apps can be themed according to the following theme parameters, passed as a JSON object to the <code>theme_params</code> parameter of the <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and <a href="/method/messages.requestWebView">messages.requestWebView</a> methods. </p>
<p>Emitted when requested by the Mini App using a <a href="/api/web-events#web-app-request-theme"><code>web_app_request_theme</code> event »</a>, or when the app theme changes. </p>
<h5><a class="anchor" href="#theme-parameters" id="theme-parameters" name="theme-parameters"><i class="anchor-icon"></i></a>Theme parameters</h5>
<p>Bot Mini Apps can be themed according to the following theme parameters, passed as a JSON object to the <code>theme_params</code> parameter of the <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, <a href="/method/messages.requestWebView">messages.requestWebView</a> and <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> methods. </p>
<p>This JSON object has the following keys, containing color theme information (hex string, RGB, no alpha) to pass to the Mini App:</p>
<ul>
<li><code>bg_color</code> - Background color</li>
@ -189,8 +100,201 @@ messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:Inpu
<li><code>link_color</code> - Link color</li>
<li><code>button_color</code> - Button color</li>
<li><code>button_text_color</code> - Button text color</li>
<li><code>header_bg_color</code> - Header background color</li>
<li><code>accent_text_color</code> - Accent text color</li>
<li><code>section_bg_color</code> - Section background color</li>
<li><code>section_header_text_color</code> - Section header text color</li>
<li><code>subtitle_text_color</code> - Sub title text color</li>
<li><code>destructive_text_color</code> - Text color for destructive action buttons in prompts</li>
</ul>
</div>
<h4><a class="anchor" href="#popup-closed" id="popup-closed" name="popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web-app-open-popup"><code>web_app_open_popup</code> event »</a>. </p>
<h4><a class="anchor" href="#write-access-requested" id="write-access-requested" name="write-access-requested"><i class="anchor-icon"></i></a><code>write_access_requested</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>status</code> - <code>allowed</code> or <code>cancelled</code></li>
</ul>
<p>Used by clients to reply to a <a href="/api/web-events#web-app-request-write-access"><code>web_app_request_write_access</code> event »</a>, indicating whether the user has allowed the bot to send messages to the user (<code>allowed</code>) or not (<code>cancelled</code>). </p>
<h4><a class="anchor" href="#phone-requested" id="phone-requested" name="phone-requested"><i class="anchor-icon"></i></a><code>phone_requested</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>status</code> - <code>sent</code> or <code>cancelled</code></li>
</ul>
<p>Used by clients to reply to a <a href="/api/web-events#web-app-request-phone"><code>web_app_request_phone</code> event »</a>, indicating whether the user has shared their phone number with the bot (<code>allowed</code>) or not (<code>cancelled</code>). </p>
<h4><a class="anchor" href="#custom-method-invoked" id="custom-method-invoked" name="custom-method-invoked"><i class="anchor-icon"></i></a><code>custom_method_invoked</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_invoke_custom_method</code> request</li>
<li><code>result</code> - The JSON data contained in the response of the <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> method, if the method call succeeded</li>
<li><code>error</code> - The text of the RPC error, if the method call failed</li>
</ul>
<p>Used by clients to reply to <a href="/api/web-events#web-app-invoke-custom-method"><code>web_app_invoke_custom_method</code> events »</a>. </p>
<h4><a class="anchor" href="#clipboard-text-received" id="clipboard-text-received" name="clipboard-text-received"><i class="anchor-icon"></i></a><code>clipboard_text_received</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_read_text_from_clipboard</code> request</li>
<li><code>data</code> - A string with the clipboard contents (optional, if not provided consider the request failed)</li>
</ul>
<p>Used by clients to reply to <a href="/api/web-events#web-app-read-text-from-clipboard"><code>web_app_read_text_from_clipboard</code> events »</a>. </p>
<h4><a class="anchor" href="#qr-text-received" id="qr-text-received" name="qr-text-received"><i class="anchor-icon"></i></a><code>qr_text_received</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>data</code> - string with the contents of a scanned QR code.</li>
</ul>
<p>Emitted by clients if a new QR code was scanned by the native QR code scanner opened with a <a href="/api/web-events#web-app-open-scan-qr-popup"><code>web_app_open_scan_qr_popup</code> event »</a>. </p>
<h4><a class="anchor" href="#scan-qr-popup-closed" id="scan-qr-popup-closed" name="scan-qr-popup-closed"><i class="anchor-icon"></i></a><code>scan_qr_popup_closed</code></h4>
<p>Params: <code>null</code> or an empty object</p>
<p>Emitted by clients if the QR code scanner popup opened with a <a href="/api/web-events#web-app-open-scan-qr-popup"><code>web_app_open_scan_qr_popup</code> event »</a> was closed by the user or failed to open altogether due to permission issues. </p>
<h3><a class="anchor" href="#keyboard-button-mini-apps" id="keyboard-button-mini-apps" name="keyboard-button-mini-apps"><i class="anchor-icon"></i></a>Keyboard Button Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/replyKeyboardMarkup'>replyKeyboardMarkup</a>#85dd99d1 flags:<a href='/type/%23'>#</a> resize:flags.0?<a href='/constructor/true'>true</a> single_use:flags.1?<a href='/constructor/true'>true</a> selective:flags.2?<a href='/constructor/true'>true</a> persistent:flags.4?<a href='/constructor/true'>true</a> rows:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/KeyboardButtonRow'>KeyboardButtonRow</a>&gt; placeholder:flags.3?<a href='/type/string'>string</a> = <a href='/type/ReplyMarkup'>ReplyMarkup</a>;
<a href='/constructor/keyboardButtonSimpleWebView'>keyboardButtonSimpleWebView</a>#a0c0505c text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/KeyboardButton'>KeyboardButton</a>;
<a href='/constructor/messageActionWebViewDataSentMe'>messageActionWebViewDataSentMe</a>#47dd8079 text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/MessageAction'>MessageAction</a>;
<a href='/constructor/messageActionWebViewDataSent'>messageActionWebViewDataSent</a>#b4c38cb5 text:<a href='/type/string'>string</a> = <a href='/type/MessageAction'>MessageAction</a>;
<a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
<a href='/method/messages.sendWebViewData'>messages.sendWebViewData</a>#dc0242c8 bot:<a href='/type/InputUser'>InputUser</a> random_id:<a href='/type/long'>long</a> button_text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Keyboard Button Mini Apps should be opened when the user clicks a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, by invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the button's <code>url</code> to the <code>url</code> parameter. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Keyboard Button Mini Apps can send data back to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a>. </p>
<p>Upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a> <strong>only</strong> from Keyboard Button Mini Apps, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
<ul>
<li><code>bot</code> - Bot ID</li>
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple Mini App</li>
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
</ul>
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once. The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
<h3><a class="anchor" href="#inline-button-mini-apps" id="inline-button-mini-apps" name="inline-button-mini-apps"><i class="anchor-icon"></i></a>Inline button Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/keyboardButtonWebView'>keyboardButtonWebView</a>#13767230 text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/KeyboardButton'>KeyboardButton</a>;
<a href='/constructor/webViewResultUrl'>webViewResultUrl</a>#c14557c query_id:<a href='/type/long'>long</a> url:<a href='/type/string'>string</a> = <a href='/type/WebViewResult'>WebViewResult</a>;
<a href='/constructor/inputBotInlineResult'>inputBotInlineResult</a>#88bf9319 flags:<a href='/type/%23'>#</a> id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> title:flags.1?<a href='/type/string'>string</a> description:flags.2?<a href='/type/string'>string</a> url:flags.3?<a href='/type/string'>string</a> thumb:flags.4?<a href='/type/InputWebDocument'>InputWebDocument</a> content:flags.5?<a href='/type/InputWebDocument'>InputWebDocument</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultPhoto'>inputBotInlineResultPhoto</a>#a8d864a7 id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> photo:<a href='/type/InputPhoto'>InputPhoto</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultDocument'>inputBotInlineResultDocument</a>#fff8fdc4 flags:<a href='/type/%23'>#</a> id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> title:flags.1?<a href='/type/string'>string</a> description:flags.2?<a href='/type/string'>string</a> document:<a href='/type/InputDocument'>InputDocument</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultGame'>inputBotInlineResultGame</a>#4fa417f2 id:<a href='/type/string'>string</a> short_name:<a href='/type/string'>string</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/updateWebViewResultSent'>updateWebViewResultSent</a>#1592b79d query_id:<a href='/type/long'>long</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/webViewMessageSent'>webViewMessageSent</a>#c94511c flags:<a href='/type/%23'>#</a> msg_id:flags.0?<a href='/type/InputBotInlineMessageID'>InputBotInlineMessageID</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;
---functions---
<a href='/method/messages.requestWebView'>messages.requestWebView</a>#269dc2c1 flags:<a href='/type/%23'>#</a> from_bot_menu:flags.4?<a href='/constructor/true'>true</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.1?<a href='/type/string'>string</a> start_param:flags.3?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/WebViewResult'>WebViewResult</a>;
<a href='/method/messages.prolongWebView'>messages.prolongWebView</a>#b0d81a83 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> query_id:<a href='/type/long'>long</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.sendWebViewResultMessage'>messages.sendWebViewResultMessage</a>#a4314f5 bot_query_id:<a href='/type/string'>string</a> result:<a href='/type/InputBotInlineResult'>InputBotInlineResult</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;</code></pre>
<p>Inline Button Mini Apps work similarly to <a href="/api/bots/inline">inline bots »</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>When the user clicks on an <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> inline button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor, <a href="/method/messages.requestWebView">messages.requestWebView</a> should be invoked, passing <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to the method's <code>url</code> parameter. </p>
<p>Then, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds: if the method call returns <code>QUERY_ID_INVALID</code>, the webview must be closed. </p>
<p>The opened URL's fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot Mini Apps JS library</a>: this <code>query_id</code> can then be passed to the bot (within the Mini App itself, for example via an AJAX query or form submission to the server hosting the Mini App and the bot) and then used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p>
<h3><a class="anchor" href="#menu-button-mini-apps" id="menu-button-mini-apps" name="menu-button-mini-apps"><i class="anchor-icon"></i></a>Menu button Mini Apps</h3>
<p>Menu button Mini Apps work similarly to <a href="#inline-button-mini-apps">inline button Mini Apps »</a>: they send messages on behalf of the user to the chat from where the <a href="/api/bots/menu">bot menu button »</a> was clicked. </p>
<p>Menu button Mini Apps can be opened from a <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button »</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set, and the <a href="/constructor/botMenuButton">botMenuButton</a>.<code>url</code> field must be passed to the method's <code>url</code> parameter. </p>
<p>The full flow is identical to the flow for <a href="#inline-button-mini-apps">inline button Mini Apps »</a>, apart from the different flags passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>, as described above.</p>
<h3><a class="anchor" href="#attachment-menu-mini-apps" id="attachment-menu-mini-apps" name="attachment-menu-mini-apps"><i class="anchor-icon"></i></a>Attachment menu Mini Apps</h3>
<p>Attachment menu Mini Apps work similarly to <a href="#inline-button-mini-apps">inline button Mini Apps »</a>: they send messages on behalf of the user to the chat where the bot's <a href="/api/bots/attach">attachment menu »</a> was opened. </p>
<p>Attachment menu Mini Apps can be opened from an <a href="/api/bots/attach">attachment menu entry »</a>: in this case, no special flag should be set when invoking <a href="/method/messages.requestWebView">messages.requestWebView</a>. </p>
<p>Attachment menu Mini Apps can also be opened from a <a href="/api/links#bot-attachment-or-side-menu-links">bot attachment menu deep link</a>, in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code>, if present.</p>
<p>The full flow is identical to the flow for <a href="#inline-button-mini-apps">inline button Mini Apps »</a>, apart from the different flags passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>, as described above.</p>
<h3><a class="anchor" href="#inline-mode-mini-apps" id="inline-mode-mini-apps" name="inline-mode-mini-apps"><i class="anchor-icon"></i></a>Inline mode Mini Apps</h3>
<pre><code><a href='/constructor/messages.botResults'>messages.botResults</a>#e021f2f6 flags:<a href='/type/%23'>#</a> gallery:flags.0?<a href='/constructor/true'>true</a> query_id:<a href='/type/long'>long</a> next_offset:flags.1?<a href='/type/string'>string</a> switch_pm:flags.2?<a href='/type/InlineBotSwitchPM'>InlineBotSwitchPM</a> switch_webview:flags.3?<a href='/type/InlineBotWebView'>InlineBotWebView</a> results:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInlineResult'>BotInlineResult</a>&gt; cache_time:<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/messages.BotResults'>messages.BotResults</a>;
<a href='/constructor/inlineBotWebView'>inlineBotWebView</a>#b57295d5 text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/InlineBotWebView'>InlineBotWebView</a>;
<a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.getInlineBotResults'>messages.getInlineBotResults</a>#514e999d flags:<a href='/type/%23'>#</a> bot:<a href='/type/InputUser'>InputUser</a> peer:<a href='/type/InputPeer'>InputPeer</a> geo_point:flags.0?<a href='/type/InputGeoPoint'>InputGeoPoint</a> query:<a href='/type/string'>string</a> offset:<a href='/type/string'>string</a> = <a href='/type/messages.BotResults'>messages.BotResults</a>;
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;</code></pre>
<p>Not to be confused with <a href="#inline-button-mini-apps">inline button mini apps »</a>. </p>
<p>Inline mode Mini Apps can be used to generate a custom set of inline results in response to a user's <a href="/api/bots/inline">inline query »</a> via a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a>. </p>
<p>Inline mode Mini Apps can be opened by clicking on an <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button returned at the top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
<p>Pass the <code>url</code> to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, while also setting the <code>from_switch_webview</code> flag. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Once the user has finished making their choices in the Mini App, a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a> should be emitted, containing a JSON object with the following fields:</p>
<ul>
<li><code>query</code> - The inline query that will be inserted in the chat's input field, after the bot's username.<br>
May be an empty string, in which case just the bot's username will be inserted, triggering an empty inline query.</li>
<li><code>chat_types</code> - An array of strings, containing a combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code>.<br>
If non-empty, the client should prompt the user to choose a specific chat of the specified type(s), then open the chosen chat and inserts the bot's username and the specified inline query in the input field.<br>
The array values specify which types of chats the user will be able to choose from.<br>
If empty, the current chat is used. </li>
</ul>
<p>Upon receiving a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a> from the Mini App, the client should <a href="/api/bots/inline">make a new inline query »</a> to the same bot, with the newly specified <code>query</code>, either in the current chat or in the newly chosen chat, as specified by the <code>chat_types</code> field. </p>
<h3><a class="anchor" href="#side-menu-mini-apps" id="side-menu-mini-apps" name="side-menu-mini-apps"><i class="anchor-icon"></i></a>Side menu Mini Apps</h3>
<pre><code><a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;</code></pre>
<p>Side menu Mini Apps can be opened by clicking on the installed <a href="/api/bots/attach">side menu entry »</a>. </p>
<p>This action must trigger a <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> query with the <code>from_side_menu</code> flag set: clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Side menu Mini Apps can also be opened by clicking on a <a href="/api/links#mini-app-links">Mini App link »</a>: in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>.<code>start_param</code>, if present; note that in this case, the app should be opened (with an <a href="/api/bots/attach">installation prompt »</a> before, if not already installed) even if the client is minimized. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<h3><a class="anchor" href="#direct-link-mini-apps" id="direct-link-mini-apps" name="direct-link-mini-apps"><i class="anchor-icon"></i></a>Direct Link Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/inputBotAppID'>inputBotAppID</a>#a920bd7a id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputBotApp'>InputBotApp</a>;
<a href='/constructor/inputBotAppShortName'>inputBotAppShortName</a>#908c0407 bot_id:<a href='/type/InputUser'>InputUser</a> short_name:<a href='/type/string'>string</a> = <a href='/type/InputBotApp'>InputBotApp</a>;
<a href='/constructor/botAppNotModified'>botAppNotModified</a>#5da674b7 = <a href='/type/BotApp'>BotApp</a>;
<a href='/constructor/botApp'>botApp</a>#95fcd1d6 flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> short_name:<a href='/type/string'>string</a> title:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> photo:<a href='/type/Photo'>Photo</a> document:flags.0?<a href='/type/Document'>Document</a> hash:<a href='/type/long'>long</a> = <a href='/type/BotApp'>BotApp</a>;
<a href='/constructor/messages.botApp'>messages.botApp</a>#eb50adf5 flags:<a href='/type/%23'>#</a> inactive:flags.0?<a href='/constructor/true'>true</a> request_write_access:flags.1?<a href='/constructor/true'>true</a> has_settings:flags.2?<a href='/constructor/true'>true</a> app:<a href='/type/BotApp'>BotApp</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
<a href='/constructor/appWebViewResultUrl'>appWebViewResultUrl</a>#3c1b4f0d url:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;
---functions---
<a href='/method/messages.getBotApp'>messages.getBotApp</a>#34fdc5c3 app:<a href='/type/InputBotApp'>InputBotApp</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
<a href='/method/messages.requestAppWebView'>messages.requestAppWebView</a>#8c5a3b3c flags:<a href='/type/%23'>#</a> write_allowed:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> app:<a href='/type/InputBotApp'>InputBotApp</a> start_param:flags.1?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;</code></pre>
<p>Another way to open Mini Apps is by using <a href="/api/links#direct-mini-app-links">Direct Mini App links »</a>. </p>
<p>These links are different from all other Mini App links, because they don't require the user to install an attachment menu, and a single bot can offer multiple Mini Apps, distinguished by their <code>short_name</code>. </p>
<p>These links should be handled as follows: </p>
<ul>
<li>
<p>Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then</p>
</li>
<li>
<p>Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.
If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.</p>
</li>
<li>
<p>If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the Mini App by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned. </p>
<ul>
<li>
<p>If the client has clicked on the link in a Telegram chat, pass the chat's peer information into <code>peer</code>; otherwise pass the bot's peer information, instead.</p>
</li>
<li>
<p>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>request_write_access</code> flag is set, the bot is asking permission to send messages to the user: <strong>ask confirmation from the user</strong> with a prompt and a checkbox, and if the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
</li>
<li>
<p>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, <strong>ask confirmation from the user</strong> before opening the Mini App; the <code>request_write_access</code> checkbox should be shown in this prompt, if needed.<br>
Confirmation should <strong>always</strong> be asked, even if the <code>inactive</code> flag is not set, when opening the link from places where the full link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<p>Don't use two prompts if confirmation to open the Mini App is required <em>and</em> <code>request_write_access</code> is set, use just one prompt with an optional checkbox for <code>request_write_access</code>. </p>
</li>
<li>
<p>If the <code>startapp</code> query string parameter is present, pass it to <code>start_param</code> when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
</li>
</ul>
</li>
</ul>
<p>Finally, open the webview using the <code>url</code> contained in the returned <a href="/constructor/appWebViewResultUrl">appWebViewResultUrl</a>.</p></div>
</div>

View file

@ -181,12 +181,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"qr_login_code": "primary",
"dialog_filters_enabled": true,
"dialog_filters_tooltip": true,
"autoarchive_setting_available": false,
"autoarchive_setting_available": true,
"pending_suggestions": [
"AUTOARCHIVE_POPULAR",
"VALIDATE_PASSWORD",
"VALIDATE_PHONE_NUMBER",
"NEWCOMER_TICKS"
"NEWCOMER_TICKS",
"SETUP_PASSWORD"
],
"autologin_domains": [
"instantview.telegram.org",
@ -203,7 +204,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"diameter": 384,
"video_bitrate": 1000,
"audio_bitrate": 64,
"max_size": 12582912
"max_size": 16777216
},
"chat_read_mark_expire_period": 604800,
"chat_read_mark_size_threshold": 100,
@ -219,7 +220,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"stickers_faved_limit_default": 5,
"stickers_faved_limit_premium": 10,
"dialog_filters_limit_default": 10,
"dialog_filters_limit_premium": 20,
"dialog_filters_limit_premium": 30,
"dialog_filters_chats_limit_default": 100,
"dialog_filters_chats_limit_premium": 200,
"dialogs_pinned_limit_default": 5,
@ -242,12 +243,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"reactions_in_chat_max": 100,
"default_emoji_statuses_stickerset_id": "773947703670341676",
"premium_promo_order": [
"stories",
"more_upload",
"double_limits",
"voice_to_text",
"faster_download",
"translations",
"animated_emoji",
"more_upload",
"emoji_status",
"profile_badge",
"advanced_chat_management",
@ -255,7 +257,9 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"app_icons",
"infinite_reactions",
"animated_userpics",
"premium_stickers"
"premium_stickers",
"wallpapers",
"peer_colors"
],
"premium_bot_username": "PremiumBot",
"whitelisted_domains": [
@ -264,7 +268,8 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"telegram.org",
"t.me",
"telesco.pe",
"fragment.com"
"fragment.com",
"translations.telegram.org"
],
"topics_pinned_limit": 5,
"telegram_antispam_user_id": "5434988373",
@ -281,7 +286,46 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"chatlists_joined_limit_premium": 20,
"chatlist_update_period": 300,
"small_queue_max_active_operations_count": 5,
"large_queue_max_active_operations_count": 2
"large_queue_max_active_operations_count": 2,
"story_viewers_expire_period": 86400,
"story_expiring_limit_default": 3,
"story_expiring_limit_premium": 100,
"story_caption_length_limit_premium": 2048,
"story_caption_length_limit_default": 200,
"stories_posting": "enabled",
"stories_stealth_past_period": 300,
"stories_stealth_future_period": 1500,
"stories_stealth_cooldown_period": 10800,
"stories_sent_weekly_limit_default": 7,
"stories_sent_weekly_limit_premium": 700,
"stories_sent_monthly_limit_default": 30,
"stories_sent_monthly_limit_premium": 3000,
"stories_venue_search_username": "foursquare",
"stories_entities": "premium",
"stories_changelog_user_id": 777000,
"authorization_autoconfirm_period": 604800,
"stories_suggested_reactions_limit_default": 1,
"stories_suggested_reactions_limit_premium": 5,
"giveaway_gifts_purchase_available": true,
"giveaway_add_peers_max": 10,
"giveaway_countries_max": 10,
"giveaway_boosts_per_premium": 4,
"giveaway_period_max": 2678400,
"boosts_channel_level_max": 100,
"boosts_per_sent_gift": 3,
"quote_length_max": 1024,
"transcribe_audio_trial_weekly_number": 2,
"transcribe_audio_trial_duration_max": 300,
"recommended_channels_limit_default": 10,
"recommended_channels_limit_premium": 100,
"channel_bg_icon_level_min": 4,
"channel_profile_bg_icon_level_min": 7,
"channel_emoji_status_level_min": 8,
"channel_wallpaper_level_min": 9,
"channel_custom_wallpaper_level_min": 10,
"saved_dialogs_pinned_limit_default": 5,
"saved_dialogs_pinned_limit_premium": 100,
"pm_read_date_expire_period": 604800
}</code></pre>
<p>Typical fields included in the resulting JSON object are: </p>
<h4><a class="anchor" href="#emojies-animated-zoom" id="emojies-animated-zoom" name="emojies-animated-zoom"><i class="anchor-icon"></i></a><code>emojies_animated_zoom</code></h4>
@ -333,14 +377,16 @@ When fetching the admin list of a supergroup using <a href="/method/channels.get
<p>A list of Telegram domains that support automatic login with no user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
<h4><a class="anchor" href="#whitelisted-domains" id="whitelisted-domains" name="whitelisted-domains"><i class="anchor-icon"></i></a><code>whitelisted_domains</code></h4>
<p>A list of Telegram domains that can always be opened without additional user confirmation, when clicking on in-app links where the URL is not fully displayed (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> entities). (array of strings)</p>
<p>Note that when opening <a href="/api/links#named-bot-web-app-links">named bot web app links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/&lt;bot_username&gt;/&lt;short_name&gt;?startapp=&lt;start_parameter&gt;</code>, where <code>t.me</code> is whitelisted). </p>
<p>Confirmation should <strong>always</strong> be asked, even if we already opened the <a href="/api/links#named-bot-web-app-links">named bot web app</a> before, if the link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<p>Note that when opening <a href="/api/links#direct-mini-app-links">direct Mini App links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/&lt;bot_username&gt;/&lt;short_name&gt;?startapp=&lt;start_parameter&gt;</code>, where <code>t.me</code> is whitelisted). </p>
<p>Confirmation should <strong>always</strong> be asked, even if we already opened the <a href="/api/links#direct-mini-app-links">direct Mini App</a> before, if the link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<h4><a class="anchor" href="#round-video-encoding" id="round-video-encoding" name="round-video-encoding"><i class="anchor-icon"></i></a><code>round_video_encoding</code></h4>
<p>Contains a set of recommended codec parameters for round videos. (object, as described in the example)</p>
<h4><a class="anchor" href="#chat-read-mark-size-threshold" id="chat-read-mark-size-threshold" name="chat-read-mark-size-threshold"><i class="anchor-icon"></i></a><code>chat_read_mark_size_threshold</code></h4>
<p>Per-user read receipts, fetchable using <a href="/method/messages.getMessageReadParticipants">messages.getMessageReadParticipants</a>, will be available in groups with an amount of participants less or equal to <code>chat_read_mark_size_threshold</code>. (integer)</p>
<h4><a class="anchor" href="#chat-read-mark-expire-period" id="chat-read-mark-expire-period" name="chat-read-mark-expire-period"><i class="anchor-icon"></i></a><code>chat_read_mark_expire_period</code></h4>
<p>To protect user privacy, read receipts are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (integer)</p>
<p>To protect user privacy, read receipts for chats are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (integer)</p>
<h4><a class="anchor" href="#pm-read-date-expire-period" id="pm-read-date-expire-period" name="pm-read-date-expire-period"><i class="anchor-icon"></i></a><code>pm_read_date_expire_period</code></h4>
<p>To protect user privacy, read receipts for private chats are only stored for <code>pm_read_date_expire_period</code> seconds after the message was sent. (integer)</p>
<h4><a class="anchor" href="#groupcall-video-participants-max" id="groupcall-video-participants-max" name="groupcall-video-participants-max"><i class="anchor-icon"></i></a><code>groupcall_video_participants_max</code></h4>
<p>Maximum number of participants in a group call (livestreams allow ∞ participants) (integer)</p>
<h4><a class="anchor" href="#reactions-uniq-max" id="reactions-uniq-max" name="reactions-uniq-max"><i class="anchor-icon"></i></a><code>reactions_uniq_max</code></h4>
@ -403,7 +449,7 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#caption-length-limit-default" id="caption-length-limit-default" name="caption-length-limit-default"><i class="anchor-icon"></i></a><code>caption_length_limit_default</code></h4>
<p>The maximum UTF-8 length of media captions sendable by non-<a href="/api/premium">Premium</a> users (integer)</p>
<h4><a class="anchor" href="#caption-length-limit-premium" id="caption-length-limit-premium" name="caption-length-limit-premium"><i class="anchor-icon"></i></a><code>caption_length_limit_premium</code></h4>
<p>The maximum UTF-8 length of media captions sendable by non-<a href="/api/premium">Premium</a> users (integer)</p>
<p>The maximum UTF-8 length of media captions sendable by <a href="/api/premium">Premium</a> users (integer)</p>
<h4><a class="anchor" href="#upload-max-fileparts-default" id="upload-max-fileparts-default" name="upload-max-fileparts-default"><i class="anchor-icon"></i></a><code>upload_max_fileparts_default</code></h4>
<p>The maximum number of file parts uploadable by non-<a href="/api/premium">Premium</a> users (integer, the maximum file size can be extrapolated by multiplying this value by <code>524288</code>, the biggest possible chunk size)</p>
<h4><a class="anchor" href="#upload-max-fileparts-premium" id="upload-max-fileparts-premium" name="upload-max-fileparts-premium"><i class="anchor-icon"></i></a><code>upload_max_fileparts_premium</code></h4>
@ -436,6 +482,90 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files smaller than 20MB. (integer)</p>
<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>
<p>An <a href="/api/auth#confirming-login">unconfirmed session »</a> will be autoconfirmed this many seconds after login. (integer)</p>
<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 <a href="/api/stories">stories</a> for non-<a href="/api/premium">Premium</a> users (integer).</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>
<p>The maximum number of active <a href="/api/stories">stories</a> for <a href="/api/premium">Premium</a> users (integer).</p>
<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>
<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>
<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>
<ul>
<li><code>enabled</code> - Any user can post stories.</li>
<li><code>premium</code> - Only users with a <a href="/api/premium">Premium</a> subscription can post stories.</li>
<li><code>disabled</code> - Users can't post stories.</li>
</ul>
<h4><a class="anchor" href="#stories-stealth-past-period" id="stories-stealth-past-period" name="stories-stealth-past-period"><i class="anchor-icon"></i></a><code>stories_stealth_past_period</code></h4>
<p>Enabling <a href="/api/stories#stealth-mode">stories stealth mode</a> with the <code>past</code> flag will erase views of any story opened in the past <code>stories_stealth_past_period</code> seconds. (integer)</p>
<h4><a class="anchor" href="#stories-stealth-future-period" id="stories-stealth-future-period" name="stories-stealth-future-period"><i class="anchor-icon"></i></a><code>stories_stealth_future_period</code></h4>
<p>Enabling <a href="/api/stories#stealth-mode">stories stealth mode</a> with the <code>future</code> flag will hide views of any story opened in the next <code>stories_stealth_future_period</code> seconds. (integer)</p>
<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-suggested-reactions-limit-default" id="stories-suggested-reactions-limit-default" name="stories-suggested-reactions-limit-default"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_default</code></h4>
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-suggested-reactions-limit-premium" id="stories-suggested-reactions-limit-premium" name="stories-suggested-reactions-limit-premium"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_premium</code></h4>
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story 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-changelog-user-id" id="stories-changelog-user-id" name="stories-changelog-user-id"><i class="anchor-icon"></i></a><code>stories_changelog_user_id</code></h4>
<p>ID of the official Telegram user that will post stories about new Telegram features: stories posted by this user should be shown on the <a href="/api/stories#watching-stories">active or active and hidden stories bar</a> just like for contacts, even if the user was removed from the contact list. (integer, defaults to <code>777000</code>)</p>
<h4><a class="anchor" href="#stories-entities" id="stories-entities" name="stories-entities"><i class="anchor-icon"></i></a><code>stories_entities</code></h4>
<p>Whether <a href="/api/entities">styled text entities</a> and links in story text captions can be used by all users (<code>enabled</code>), only [Premium](/api/premium users) (<code>premium</code>), or no one (<code>disabled</code>). (string)</p>
<p>This field is used both when posting stories, to indicate to the user whether they can use entities, and when viewing stories, to hide entities (client-side) on stories posted by users whose <a href="/api/premium">Premium</a> subscription has expired (if <code>stories_entities == "premium"</code> and <a href="/constructor/user">user</a>.<code>premium</code> is not set, or if <code>stories_entities == "disabled"</code>). </p>
<h4><a class="anchor" href="#giveaway-gifts-purchase-available" id="giveaway-gifts-purchase-available" name="giveaway-gifts-purchase-available"><i class="anchor-icon"></i></a><code>giveaway_gifts_purchase_available</code></h4>
<p>Whether <a href="/api/giveaways">giveaways</a> can be started by the current user. (boolean)</p>
<h4><a class="anchor" href="#giveaway-add-peers-max" id="giveaway-add-peers-max" name="giveaway-add-peers-max"><i class="anchor-icon"></i></a><code>giveaway_add_peers_max</code></h4>
<p>The maximum number of users that can be specified when making a <a href="/api/giveaways">direct giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#giveaway-countries-max" id="giveaway-countries-max" name="giveaway-countries-max"><i class="anchor-icon"></i></a><code>giveaway_countries_max</code></h4>
<p>The maximum number of countries that can be specified when restricting the set of participating countries in a <a href="/api/giveaways">giveaway</a>. (itneger)</p>
<h4><a class="anchor" href="#giveaway-boosts-per-premium" id="giveaway-boosts-per-premium" name="giveaway-boosts-per-premium"><i class="anchor-icon"></i></a><code>giveaway_boosts_per_premium</code></h4>
<p>The number of <a href="/api/boost">boosts</a> that will be gained by a channel for each winner of a <a href="/api/giveaways">giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#giveaway-period-max" id="giveaway-period-max" name="giveaway-period-max"><i class="anchor-icon"></i></a><code>giveaway_period_max</code></h4>
<p>The maximum duration in seconds of a <a href="/api/giveaways">giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#boosts-channel-level-max" id="boosts-channel-level-max" name="boosts-channel-level-max"><i class="anchor-icon"></i></a><code>boosts_channel_level_max</code></h4>
<p>Maximum <a href="/api/boost">boost level</a> for channels. (integer)</p>
<h4><a class="anchor" href="#boosts-per-sent-gift" id="boosts-per-sent-gift" name="boosts-per-sent-gift"><i class="anchor-icon"></i></a><code>boosts_per_sent_gift</code></h4>
<p>The number of additional <a href="/api/boost">boost slots</a> that the current user will receive when <a href="/api/premium#gifting-telegram-premium">gifting a Telegram Premium subscription</a>. </p>
<h4><a class="anchor" href="#transcribe-audio-trial-weekly-number" id="transcribe-audio-trial-weekly-number" name="transcribe-audio-trial-weekly-number"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_weekly_number</code></h4>
<p>The maximum number of <a href="/api/transcribe">speech recognition »</a> calls per week for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#transcribe-audio-trial-duration-max" id="transcribe-audio-trial-duration-max" name="transcribe-audio-trial-duration-max"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_duration_max</code></h4>
<p>The maximum allowed duration of media in seconds for <a href="/api/transcribe">speech recognition »</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-default" id="recommended-channels-limit-default" name="recommended-channels-limit-default"><i class="anchor-icon"></i></a><code>recommended_channels_limit_default</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-premium" id="recommended-channels-limit-premium" name="recommended-channels-limit-premium"><i class="anchor-icon"></i></a><code>recommended_channels_limit_premium</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#quote-length-max" id="quote-length-max" name="quote-length-max"><i class="anchor-icon"></i></a><code>quote_length_max</code></h4>
<p>Maximum UTF-8 length of <a href="/constructor/inputReplyToMessage">quoted text</a>. (integer)</p>
<h4><a class="anchor" href="#channel-bg-icon-level-min" id="channel-bg-icon-level-min" name="channel-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_bg_icon_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">message accent palette emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-profile-bg-icon-level-min" id="channel-profile-bg-icon-level-min" name="channel-profile-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_profile_bg_icon_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">profile accent palette emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-emoji-status-level-min" id="channel-emoji-status-level-min" name="channel-emoji-status-level-min"><i class="anchor-icon"></i></a><code>channel_emoji_status_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-wallpaper-level-min" id="channel-wallpaper-level-min" name="channel-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_wallpaper_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set a <a href="/api/wallpapers#channel-wallpapers">fill channel wallpaper, see here » for more info</a>. (integer)</p>
<h4><a class="anchor" href="#channel-custom-wallpaper-level-min" id="channel-custom-wallpaper-level-min" name="channel-custom-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_custom_wallpaper_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill channel wallpapers, see here » for more info</a>. (integer)</p>
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-default" id="saved-dialogs-pinned-limit-default" name="saved-dialogs-pinned-limit-default"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_default</code></h4>
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-premium" id="saved-dialogs-pinned-limit-premium" name="saved-dialogs-pinned-limit-premium"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_premium</code></h4>
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for <a href="/api/premium">Premium</a> users. (integer)</p>
<h3><a class="anchor" href="#suggestions" id="suggestions" name="suggestions"><i class="anchor-icon"></i></a>Suggestions</h3>
<p>The API can return a set of useful suggestions for users of graphical clients. </p>
<h4><a class="anchor" href="#basic-suggestions" id="basic-suggestions" name="basic-suggestions"><i class="anchor-icon"></i></a>Basic suggestions</h4>
@ -460,13 +590,17 @@ A full list of these parameters can be seen in the <a href="#client-configuratio
<li><code>"VALIDATE_PASSWORD"</code> - Users should make sure they still remember their <a href="/api/srp">2-step verification password</a>.</li>
<li><code>"VALIDATE_PHONE_NUMBER"</code> - Users should check whether their <a href="/api/auth">authorization phone number</a> is correct and change the phone number if it is inaccessible.</li>
<li><code>"NEWCOMER_TICKS"</code> - Show the user a hint about the meaning of one and two ticks on sent messages.</li>
<li><code>"SETUP_PASSWORD"</code> - Show the user a hint, asking them to check whether they still remember their <a href="/api/srp">2FA password</a></li>
<li><code>"PREMIUM_ANNUAL"</code> - Suggests the user to subscribe to the Premium subscription (with annual payments)</li>
<li><code>"PREMIUM_UPGRADE"</code> - Suggests the user to upgrade their existing Premium subscription from monthly payments to annual payments</li>
<li><code>"PREMIUM_RESTORE"</code> - Suggests the user to restore a recently expired Premium subscription</li>
</ul>
</li>
</ul>
<h4><a class="anchor" href="#channel-suggestions" id="channel-suggestions" name="channel-suggestions"><i class="anchor-icon"></i></a>Channel suggestions</h4>
<pre><code><a href='/constructor/messages.chatFull'>messages.chatFull</a>#e5d7d19c full_chat:<a href='/type/ChatFull'>ChatFull</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.ChatFull'>messages.ChatFull</a>;
<a href='/constructor/channelFull'>channelFull</a>#f2355507 flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> = <a href='/type/ChatFull'>ChatFull</a>;
<a href='/constructor/channelFull'>channelFull</a>#f2bcb6f flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> stories_pinned_available:flags2.5?<a href='/constructor/true'>true</a> view_forum_as_messages:flags2.6?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> stories:flags2.4?<a href='/type/PeerStories'>PeerStories</a> wallpaper:flags2.7?<a href='/type/WallPaper'>WallPaper</a> = <a href='/type/ChatFull'>ChatFull</a>;
---functions---
@ -490,19 +624,17 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/constructor/help.noAppUpdate'>help.noAppUpdate</a>#c45a6536 = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
<a href='/constructor/updates'>updates</a>#74ae4240 updates:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Update'>Update</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; date:<a href='/type/int'>int</a> seq:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/constructor/updateServiceNotification'>updateServiceNotification</a>#ebe46819 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> inbox_date:flags.1?<a href='/type/int'>int</a> type:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> media:<a href='/type/MessageMedia'>MessageMedia</a> entities:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateServiceNotification'>updateServiceNotification</a>#ebe46819 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> invert_media:flags.2?<a href='/constructor/true'>true</a> inbox_date:flags.1?<a href='/type/int'>int</a> type:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> media:<a href='/type/MessageMedia'>MessageMedia</a> entities:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/help.inviteText'>help.inviteText</a>#18cb9f78 message:<a href='/type/string'>string</a> = <a href='/type/help.InviteText'>help.InviteText</a>;
---functions---
<a href='/method/help.getAppUpdate'>help.getAppUpdate</a>#522d5a7d source:<a href='/type/string'>string</a> = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
<a href='/method/help.getAppChangelog'>help.getAppChangelog</a>#9010ef6f prev_app_version:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/help.getInviteText'>help.getInviteText</a>#4d392343 = <a href='/type/help.InviteText'>help.InviteText</a>;</code></pre>
<ul>
<li><a href="/method/help.getAppUpdate">help.getAppUpdate</a> - Get info about an application update, can contain the updated application binary in the attached document</li>
<li><a href="/method/help.getAppChangelog">help.getAppChangelog</a> - Get a list of service messages with app-specific changelogs</li>
<li><a href="/method/help.getInviteText">help.getInviteText</a> - Returns a localized invitation message that can be sent via SMS to contacts that haven't signed up to Telegram yet</li>
</ul>
<h3><a class="anchor" href="#terms-of-service" id="terms-of-service" name="terms-of-service"><i class="anchor-icon"></i></a>Terms of service</h3>
@ -522,13 +654,13 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/method/account.deleteAccount'>account.deleteAccount</a>#a2c0cf74 flags:<a href='/type/%23'>#</a> reason:<a href='/type/string'>string</a> password:flags.0?<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>These methods can be used for managing consent to Telegram's <a href="https://telegram.org/tos">Terms Of Service</a>. </p>
<p>Typically, before a user <a href="/api/auth#sign-insign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>Typically, before a user <a href="/api/auth#sign-in-sign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>When signing up for the first time, the <a href="/constructor/help.termsOfService">help.termsOfService</a> is to be obtained from the <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a> constructor returned by the <a href="/method/auth.signIn">auth.signIn</a>. </p>
<p>After signing up, or when logging in as an existing user, apps are supposed to call <a href="/method/help.getTermsOfServiceUpdate">help.getTermsOfServiceUpdate</a> to check for any updates to the Terms of Service; this call should be repeated after <code>expires</code> seconds have elapsed.<br>
If an update to the Terms Of Service is available, clients are supposed to show a consent popup; if accepted, clients should call <a href="/method/help.acceptTermsOfService">help.acceptTermsOfService</a>, providing the <a href="/constructor/help.termsOfService">termsOfService <code>id</code> JSON object</a>; in case of denial, clients are to delete the account using <a href="/method/account.deleteAccount">account.deleteAccount</a>, providing <code>Decline ToS update</code> as deletion <code>reason</code>. </p>
<p>Example implementation: <a href="https://github.com/DrKLO/Telegram/blob/dbf81a34affcd1c24d78e1403347ea8b3a186154/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java#L3510">android (signup)</a>, <a href="https://github.com/DrKLO/Telegram/blob/ed9e38da5b3b6ca80a7cb719a000d310d07497b0/TMessagesProj/src/main/java/org/telegram/ui/Components/TermsOfServiceView.java">android (after login)</a></p>
<h3><a class="anchor" href="#telegram-support-info" id="telegram-support-info" name="telegram-support-info"><i class="anchor-icon"></i></a>Telegram support info</h3>
<pre><code><a href='/constructor/user'>user</a>#8f97c628 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> 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; = <a href='/type/User'>User</a>;
<pre><code><a href='/constructor/user'>user</a>#215c4438 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> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> = <a href='/type/User'>User</a>;
<a href='/constructor/help.support'>help.support</a>#17c6b5f6 phone_number:<a href='/type/string'>string</a> user:<a href='/type/User'>User</a> = <a href='/type/help.Support'>help.Support</a>;
<a href='/constructor/help.supportName'>help.supportName</a>#8c05f1c9 name:<a href='/type/string'>string</a> = <a href='/type/help.SupportName'>help.SupportName</a>;

View file

@ -53,7 +53,7 @@ This is implemented by using the dice constructors: </p>
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7547c966 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> top_msg_id:flags.9?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#c8a0ec74 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> hash:<a href='/type/int'>int</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;

View file

@ -47,6 +47,7 @@
<table class="table">
<tbody>
<tr>
<td> </td>
<td><strong>in_seq_no</strong></td>
<td><strong>out_seq_no</strong></td>
</tr>
@ -77,7 +78,7 @@
<li>If the received <strong>out_seq_no&gt;C+1</strong>, it most likely means that the server left out some messages due to a technical failure or due to the messages becoming obsolete. A temporary solution to this is to simply abort the secret chat. But since this may cause some existing older secret chats to be aborted, it is strongly recommended for the client to properly handle such <strong>seq_no</strong> gaps. Note that <strong>in_seq_no</strong> is not increased upon receipt of such a message; it is advanced only after all preceding gaps are filled.</li>
</ul>
<h4><a class="anchor" href="#proper-handling-of-gaps" id="proper-handling-of-gaps" name="proper-handling-of-gaps"><i class="anchor-icon"></i></a>Proper handling of gaps</h4>
<p>In order to correctly handle incoming messages after a hole has been identified (when received <strong>out_seq_no&gt;C+1</strong>), it is necessary to put received messages with the wrong <strong>seq_no</strong> into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor <a href="/constructor/decryptedMessageActionResend">decryptedMessageActionResend</a> <code>start_seq_no:<a href='/type/int'>int</a> end_seq_no:<a href='/type/int'>int</a> = <a href='/type/DecryptedMessageAction'>DecryptedMessageAction</a>;</code>. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore <em>cannot</em> be in their raw form: you can easily get the necessary <strong>start_seq_no</strong> by adding 2 to the <strong>out_seq_no</strong> of the last message before the hole and the <strong>end_seq_no</strong> by subtracting 2 from the <strong>out_seq_no</strong> of the received message with the wrong sequence number.</p>
<p>In order to correctly handle incoming messages after a hole has been identified (when received <strong>out_seq_no&gt;C+1</strong>), it is necessary to put received messages with the wrong <strong>seq_no</strong> into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor <a href="/constructor/decryptedMessageActionResend">decryptedMessageActionResend</a>. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore <em>cannot</em> be in their raw form: you can easily get the necessary <strong>start_seq_no</strong> by adding 2 to the <strong>out_seq_no</strong> of the last message before the hole and the <strong>end_seq_no</strong> by subtracting 2 from the <strong>out_seq_no</strong> of the received message with the wrong sequence number.</p>
<p>Each hole normally requires only one request to resend messages — if the remote client keeps sending out of sync messages, they should be put into the queue without sending a new request. Having received the missing messages, the local client must first interpret these messages in the right order by their <strong>seq_no</strong>. Once this is done, the client can proceed to interpret messages from the queue (again, in the right <strong>seq_no</strong> order).</p>
<p>Special cases:</p>
<ul>

View file

@ -54,7 +54,7 @@
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7547c966 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> top_msg_id:flags.9?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>To send a poll in a chat, call <a href="/method/messages.sendMedia">messages.sendMedia</a>, providing an <a href="/constructor/inputMediaPoll">inputMediaPoll</a>:</p>
<ul>
<li>
@ -85,7 +85,7 @@ These last two parameters are exactly the same, except that one uses absolute, t
<h3><a class="anchor" href="#voting-in-polls" id="voting-in-polls" name="voting-in-polls"><i class="anchor-icon"></i></a>Voting in polls</h3>
<pre><code><a href='/constructor/pollAnswerVoters'>pollAnswerVoters</a>#3b6ddad2 flags:<a href='/type/%23'>#</a> chosen:flags.0?<a href='/constructor/true'>true</a> correct:flags.1?<a href='/constructor/true'>true</a> option:<a href='/type/bytes'>bytes</a> voters:<a href='/type/int'>int</a> = <a href='/type/PollAnswerVoters'>PollAnswerVoters</a>;
<a href='/constructor/pollResults'>pollResults</a>#dcb82ea3 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/pollResults'>pollResults</a>#7adf2420 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Peer'>Peer</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/poll'>poll</a>#86e18161 id:<a href='/type/long'>long</a> flags:<a href='/type/%23'>#</a> closed:flags.0?<a href='/constructor/true'>true</a> public_voters:flags.1?<a href='/constructor/true'>true</a> multiple_choice:flags.2?<a href='/constructor/true'>true</a> quiz:flags.3?<a href='/constructor/true'>true</a> question:<a href='/type/string'>string</a> answers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswer'>PollAnswer</a>&gt; close_period:flags.4?<a href='/type/int'>int</a> close_date:flags.5?<a href='/type/int'>int</a> = <a href='/type/Poll'>Poll</a>;
@ -101,7 +101,7 @@ These last two parameters are exactly the same, except that one uses absolute, t
<h3><a class="anchor" href="#getting-poll-votes" id="getting-poll-votes" name="getting-poll-votes"><i class="anchor-icon"></i></a>Getting poll votes</h3>
<pre><code><a href='/constructor/pollAnswerVoters'>pollAnswerVoters</a>#3b6ddad2 flags:<a href='/type/%23'>#</a> chosen:flags.0?<a href='/constructor/true'>true</a> correct:flags.1?<a href='/constructor/true'>true</a> option:<a href='/type/bytes'>bytes</a> voters:<a href='/type/int'>int</a> = <a href='/type/PollAnswerVoters'>PollAnswerVoters</a>;
<a href='/constructor/pollResults'>pollResults</a>#dcb82ea3 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/pollResults'>pollResults</a>#7adf2420 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Peer'>Peer</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/updateMessagePoll'>updateMessagePoll</a>#aca1657b flags:<a href='/type/%23'>#</a> poll_id:<a href='/type/long'>long</a> poll:flags.0?<a href='/type/Poll'>Poll</a> results:<a href='/type/PollResults'>PollResults</a> = <a href='/type/Update'>Update</a>;
@ -111,13 +111,13 @@ These last two parameters are exactly the same, except that one uses absolute, t
<p>Regularly, if new users have voted in polls available to the user, they will receive an <a href="/constructor/updateMessagePoll">updateMessagePoll</a>, with updated <a href="/constructor/pollResults">pollResults</a>. </p>
<p>The same constructor can also be fetched manually using <a href="/method/messages.getPollResults">messages.getPollResults</a>.</p>
<h3><a class="anchor" href="#getting-poll-voters-in-non-anonymous-polls" id="getting-poll-voters-in-non-anonymous-polls" name="getting-poll-voters-in-non-anonymous-polls"><i class="anchor-icon"></i></a>Getting poll voters in non-anonymous polls</h3>
<pre><code><a href='/constructor/messageUserVote'>messageUserVote</a>#34d247b4 user_id:<a href='/type/long'>long</a> option:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> = <a href='/type/MessageUserVote'>MessageUserVote</a>;
<a href='/constructor/messageUserVoteInputOption'>messageUserVoteInputOption</a>#3ca5b0ec user_id:<a href='/type/long'>long</a> date:<a href='/type/int'>int</a> = <a href='/type/MessageUserVote'>MessageUserVote</a>;
<a href='/constructor/messageUserVoteMultiple'>messageUserVoteMultiple</a>#8a65e557 user_id:<a href='/type/long'>long</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; date:<a href='/type/int'>int</a> = <a href='/type/MessageUserVote'>MessageUserVote</a>;
<pre><code><a href='/constructor/messagePeerVote'>messagePeerVote</a>#b6cc2d5c peer:<a href='/type/Peer'>Peer</a> option:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> = <a href='/type/MessagePeerVote'>MessagePeerVote</a>;
<a href='/constructor/messagePeerVoteInputOption'>messagePeerVoteInputOption</a>#74cda504 peer:<a href='/type/Peer'>Peer</a> date:<a href='/type/int'>int</a> = <a href='/type/MessagePeerVote'>MessagePeerVote</a>;
<a href='/constructor/messagePeerVoteMultiple'>messagePeerVoteMultiple</a>#4628f6e6 peer:<a href='/type/Peer'>Peer</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; date:<a href='/type/int'>int</a> = <a href='/type/MessagePeerVote'>MessagePeerVote</a>;
<a href='/constructor/messages.votesList'>messages.votesList</a>#823f649 flags:<a href='/type/%23'>#</a> count:<a href='/type/int'>int</a> votes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageUserVote'>MessageUserVote</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; next_offset:flags.0?<a href='/type/string'>string</a> = <a href='/type/messages.VotesList'>messages.VotesList</a>;
<a href='/constructor/messages.votesList'>messages.votesList</a>#4899484e flags:<a href='/type/%23'>#</a> count:<a href='/type/int'>int</a> votes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessagePeerVote'>MessagePeerVote</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; next_offset:flags.0?<a href='/type/string'>string</a> = <a href='/type/messages.VotesList'>messages.VotesList</a>;
<a href='/constructor/updateMessagePollVote'>updateMessagePollVote</a>#106395c9 poll_id:<a href='/type/long'>long</a> user_id:<a href='/type/long'>long</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; qts:<a href='/type/int'>int</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateMessagePollVote'>updateMessagePollVote</a>#24f40e77 poll_id:<a href='/type/long'>long</a> peer:<a href='/type/Peer'>Peer</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; qts:<a href='/type/int'>int</a> = <a href='/type/Update'>Update</a>;
---functions---

View file

@ -63,7 +63,7 @@
<p>Bots can use <a href="/method/bots.setBotBroadcastDefaultAdminRights">bots.setBotBroadcastDefaultAdminRights</a> to indicate a suggested set of <a href="/api/rights">admin rights »</a> to use when adding the bot to a <a href="/api/channel">channel</a>, and <a href="/method/bots.setBotGroupDefaultAdminRights">bots.setBotGroupDefaultAdminRights</a> when adding the bot to a <a href="/api/channel">group</a>. </p>
<p>These suggested admin rights are contained in the <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code> paremeters of <a href="/constructor/userFull">userFull</a>, obtainable using <a href="/method/users.getFullUser">users.getFullUser</a>. </p>
<p>A client application trying to add a bot as admin should fetch the default rights and present them as editable defaults to the user: the rights can then be modified before <a href="#admin-rights">setting the bot as admin</a>.</p>
<p>Note that admin rights suggested by a <a href="/api/links#groupchannel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin. </p></div>
<p>Note that admin rights suggested by a <a href="/api/links#group-channel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin.</p></div>
</div>

View file

@ -48,7 +48,7 @@
<p>Schema: </p>
<pre><code><a href='/constructor/updateTranscribedAudio'>updateTranscribedAudio</a>#84cd5a flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/Peer'>Peer</a> msg_id:<a href='/type/int'>int</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/messages.transcribedAudio'>messages.transcribedAudio</a>#93752c52 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> = <a href='/type/messages.TranscribedAudio'>messages.TranscribedAudio</a>;
<a href='/constructor/messages.transcribedAudio'>messages.transcribedAudio</a>#cfb9d957 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> trial_remains_num:flags.1?<a href='/type/int'>int</a> trial_remains_until_date:flags.1?<a href='/type/int'>int</a> = <a href='/type/messages.TranscribedAudio'>messages.TranscribedAudio</a>;
---functions---
@ -57,7 +57,9 @@
<p>Use <a href="/method/messages.transcribeAudio">messages.transcribeAudio</a> to initiate transcription of a message.<br>
The returned <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> constructor will have the <code>pending</code> flag set if the transcription is still in progress and the transcribed text contained in <code>text</code> will be updated in future with <a href="/constructor/updateTranscribedAudio">updateTranscribedAudio</a> updates.<br>
These updates will contain the updated <code>text</code> with the same <code>transcription_id</code> returned in the first <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a>, and the <code>pending</code> flag will be set if the transcription is still in progress. </p>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p></div>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p>
<p>Users without a <a href="/api/premium">Telegram Premium</a> subscription can only transcribe <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a> messages per week, each of maximum duration equal to <a href="/api/config#transcribe-audio-trial-duration-max">transcribe_audio_trial_duration_max</a> seconds.<br>
For non-premium users, the <code>trial_remains_num</code> and <code>trial_remains_until_date</code> flags of <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> will also be set, indicating the remaining transcriptions, and the date when the <code>trial_remains_num</code> counter will be reset to the maximum value of <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a>.</p></div>
</div>

View file

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>messages.webPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Represents an Instant View webpage.">
<meta property="og:title" content="messages.webPage">
<meta property="og:image" content="">
<meta property="og:description" content="Represents an Instant View webpage.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/messages.webPage" >messages.webPage</a></li></ul></div>
<h1 id="dev_page_title">messages.webPage</h1>
<div id="dev_page_content"><p>Represents an Instant View webpage.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 165. <a href="?layer=165">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>webpage</strong></td>
<td style="text-align: center;"><a href="/type/WebPage">WebPage</a></td>
<td>The instant view webpage.</td>
</tr>
<tr>
<td><strong>chats</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/Chat">Chat</a>&gt;</td>
<td>Chats mentioned in the webpage.</td>
</tr>
<tr>
<td><strong>users</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/User">User</a>&gt;</td>
<td>Users mentioned in the webpage.</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/messages.WebPage">messages.WebPage</a></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</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,165 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>postInteractionCountersMessage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Interaction counters for a message.">
<meta property="og:title" content="postInteractionCountersMessage">
<meta property="og:image" content="">
<meta property="og:description" content="Interaction counters for a message.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/postInteractionCountersMessage" >postInteractionCountersMessage</a></li></ul></div>
<h1 id="dev_page_title">postInteractionCountersMessage</h1>
<div id="dev_page_content"><p>Interaction counters for a message.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 167. <a href="?layer=167">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>msg_id</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Message ID</td>
</tr>
<tr>
<td><strong>views</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of views</td>
</tr>
<tr>
<td><strong>forwards</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of forwards to public channels</td>
</tr>
<tr>
<td><strong>reactions</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of reactions</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/PostInteractionCounters">PostInteractionCounters</a></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</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,165 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>postInteractionCountersStory</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Interaction counters for a story.">
<meta property="og:title" content="postInteractionCountersStory">
<meta property="og:image" content="">
<meta property="og:description" content="Interaction counters for 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">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/postInteractionCountersStory" >postInteractionCountersStory</a></li></ul></div>
<h1 id="dev_page_title">postInteractionCountersStory</h1>
<div id="dev_page_content"><p>Interaction counters for 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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 167. <a href="?layer=167">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>story_id</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Story ID</td>
</tr>
<tr>
<td><strong>views</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of views</td>
</tr>
<tr>
<td><strong>forwards</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of forwards and reposts to public chats and channels</td>
</tr>
<tr>
<td><strong>reactions</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of reactions</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/PostInteractionCounters">PostInteractionCounters</a></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</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,165 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>sponsoredWebPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Represents a sponsored website.">
<meta property="og:title" content="sponsoredWebPage">
<meta property="og:image" content="">
<meta property="og:description" content="Represents a sponsored website.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/sponsoredWebPage" >sponsoredWebPage</a></li></ul></div>
<h1 id="dev_page_title">sponsoredWebPage</h1>
<div id="dev_page_content"><p>Represents a sponsored website.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 159. <a href="?layer=159">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>flags</strong></td>
<td style="text-align: center;"><a href="/type/%23">#</a></td>
<td>Flags, see <a href="/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></td>
</tr>
<tr>
<td><strong>url</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Web page URL.</td>
</tr>
<tr>
<td><strong>site_name</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Website name.</td>
</tr>
<tr>
<td><strong>photo</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/Photo">Photo</a></td>
<td>Optional image preview.</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/SponsoredWebPage">SponsoredWebPage</a></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -110,8 +110,8 @@ Client developers are required to comply with the <a href="/mtproto/security_gui
MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is deprecated and is currently being phased out. </p>
</blockquote>
<h3><a class="anchor" href="#brief-component-summary" id="brief-component-summary" name="brief-component-summary"><i class="anchor-icon"></i></a>Brief Component Summary</h3>
<h4><a class="anchor" href="#high-level-component-rpc-query-languageapi" id="high-level-component-rpc-query-languageapi" name="high-level-component-rpc-query-languageapi"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific websocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
<h4><a class="anchor" href="#high-level-component-rpc-query-language-api" id="high-level-component-rpc-query-language-api" name="high-level-component-rpc-query-language-api"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific WebSocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
<p>Several connections to a server may be open; messages may be sent in either direction through any of the connections (a response to a query is not necessarily returned through the same connection that carried the original query, although most often, that is the case; however, in no case can a message be returned through a connection belonging to a different session). When the UDP protocol is used, a response might be returned by a different IP address than the one to which the query had been sent.</p>
<p>There are several types of messages:</p>
<ul>
@ -157,8 +157,8 @@ Additionally, the following transport features can be used: </p>
Multiple transport protocols are defined:</p>
<ul>
<li><a href="/mtproto/transports#tcp">TCP</a></li>
<li><a href="/mtproto/transports#websocket">Websocket</a></li>
<li><a href="/mtproto/transports#websocket-over-https">Websocket over HTTPS</a></li>
<li><a href="/mtproto/transports#websocket">WebSocket</a></li>
<li><a href="/mtproto/transports#websocket-over-https">WebSocket over HTTPS</a></li>
<li><a href="/mtproto/transports#http">HTTP</a></li>
<li><a href="/mtproto/transports#https">HTTPS</a></li>
<li>UDP</li>
@ -167,7 +167,7 @@ Multiple transport protocols are defined:</p>
<h3><a class="anchor" href="#recap" id="recap" name="recap"><i class="anchor-icon"></i></a>Recap</h3>
<p>To recap, using the <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_architecture">ISO/OSI stack as comparison</a>: </p>
<ul>
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-languageapi">High-level RPC API</a></li>
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-language-api">High-level RPC API</a></li>
<li>Layer 6 (Presentation): <a href="/mtproto/TL">Type Language</a></li>
<li>Layer 5 (Session): <a href="https://core.telegram.org/mtproto/description#session">MTProto session</a></li>
<li>Layer 4 (Transport):<ul>

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 54 BC 00 00 FF 9A 9E 64
0010 | 14 00 00 00 F1 8E 7E BE DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 72 06 00 50 3D C5 65
0010 | 14 00 00 00 F1 8E 7E BE 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF</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>54BC0000FF9A9E64</code></td>
<td><code>D4720600503DC565</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,15 +104,15 @@
<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 64 63 C2 FF 9A 9E 64
0010 | 50 00 00 00 63 24 16 05 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 08 1D 03 06 D7 8C 29 2A
0040 | 69 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 D8 31 75 50 3D C5 65
0010 | A8 00 00 00 63 24 16 05 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 08 25 65 95 ED B7 76 67
0040 | 97 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>
<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector&lt;long&gt; = ResPQ;</code></pre>
<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector&lt;strlong&gt; = ResPQ;</code></pre>
<table class="table">
<thead>
<tr>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>016463C2FF9A9E64</code></td>
<td><code>01D83175503DC565</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>50000000</code> (80 in decimal)</td>
<td><code>A8000000</code> (168 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,23 +150,23 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</td>
<td><code>08256595EDB7766797000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2694724800268887959</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>%(Vector long)</td>
<td>%(Vector strlong)</td>
<td>68, 4</td>
<td><code>15c4b51c</code></td>
<td><em>Vector t</em> constructor number from TL schema</td>
@ -206,24 +206,24 @@
<p>Let's choose the only matching key, the one with fingerprint equal to <code>85FD64DE851D9DD0</code>.</p>
<!-- end fingerprints -->
<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>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-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 = 2090522174869285481</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2090522174869285481 = 1112973847 * 1878321023</code></p>
<pre><code>p = 1112973847
q = 1878321023</code></pre>
<pre><code>pq = 2694724800268887959</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2694724800268887959 = 1513098571 * 1780931429</code></p>
<pre><code>p = 1513098571
q = 1780931429</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 1D 03 06 D7 8C 29 2A 69 00 00 00
0010 | 04 42 56 A2 17 00 00 00 04 6F F4 E7 7F 00 00 00
0020 | DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8 3A F2 02 7D
0030 | 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7 EF 43 97 39
0040 | 0E 63 58 A8 84 41 7C 48 A8 81 CD B2 44 E1 CE 7D
0050 | 3F F7 C4 E4 4E 38 10 39 EF DC E2 57 66 F4 8C E4
<pre><code>0000 | 95 5F F5 A9 08 25 65 95 ED B7 76 67 97 00 00 00
0010 | 04 5A 30 0D 4B 00 00 00 04 6A 26 DB 65 00 00 00
0020 | 40 67 09 F6 12 FA DF BE C3 F0 28 9D 0A A6 7E EF
0030 | E1 1D BC 3B C9 7D 91 A2 61 54 F9 32 AF 01 99 43
0040 | A8 BB C8 49 51 2D AC 6C 67 B6 EF D9 15 7D 6C A7
0050 | 37 7A 17 76 30 7D 84 26 5C 6B E9 BD CF 80 2A C1
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 = 1878321023</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</td>
<td><code>08256595EDB7766797000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2694724800268887959</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>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</td>
<td><code>045A300D4B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1513098571</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>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</td>
<td><code>046A26DB65000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1780931429</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>0E6358A884417C48A881CDB244E1CE7D</code> <code>3FF7C4E44E381039EFDCE25766F48CE4</code></td>
<td><code>A8BBC849512DAC6C67B6EFD9157D6CA7</code> <code>377A1776307D84265C6BE9BDCF802AC1</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1878321023</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 = 955FF5A9081D0306D78C292A69000000044256A217000000046FF4E77F000000DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390E6358A884417C48A881CDB244E1CE7D3FF7C4E44E381039EFDCE25766F48CE402000000
random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907CBA6FFDE7C240684F1767F3ABECA72A65B6B737894D25CF280679407F569BD4F5A52BCEB645852B499E9A467DFFD015FC2AA75DE1AB51568B018CEE65999DD3</code></pre>
<pre><code>data = 955FF5A908256595EDB7766797000000045A300D4B000000046A26DB65000000406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF019943A8BBC849512DAC6C67B6EFD9157D6CA7377A1776307D84265C6BE9BDCF802AC102000000
random_padding_bytes = D944BB8347C876177FE03C2562BF4E87258EF147A7815D8853AA4B1065A5A385D0DA7E0B6100FAF55728D04DFC84E7E0D20006E07E1CB036730F5B3209CF85B2365B39DE2CBC56F40B725AD347835E5D1973567ECE8A02CF343D54F7</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 = 978CD0DA71C89E58D5DD3A369FD23C91CDF29AE8DEF7D7FADC5303F2D7D0BF676E6408C20F9888167525245E891B2884D4894406FD34D0A3739BB89D8BEFC5982F4CE7D899CAD65156931C8048627A86C3549183D914CFFBCB3B39E2B719B1F243CEFBFEEB8E5EBCD0C343772500D27BA8CEB80A46FA4EEBD88435FDF979DF40938AC43C6947D55F7C3130122D5D90BAA23C03CDBD5EEDDF9D1F0D46054856E3A3F4A86E9BE4FF61E80FA5606A9A0D1F797DE334D6DE845B71C48544A5AC2ECEFC92F0194789C66085F6DBC1D81E6674A8CDAC6D1911BAEAE1279133C162A4091E04B85732AEBEC304C17DCD5A8637413EC2CAE8B00A06A2121179D4DBAACBB7</code></pre>
<pre><code>encrypted_data = B80632B3F0D1AB28EFAE2CF974C4A2D51A77FCB6DEFD415E1EC284CAB2B5F88D5C4C5B19AFF5E940CE14CCB6A7F340EC88DF7C1F091FB6F7323B047C02DC63212D0DEBE4B3B7A0310E26DB1289CBA24112DF37506C90DEAB797623E4AFF4643D2A921891346BC176C4E1CCE14F64FA59526DD021EFFA428E8F8ACEEB96DBD4729E99BBB26DDDC744D584B732415DFFE20418953F4EAFC81DADE5C6606A1E7FAA3EDB90F36ECF405422C97C360CC31A444B1EEB6C33D62C5802165C72BBC85D1ADBCCD17988DE7F43DA0F340502744B52B196A78EF1ED1372C6EA1232603FDB9C28F7F8783F29098FFD0FE9B066C460ECBA0A2962B82398C1B32D3DCB3BC3A59E</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 9C A0 09 00 FF 9A 9E 64
0010 | 40 01 00 00 BE E4 12 D7 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 04 42 56 A2 17 00 00 00
0040 | 04 6F F4 E7 7F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 97 8C D0 DA 71 C8 9E 58 D5 DD 3A 36
0060 | 9F D2 3C 91 CD F2 9A E8 DE F7 D7 FA DC 53 03 F2
0070 | D7 D0 BF 67 6E 64 08 C2 0F 98 88 16 75 25 24 5E
0080 | 89 1B 28 84 D4 89 44 06 FD 34 D0 A3 73 9B B8 9D
0090 | 8B EF C5 98 2F 4C E7 D8 99 CA D6 51 56 93 1C 80
00A0 | 48 62 7A 86 C3 54 91 83 D9 14 CF FB CB 3B 39 E2
00B0 | B7 19 B1 F2 43 CE FB FE EB 8E 5E BC D0 C3 43 77
00C0 | 25 00 D2 7B A8 CE B8 0A 46 FA 4E EB D8 84 35 FD
00D0 | F9 79 DF 40 93 8A C4 3C 69 47 D5 5F 7C 31 30 12
00E0 | 2D 5D 90 BA A2 3C 03 CD BD 5E ED DF 9D 1F 0D 46
00F0 | 05 48 56 E3 A3 F4 A8 6E 9B E4 FF 61 E8 0F A5 60
0100 | 6A 9A 0D 1F 79 7D E3 34 D6 DE 84 5B 71 C4 85 44
0110 | A5 AC 2E CE FC 92 F0 19 47 89 C6 60 85 F6 DB C1
0120 | D8 1E 66 74 A8 CD AC 6D 19 11 BA EA E1 27 91 33
0130 | C1 62 A4 09 1E 04 B8 57 32 AE BE C3 04 C1 7D CD
0140 | 5A 86 37 41 3E C2 CA E8 B0 0A 06 A2 12 11 79 D4
0150 | DB AA CB B7</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 72 06 00 50 3D C5 65
0010 | 40 01 00 00 BE E4 12 D7 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 04 5A 30 0D 4B 00 00 00
0040 | 04 6A 26 DB 65 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 B8 06 32 B3 F0 D1 AB 28 EF AE 2C F9
0060 | 74 C4 A2 D5 1A 77 FC B6 DE FD 41 5E 1E C2 84 CA
0070 | B2 B5 F8 8D 5C 4C 5B 19 AF F5 E9 40 CE 14 CC B6
0080 | A7 F3 40 EC 88 DF 7C 1F 09 1F B6 F7 32 3B 04 7C
0090 | 02 DC 63 21 2D 0D EB E4 B3 B7 A0 31 0E 26 DB 12
00A0 | 89 CB A2 41 12 DF 37 50 6C 90 DE AB 79 76 23 E4
00B0 | AF F4 64 3D 2A 92 18 91 34 6B C1 76 C4 E1 CC E1
00C0 | 4F 64 FA 59 52 6D D0 21 EF FA 42 8E 8F 8A CE EB
00D0 | 96 DB D4 72 9E 99 BB B2 6D DD C7 44 D5 84 B7 32
00E0 | 41 5D FF E2 04 18 95 3F 4E AF C8 1D AD E5 C6 60
00F0 | 6A 1E 7F AA 3E DB 90 F3 6E CF 40 54 22 C9 7C 36
0100 | 0C C3 1A 44 4B 1E EB 6C 33 D6 2C 58 02 16 5C 72
0110 | BB C8 5D 1A DB CC D1 79 88 DE 7F 43 DA 0F 34 05
0120 | 02 74 4B 52 B1 96 A7 8E F1 ED 13 72 C6 EA 12 32
0130 | 60 3F DB 9C 28 F7 F8 78 3F 29 09 8F FD 0F E9 B0
0140 | 66 C4 60 EC BA 0A 29 62 B8 23 98 C1 B3 2D 3D CB
0150 | 3B C3 A5 9E</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>9CA00900FF9A9E64</code></td>
<td><code>D8720600503DC565</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</td>
<td><code>045A300D4B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1513098571</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>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</td>
<td><code>046A26DB65000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1780931429</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100978CD0DA71C89E58D5DD3A36</code> <code>9FD23C91CDF29AE8DEF7D7FADC5303F2</code> <code>D7D0BF676E6408C20F9888167525245E</code> <code>891B2884D4894406FD34D0A3739BB89D</code> <code>8BEFC5982F4CE7D899CAD65156931C80</code> <code>48627A86C3549183D914CFFBCB3B39E2</code> <code>B719B1F243CEFBFEEB8E5EBCD0C34377</code> <code>2500D27BA8CEB80A46FA4EEBD88435FD</code> <code>F979DF40938AC43C6947D55F7C313012</code> <code>2D5D90BAA23C03CDBD5EEDDF9D1F0D46</code> <code>054856E3A3F4A86E9BE4FF61E80FA560</code> <code>6A9A0D1F797DE334D6DE845B71C48544</code> <code>A5AC2ECEFC92F0194789C66085F6DBC1</code> <code>D81E6674A8CDAC6D1911BAEAE1279133</code> <code>C162A4091E04B85732AEBEC304C17DCD</code> <code>5A8637413EC2CAE8B00A06A2121179D4</code><br> <code>DBAACBB7</code></td>
<td><code>FE000100B80632B3F0D1AB28EFAE2CF9</code> <code>74C4A2D51A77FCB6DEFD415E1EC284CA</code> <code>B2B5F88D5C4C5B19AFF5E940CE14CCB6</code> <code>A7F340EC88DF7C1F091FB6F7323B047C</code> <code>02DC63212D0DEBE4B3B7A0310E26DB12</code> <code>89CBA24112DF37506C90DEAB797623E4</code> <code>AFF4643D2A921891346BC176C4E1CCE1</code> <code>4F64FA59526DD021EFFA428E8F8ACEEB</code> <code>96DBD4729E99BBB26DDDC744D584B732</code> <code>415DFFE20418953F4EAFC81DADE5C660</code> <code>6A1E7FAA3EDB90F36ECF405422C97C36</code> <code>0CC31A444B1EEB6C33D62C5802165C72</code> <code>BBC85D1ADBCCD17988DE7F43DA0F3405</code> <code>02744B52B196A78EF1ED1372C6EA1232</code> <code>603FDB9C28F7F8783F29098FFD0FE9B0</code> <code>66C460ECBA0A2962B82398C1B32D3DCB</code><br> <code>3BC3A59E</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<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 98 C2 50 00 9B 9E 64
0010 | 78 02 00 00 5C 07 E8 D0 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 FE 50 02 00 A0 35 2C C0
0040 | 87 EA 1E 38 08 20 F7 C9 46 61 88 32 08 B6 F3 9D
0050 | 47 BA DA 5D C7 2B 94 D7 22 F6 F7 C4 19 4B D2 56
0060 | B0 75 4F BD 65 E2 C2 CA 64 28 AB 69 7A 3C D2 25
0070 | 5C 3C 28 96 7A 0B 83 3C 1B 51 C9 D5 73 F2 DE BC
0080 | B9 AE 8E BF 03 F6 C8 63 55 7D 44 02 7F 39 60 8B
0090 | 2C A0 2F C9 8F EF CD 0C 1F 31 54 95 E7 EC C8 B1
00A0 | 7A 33 47 D6 6C FD E0 35 3D E7 EB 42 1F E0 63 B0
00B0 | C2 E4 85 DC 3E F6 EB 7B AE 57 4B 21 DD DB F7 D2
00C0 | 73 BF D0 8B 0A 17 CF B9 34 0D D2 C9 C4 B6 FF F2
00D0 | 4E 02 DE 47 32 22 D0 86 9E D1 A2 2E C6 59 3F 3A
00E0 | 6E B6 55 07 2A CA B4 54 DC 17 33 A8 BA 64 A2 FA
00F0 | FC B9 67 9D 8F 1A 43 20 4C BB F3 59 60 5A FB A7
0100 | 7F 4F 4B 89 86 D8 A8 4B 35 76 83 38 09 78 BB 66
0110 | F7 15 8C 5A 89 ED 75 B1 07 99 8E 89 51 6D D9 33
0120 | DE DE 35 D2 FA 4F 53 DF 49 29 54 1B 45 26 FB 13
0130 | 49 38 1F 96 A8 57 EE FB 9D F2 65 84 FF 51 6F D0
0140 | 6B 23 67 96 0A 4E 38 6D 7D FA 06 7E 60 30 41 DB
0150 | 1A BD 27 48 28 BD 3D 5F B7 43 6D B2 B1 C2 5D 81
0160 | 05 F2 10 8A 48 AE 0B F4 19 65 24 E6 83 EC 10 CC
0170 | 3A B8 CD 58 35 8C 02 AC 41 D9 26 FF 1E CD 4A 5F
0180 | 19 36 98 6B C9 73 21 BD 4C 88 ED 7B 5F 09 4B 1E
0190 | 70 B7 2B 5E FC 1D 86 E9 82 43 05 19 52 35 F0 E0
01A0 | 66 F2 DF A0 BB D2 48 8C C8 8B B5 7A C7 89 59 59
01B0 | CB 1A FE BF B0 36 FB 92 00 E8 44 D2 60 31 A1 4A
01C0 | BB F5 18 B0 89 3A FA 4C 29 D7 B0 6C 69 0D 5A 7F
01D0 | D3 16 CC 92 08 17 D4 5E 7E FE BF EB B5 89 BA 99
01E0 | F4 10 40 93 29 6E 99 99 B0 9E A6 6A 72 67 9A DD
01F0 | BA CE C3 63 D1 50 E1 6D FB 8D 51 C4 6E 19 50 5D
0200 | C1 53 97 32 DD D3 CF F3 51 BD CE B2 8A D3 79 3C
0210 | 0D A3 08 D1 2A 31 3B D7 D2 66 BB BA 88 76 5E 20
0220 | F3 39 22 08 58 43 97 68 07 2F 26 C4 AB EC CE 48
0230 | A5 F8 99 C5 26 E5 26 6F 7A 4A 4E F2 F3 B0 8B 5F
0240 | 53 AB 6B 45 90 F9 E0 DF 8B 44 10 05 C8 0C E4 72
0250 | E2 68 31 F8 64 E0 A9 CE 06 C9 DF FE C4 E6 01 3A
0260 | 26 B8 23 A8 3B A4 64 3D 5F DD B6 DE EA F7 5D A3
0270 | 0C 87 AB FE 29 F4 71 DD 82 7B 39 9C 6E C5 9D 98
0280 | CE EE 1F D4 30 19 63 95 88 5F DB F9</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 4C 6E 1E 51 3D C5 65
0010 | C4 02 00 00 5C 07 E8 D0 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 FE 50 02 00 6A D7 DD 5D
0040 | 8B 25 26 C7 61 AB E5 0E 93 C8 2A 6F 33 1B 1E AE
0050 | 0A D0 11 89 3D A9 76 E3 77 1D 4A A4 52 09 D2 34
0060 | FE A6 56 42 98 53 86 B8 17 BF 89 80 F5 17 F6 D3
0070 | 2D BE B4 7E 34 53 45 56 F9 50 DD F9 60 DB 72 1A
0080 | 48 48 02 31 61 91 61 11 26 82 C6 04 6D 56 29 C7
0090 | 1C D1 EC 80 61 DF CD D7 04 70 3E C7 A8 AE BD CB
00A0 | D1 59 57 9F C8 88 6D 9F A5 1E 00 9A F4 9B 5A B9
00B0 | 0C 76 28 EB 81 C9 78 8A 2E B6 AC 0E 75 7A 7D EB
00C0 | E3 D9 49 F8 0A 99 0B ED B4 D2 DB AE 43 F0 03 28
00D0 | B8 2F 4D 8F C8 3A 9B 9C FE EF 46 7E 15 93 BB 45
00E0 | 79 EE 32 41 2F 16 7A 78 0C FA 51 76 50 BD 0E B5
00F0 | 1C BF B5 0E 3A FE 97 88 39 46 61 31 FC D9 56 71
0100 | 1E 63 61 4F 00 6A 55 ED 35 ED 2B 1F 83 3C 29 F4
0110 | FD 7A 84 F0 C8 F1 C1 0D FC 1A 1A AF 9A 8A 57 10
0120 | 8D EC F2 06 E3 96 84 06 F0 FB 25 E9 22 DF 15 4F
0130 | 49 7B 51 52 7E 48 34 20 2F AB 47 7A 13 7D 0A 99
0140 | D1 C3 47 19 6F BA 10 69 9F 52 EA 56 F0 1E F9 38
0150 | 29 B3 10 A5 C9 7D B9 5F D5 7E 64 41 7E 52 6E B9
0160 | 20 D2 61 15 7C 6E 38 79 1B DD 53 89 EE B7 44 E0
0170 | 75 D9 52 DB 33 A8 15 12 07 D0 AB 3C 62 9E 30 A7
0180 | 23 A5 20 5F 8F A1 83 98 93 7E D2 71 4A 4E 76 A5
0190 | F4 51 25 08 A4 BE 1B 4D 6A E4 6F D1 56 C6 F0 63
01A0 | 47 AF 5E 07 CE 49 27 91 95 13 3B 07 CC E4 BC 67
01B0 | 75 D8 8F 36 11 18 0D 23 C4 C7 09 46 61 9A D7 59
01C0 | AB 9F 18 3A 38 5C CF 9B F1 93 15 FA DB E8 A4 FD
01D0 | C7 48 AF 52 DF 93 03 45 90 9C 87 0D E4 B4 89 01
01E0 | E9 F9 0E 56 D7 4C A5 34 D8 E1 FE 3A 35 A9 2A 18
01F0 | D6 76 95 8E B8 FC 3D 82 F9 CE E3 08 DF 2A 9E 4C
0200 | CD 23 FF 89 EA 25 5B 9E ED BC 33 78 14 88 79 66
0210 | 6F FC 2E 19 A4 31 CB B5 7A E1 A0 10 FF E5 CB 39
0220 | AB F1 31 AD D9 E9 0B F9 69 A1 12 C4 35 50 9B 78
0230 | 96 0E 0B 20 03 1C 82 21 90 84 15 61 E8 39 04 46
0240 | 22 76 60 BB AC CF 3D 53 57 4B FB A3 3B F4 76 E3
0250 | BD C9 EB 68 0A A2 A1 7F D6 75 6F 65 27 25 ED 03
0260 | 13 E5 EB 0F D6 A9 C8 C9 49 EE FB E8 09 A8 93 11
0270 | BF 20 F4 00 55 CA 25 FD 16 9D C1 3E E1 4B 31 50
0280 | 92 FD E4 18 46 38 D8 49 68 2F D8 62</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,13 +464,13 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0198C250009B9E64</code></td>
<td><code>014C6E1E513DC565</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>78020000</code> (632 in decimal)</td>
<td><code>C4020000</code> (708 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200A0352CC087EA1E380820F7C9</code> <code>4661883208B6F39D47BADA5DC72B94D7</code> <code>22F6F7C4194BD256B0754FBD65E2C2CA</code> <code>6428AB697A3CD2255C3C28967A0B833C</code> <code>1B51C9D573F2DEBCB9AE8EBF03F6C863</code> <code>557D44027F39608B2CA02FC98FEFCD0C</code> <code>1F315495E7ECC8B17A3347D66CFDE035</code> <code>3DE7EB421FE063B0C2E485DC3EF6EB7B</code> <code>AE574B21DDDBF7D273BFD08B0A17CFB9</code> <code>340DD2C9C4B6FFF24E02DE473222D086</code> <code>9ED1A22EC6593F3A6EB655072ACAB454</code> <code>DC1733A8BA64A2FAFCB9679D8F1A4320</code> <code>4CBBF359605AFBA77F4F4B8986D8A84B</code> <code>357683380978BB66F7158C5A89ED75B1</code> <code>07998E89516DD933DEDE35D2FA4F53DF</code> <code>4929541B4526FB1349381F96A857EEFB</code> <code>9DF26584FF516FD06B2367960A4E386D</code> <code>7DFA067E603041DB1ABD274828BD3D5F</code> <code>B7436DB2B1C25D8105F2108A48AE0BF4</code> <code>196524E683EC10CC3AB8CD58358C02AC</code> <code>41D926FF1ECD4A5F1936986BC97321BD</code> <code>4C88ED7B5F094B1E70B72B5EFC1D86E9</code> <code>824305195235F0E066F2DFA0BBD2488C</code> <code>C88BB57AC7895959CB1AFEBFB036FB92</code> <code>00E844D26031A14ABBF518B0893AFA4C</code> <code>29D7B06C690D5A7FD316CC920817D45E</code> <code>7EFEBFEBB589BA99F4104093296E9999</code> <code>B09EA66A72679ADDBACEC363D150E16D</code> <code>FB8D51C46E19505DC1539732DDD3CFF3</code> <code>51BDCEB28AD3793C0DA308D12A313BD7</code> <code>D266BBBA88765E20F339220858439768</code> <code>072F26C4ABECCE48A5F899C526E5266F</code> <code>7A4A4EF2F3B08B5F53AB6B4590F9E0DF</code> <code>8B441005C80CE472E26831F864E0A9CE</code> <code>06C9DFFEC4E6013A26B823A83BA4643D</code> <code>5FDDB6DEEAF75DA30C87ABFE29F471DD</code> <code>827B399C6EC59D98CEEE1FD430196395</code><br> <code>885FDBF9</code></td>
<td><code>FE5002006AD7DD5D8B2526C761ABE50E</code> <code>93C82A6F331B1EAE0AD011893DA976E3</code> <code>771D4AA45209D234FEA65642985386B8</code> <code>17BF8980F517F6D32DBEB47E34534556</code> <code>F950DDF960DB721A4848023161916111</code> <code>2682C6046D5629C71CD1EC8061DFCDD7</code> <code>04703EC7A8AEBDCBD159579FC8886D9F</code> <code>A51E009AF49B5AB90C7628EB81C9788A</code> <code>2EB6AC0E757A7DEBE3D949F80A990BED</code> <code>B4D2DBAE43F00328B82F4D8FC83A9B9C</code> <code>FEEF467E1593BB4579EE32412F167A78</code> <code>0CFA517650BD0EB51CBFB50E3AFE9788</code> <code>39466131FCD956711E63614F006A55ED</code> <code>35ED2B1F833C29F4FD7A84F0C8F1C10D</code> <code>FC1A1AAF9A8A57108DECF206E3968406</code> <code>F0FB25E922DF154F497B51527E483420</code> <code>2FAB477A137D0A99D1C347196FBA1069</code> <code>9F52EA56F01EF93829B310A5C97DB95F</code> <code>D57E64417E526EB920D261157C6E3879</code> <code>1BDD5389EEB744E075D952DB33A81512</code> <code>07D0AB3C629E30A723A5205F8FA18398</code> <code>937ED2714A4E76A5F4512508A4BE1B4D</code> <code>6AE46FD156C6F06347AF5E07CE492791</code> <code>95133B07CCE4BC6775D88F3611180D23</code> <code>C4C70946619AD759AB9F183A385CCF9B</code> <code>F19315FADBE8A4FDC748AF52DF930345</code> <code>909C870DE4B48901E9F90E56D74CA534</code> <code>D8E1FE3A35A92A18D676958EB8FC3D82</code> <code>F9CEE308DF2A9E4CCD23FF89EA255B9E</code> <code>EDBC3378148879666FFC2E19A431CBB5</code> <code>7AE1A010FFE5CB39ABF131ADD9E90BF9</code> <code>69A112C435509B78960E0B20031C8221</code> <code>90841561E8390446227660BBACCF3D53</code> <code>574BFBA33BF476E3BDC9EB680AA2A17F</code> <code>D6756F652725ED0313E5EB0FD6A9C8C9</code> <code>49EEFBE809A89311BF20F40055CA25FD</code> <code>169DC13EE14B315092FDE4184638D849</code><br> <code>682FD862</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<!-- 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 = A0352CC087EA1E380820F7C94661883208B6F39D47BADA5DC72B94D722F6F7C4194BD256B0754FBD65E2C2CA6428AB697A3CD2255C3C28967A0B833C1B51C9D573F2DEBCB9AE8EBF03F6C863557D44027F39608B2CA02FC98FEFCD0C1F315495E7ECC8B17A3347D66CFDE0353DE7EB421FE063B0C2E485DC3EF6EB7BAE574B21DDDBF7D273BFD08B0A17CFB9340DD2C9C4B6FFF24E02DE473222D0869ED1A22EC6593F3A6EB655072ACAB454DC1733A8BA64A2FAFCB9679D8F1A43204CBBF359605AFBA77F4F4B8986D8A84B357683380978BB66F7158C5A89ED75B107998E89516DD933DEDE35D2FA4F53DF4929541B4526FB1349381F96A857EEFB9DF26584FF516FD06B2367960A4E386D7DFA067E603041DB1ABD274828BD3D5FB7436DB2B1C25D8105F2108A48AE0BF4196524E683EC10CC3AB8CD58358C02AC41D926FF1ECD4A5F1936986BC97321BD4C88ED7B5F094B1E70B72B5EFC1D86E9824305195235F0E066F2DFA0BBD2488CC88BB57AC7895959CB1AFEBFB036FB9200E844D26031A14ABBF518B0893AFA4C29D7B06C690D5A7FD316CC920817D45E7EFEBFEBB589BA99F4104093296E9999B09EA66A72679ADDBACEC363D150E16DFB8D51C46E19505DC1539732DDD3CFF351BDCEB28AD3793C0DA308D12A313BD7D266BBBA88765E20F339220858439768072F26C4ABECCE48A5F899C526E5266F7A4A4EF2F3B08B5F53AB6B4590F9E0DF8B441005C80CE472E26831F864E0A9CE06C9DFFEC4E6013A26B823A83BA4643D5FDDB6DEEAF75DA30C87ABFE29F471DD827B399C6EC59D98CEEE1FD430196395885FDBF9
tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</code></pre>
<pre><code>encrypted_answer = 6AD7DD5D8B2526C761ABE50E93C82A6F331B1EAE0AD011893DA976E3771D4AA45209D234FEA65642985386B817BF8980F517F6D32DBEB47E34534556F950DDF960DB721A48480231619161112682C6046D5629C71CD1EC8061DFCDD704703EC7A8AEBDCBD159579FC8886D9FA51E009AF49B5AB90C7628EB81C9788A2EB6AC0E757A7DEBE3D949F80A990BEDB4D2DBAE43F00328B82F4D8FC83A9B9CFEEF467E1593BB4579EE32412F167A780CFA517650BD0EB51CBFB50E3AFE978839466131FCD956711E63614F006A55ED35ED2B1F833C29F4FD7A84F0C8F1C10DFC1A1AAF9A8A57108DECF206E3968406F0FB25E922DF154F497B51527E4834202FAB477A137D0A99D1C347196FBA10699F52EA56F01EF93829B310A5C97DB95FD57E64417E526EB920D261157C6E38791BDD5389EEB744E075D952DB33A8151207D0AB3C629E30A723A5205F8FA18398937ED2714A4E76A5F4512508A4BE1B4D6AE46FD156C6F06347AF5E07CE49279195133B07CCE4BC6775D88F3611180D23C4C70946619AD759AB9F183A385CCF9BF19315FADBE8A4FDC748AF52DF930345909C870DE4B48901E9F90E56D74CA534D8E1FE3A35A92A18D676958EB8FC3D82F9CEE308DF2A9E4CCD23FF89EA255B9EEDBC3378148879666FFC2E19A431CBB57AE1A010FFE5CB39ABF131ADD9E90BF969A112C435509B78960E0B20031C822190841561E8390446227660BBACCF3D53574BFBA33BF476E3BDC9EB680AA2A17FD6756F652725ED0313E5EB0FD6A9C8C949EEFBE809A89311BF20F40055CA25FD169DC13EE14B315092FDE4184638D849682FD862
tmp_aes_key = 5EA702F743E850F5546E857F08B7D5337BBAEDF9B61248751594851BE2E8C297
tmp_aes_iv = 1CEF8E372A63D97EBFA805C0DBB018BC7C1E0931693FBCB1A1AFC0C0A8BBC849</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 46A914334DFF3DF06D9A1E5330BF60A105E40B07BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B
answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B</code></pre>
<pre><code>answer_with_hash = 60026275CC91DDEC5371C67B10331C4C1D362585BA0D89B5406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF01994303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A77200BDFF6E6C4C126A2C41DF310AB3A3BDBD698CD480749E1F3C64FB1CFC9DFC70AC6F1AA671019620A640055B2CF7D7D99CC86533645C0FA000954DE2987BAD68D7450CF134C9F0305F34C1BB285DA8233F65970A01C4BD3AFD5EA3CD5864B8F1DCB35D5E9737DF15063C54CF53048EF519A280498DDDAF23764F29FFB0C5813CAAD90C319BE8592B78C4BE815E65ADA7C62EA23754B5A2C5A86C4721872D0CC48E0F895C3EBE186E81E5F0E88A6B3F09101C409AF3410B64238FBF2A2095E3F3B7FFC7EB3A02A319B99A155647BC59958BCDFED8A1CC6EB7F13F8600E521D9D0247B0F639F2FA3B09F72987781F71C0E8AA950167DE5092380B4853E7F1513DC565C26F8049523E89D2
answer = BA0D89B5406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF01994303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A77200BDFF6E6C4C126A2C41DF310AB3A3BDBD698CD480749E1F3C64FB1CFC9DFC70AC6F1AA671019620A640055B2CF7D7D99CC86533645C0FA000954DE2987BAD68D7450CF134C9F0305F34C1BB285DA8233F65970A01C4BD3AFD5EA3CD5864B8F1DCB35D5E9737DF15063C54CF53048EF519A280498DDDAF23764F29FFB0C5813CAAD90C319BE8592B78C4BE815E65ADA7C62EA23754B5A2C5A86C4721872D0CC48E0F895C3EBE186E81E5F0E88A6B3F09101C409AF3410B64238FBF2A2095E3F3B7FFC7EB3A02A319B99A155647BC59958BCDFED8A1CC6EB7F13F8600E521D9D0247B0F639F2FA3B09F72987781F71C0E8AA950167DE5092380B4853E7F1513DC565C26F8049523E89D2</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 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | EF 43 97 39 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 40 67 09 F6 12 FA DF BE C3 F0 28 9D
0010 | 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2 61 54 F9 32
0020 | AF 01 99 43 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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
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 | 35 D6 63 91 75 B1 FF 6E 0A C4 01 89 37 0B 30 67
0140 | AF 8D 52 CE A7 08 7E 49 E0 17 07 B5 E6 11 2C B3
0150 | 33 27 26 7B D5 26 CD CD 1E 97 1B 04 88 E8 C9 35
0160 | 10 E8 60 49 B2 5F 64 01 70 B0 2B DE 60 9E 83 05
0170 | 0E 5F AB 06 54 C0 38 37 E7 83 20 18 15 2B 11 92
0180 | 8E 0F 2E 4C 33 27 DB E2 71 7E 12 3C C5 99 4E A0
0190 | A6 03 4C ED 7E AD 34 D9 9C A9 0D 89 40 B2 06 58
01A0 | 97 EB F6 17 B9 B1 66 2E 68 20 53 CD C7 5A 31 FD
01B0 | 6D 7B 27 B1 B8 FE 86 8C 81 39 75 2A 48 48 A5 49
01C0 | 3D FC 71 47 70 09 E0 65 3D 18 50 51 A7 D6 F6 C3
01D0 | A5 9C 2A 89 EC 8B 9B CD D8 7C B8 49 89 3D 70 92
01E0 | 61 D6 90 E3 84 35 65 DE B1 9B 76 B2 1F B8 A0 A2
01F0 | 8D E3 BE A1 98 69 F1 D7 33 46 90 9D 17 66 6F 94
0200 | 77 80 77 C5 99 76 11 76 24 85 36 A8 BB 94 4F 4F
0210 | 73 C3 66 BF 70 A0 4D 13 32 6D 22 79 99 E1 46 C8
0220 | 30 A4 73 FC 9B 1F 35 25 26 3F E3 0B 7D 82 C2 B7
0230 | 00 9B 9E 64</code></pre>
0130 | 0A 77 20 0B DF F6 E6 C4 C1 26 A2 C4 1D F3 10 AB
0140 | 3A 3B DB D6 98 CD 48 07 49 E1 F3 C6 4F B1 CF C9
0150 | DF C7 0A C6 F1 AA 67 10 19 62 0A 64 00 55 B2 CF
0160 | 7D 7D 99 CC 86 53 36 45 C0 FA 00 09 54 DE 29 87
0170 | BA D6 8D 74 50 CF 13 4C 9F 03 05 F3 4C 1B B2 85
0180 | DA 82 33 F6 59 70 A0 1C 4B D3 AF D5 EA 3C D5 86
0190 | 4B 8F 1D CB 35 D5 E9 73 7D F1 50 63 C5 4C F5 30
01A0 | 48 EF 51 9A 28 04 98 DD DA F2 37 64 F2 9F FB 0C
01B0 | 58 13 CA AD 90 C3 19 BE 85 92 B7 8C 4B E8 15 E6
01C0 | 5A DA 7C 62 EA 23 75 4B 5A 2C 5A 86 C4 72 18 72
01D0 | D0 CC 48 E0 F8 95 C3 EB E1 86 E8 1E 5F 0E 88 A6
01E0 | B3 F0 91 01 C4 09 AF 34 10 B6 42 38 FB F2 A2 09
01F0 | 5E 3F 3B 7F FC 7E B3 A0 2A 31 9B 99 A1 55 64 7B
0200 | C5 99 58 BC DF ED 8A 1C C6 EB 7F 13 F8 60 0E 52
0210 | 1D 9D 02 47 B0 F6 39 F2 FA 3B 09 F7 29 87 78 1F
0220 | 71 C0 E8 AA 95 01 67 DE 50 92 38 0B 48 53 E7 F1
0230 | 51 3D C5 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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010035D6639175B1FF6E0AC40189</code> <code>370B3067AF8D52CEA7087E49E01707B5</code> <code>E6112CB33327267BD526CDCD1E971B04</code> <code>88E8C93510E86049B25F640170B02BDE</code> <code>609E83050E5FAB0654C03837E7832018</code> <code>152B11928E0F2E4C3327DBE2717E123C</code> <code>C5994EA0A6034CED7EAD34D99CA90D89</code> <code>40B2065897EBF617B9B1662E682053CD</code> <code>C75A31FD6D7B27B1B8FE868C8139752A</code> <code>4848A5493DFC71477009E0653D185051</code> <code>A7D6F6C3A59C2A89EC8B9BCDD87CB849</code> <code>893D709261D690E3843565DEB19B76B2</code> <code>1FB8A0A28DE3BEA19869F1D73346909D</code> <code>17666F94778077C599761176248536A8</code> <code>BB944F4F73C366BF70A04D13326D2279</code> <code>99E146C830A473FC9B1F3525263FE30B</code><br> <code>7D82C2B7</code></td>
<td><code>FE0001000A77200BDFF6E6C4C126A2C4</code> <code>1DF310AB3A3BDBD698CD480749E1F3C6</code> <code>4FB1CFC9DFC70AC6F1AA671019620A64</code> <code>0055B2CF7D7D99CC86533645C0FA0009</code> <code>54DE2987BAD68D7450CF134C9F0305F3</code> <code>4C1BB285DA8233F65970A01C4BD3AFD5</code> <code>EA3CD5864B8F1DCB35D5E9737DF15063</code> <code>C54CF53048EF519A280498DDDAF23764</code> <code>F29FFB0C5813CAAD90C319BE8592B78C</code> <code>4BE815E65ADA7C62EA23754B5A2C5A86</code> <code>C4721872D0CC48E0F895C3EBE186E81E</code> <code>5F0E88A6B3F09101C409AF3410B64238</code> <code>FBF2A2095E3F3B7FFC7EB3A02A319B99</code> <code>A155647BC59958BCDFED8A1CC6EB7F13</code> <code>F8600E521D9D0247B0F639F2FA3B09F7</code> <code>2987781F71C0E8AA950167DE5092380B</code><br> <code>4853E7F1</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>009B9E64</code> (1688115968 in decimal)</td>
<td><code>513DC565</code> (1707425105 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<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 = F7C5CD46D4A88DED59C1B412D39FEC78BD86A6DC2BF2C5C5D8AF305204158F14B3244D42FFCF2363DC0D25DC6C48A16A3A0E63813D9E87442CA3C2CF84DF848C540531FCDBAD8290A6B25E021EB9AAEEB702F6FB31DC39C48EF615BB0CBBEDE1958D8BF5DCC205CBED3A9DFCD597115163A131DFD4939E68EB2C6F097A5632A3773D5201783A3B6CDE805794F5CBEEFD9FCB8DEAEAD1C5BCADD6366C8A907FABE99A026E59E8521085CE6130123E80B72DFD5EF3D2C0BC880F52DEEF7404638D8053D464036BF7057A77BE75EDA78D3C82221BB131FE6ECB8C43F77DF1D04935F978BA40F3F59385D6D6C2E7782BFFB040AB60F28459EB68A42A904B55E8088C</code></pre>
<pre><code>b = 1376A5A6BF7A9F874B47028F3D5CFF0689FD52F58949BB0EE9BACDBE81DD1CED07101844EB6F2AE19E61120B84799431F445785E33A18141399821479AE96786E0F4E9C5C6C9E46BF562C21C96B0F8F7438C8CABA3DFCB3DD3B886C2A37B95ED804315335C0DDFFEB3A278243D89F964278BC734D1087D6D4B554C1F78397A414F440E38BA9A4F1211B20AE835437762F81A45FDB035BB2220D939693084B39A3C7BE2481309AB9AE378EAB8BB3A15A69EBA80BEF683582E2218FA604E823EABD111553D31DBB46B9383A0D8EEF615FFF9CF266C970800AA28AC5E962D20351311A815FFA7562989CA6D6323BF2B5AF40EF3F45021B7445664852D07B80172CE</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 = 2545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1</code></pre>
<pre><code>g_b = A215D057BC6648453D68C2F418A38D9D4F4FA47E5D520AC7EBC2ADC3B00075090C10A1E9D96A5DDA127317F2DDC165C5F6C8C2854648C106D0D9DF684DAE70B0E6021658806245B494B762B1979E8BD597B5CC8E43A80F96CA47FB0765C98D40529F3D94C82113AE32C603AA24411EF8B330565A1D66EA6B89C9D4F8AFFEEA397C4B247564215D147B6AD0DF7F3FB4499E89E34304531D87448B91967B5BD53093F09386C0F78940C1DD6AA7C8667E15857453E6AAD275F94CD386468CF49108FB7C54282596A4D0314DCE9EFED4066A6E072471439AEAAA74157DB7DD53F01982982534DEE8740610BA433BF459B3DFE38674561F31991CE007BA112DDA6718</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 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | EF 43 97 39 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 25 45 CE 89 DA D1 4B DF 0F 1E 2E 34 F3 66 12 44
0040 | 74 E2 21 B5 C2 01 9C F5 24 06 12 B8 17 98 31 1E
0050 | 9E D3 32 01 DE 78 EA 34 B5 9D C0 15 1E 4C F8 20
0060 | DE EC 38 50 E1 B0 81 14 B7 59 9A 1C 99 F2 8A 85
0070 | 23 4A BC F8 DC 8B E8 AB 0C D1 01 9E C5 6A B7 BB
0080 | 2E 05 F0 7B 76 56 33 8B E2 54 AB B2 F4 5A D4 2A
0090 | 86 84 8E 60 2B 04 A6 B9 CC 92 62 78 0D 4F 87 50
00A0 | 5A 8B 17 19 1F 53 E7 2B DB 00 AB 29 0B 76 81 0E
00B0 | B1 5C 87 31 83 D7 2E C3 D2 CB 41 1C 3F 4B DC 79
00C0 | 44 E1 CA BF 55 71 B1 52 F7 FC 3C A1 DA 47 09 77
00D0 | 32 9D C4 98 54 BA 62 A8 5A E7 64 5F EC BD 81 83
00E0 | B5 A4 AA D0 6D FC 56 D4 BA 61 06 F8 1A 45 BE F3
00F0 | 2A 9E 4F 56 A2 13 FB 2A 02 7B 3A CD FD DD E6 A6
0100 | D5 7E 68 35 2C 82 F7 C0 D2 10 8F C0 10 72 59 29
0110 | CB 7C 88 EE 73 7F 7B 49 8D 86 13 4C 7C 7F 26 26
0120 | F0 35 70 67 A0 78 13 C0 D3 F2 C8 68 76 CC 1F F1</code></pre>
<pre><code>0000 | 54 B6 43 66 40 67 09 F6 12 FA DF BE C3 F0 28 9D
0010 | 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2 61 54 F9 32
0020 | AF 01 99 43 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | A2 15 D0 57 BC 66 48 45 3D 68 C2 F4 18 A3 8D 9D
0040 | 4F 4F A4 7E 5D 52 0A C7 EB C2 AD C3 B0 00 75 09
0050 | 0C 10 A1 E9 D9 6A 5D DA 12 73 17 F2 DD C1 65 C5
0060 | F6 C8 C2 85 46 48 C1 06 D0 D9 DF 68 4D AE 70 B0
0070 | E6 02 16 58 80 62 45 B4 94 B7 62 B1 97 9E 8B D5
0080 | 97 B5 CC 8E 43 A8 0F 96 CA 47 FB 07 65 C9 8D 40
0090 | 52 9F 3D 94 C8 21 13 AE 32 C6 03 AA 24 41 1E F8
00A0 | B3 30 56 5A 1D 66 EA 6B 89 C9 D4 F8 AF FE EA 39
00B0 | 7C 4B 24 75 64 21 5D 14 7B 6A D0 DF 7F 3F B4 49
00C0 | 9E 89 E3 43 04 53 1D 87 44 8B 91 96 7B 5B D5 30
00D0 | 93 F0 93 86 C0 F7 89 40 C1 DD 6A A7 C8 66 7E 15
00E0 | 85 74 53 E6 AA D2 75 F9 4C D3 86 46 8C F4 91 08
00F0 | FB 7C 54 28 25 96 A4 D0 31 4D CE 9E FE D4 06 6A
0100 | 6E 07 24 71 43 9A EA AA 74 15 7D B7 DD 53 F0 19
0110 | 82 98 25 34 DE E8 74 06 10 BA 43 3B F4 59 B3 DF
0120 | E3 86 74 56 1F 31 99 1C E0 07 BA 11 2D DA 67 18</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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001002545CE89DAD14BDF0F1E2E34</code> <code>F366124474E221B5C2019CF5240612B8</code> <code>1798311E9ED33201DE78EA34B59DC015</code> <code>1E4CF820DEEC3850E1B08114B7599A1C</code> <code>99F28A85234ABCF8DC8BE8AB0CD1019E</code> <code>C56AB7BB2E05F07B7656338BE254ABB2</code> <code>F45AD42A86848E602B04A6B9CC926278</code> <code>0D4F87505A8B17191F53E72BDB00AB29</code> <code>0B76810EB15C873183D72EC3D2CB411C</code> <code>3F4BDC7944E1CABF5571B152F7FC3CA1</code> <code>DA470977329DC49854BA62A85AE7645F</code> <code>ECBD8183B5A4AAD06DFC56D4BA6106F8</code> <code>1A45BEF32A9E4F56A213FB2A027B3ACD</code> <code>FDDDE6A6D57E68352C82F7C0D2108FC0</code> <code>10725929CB7C88EE737F7B498D86134C</code> <code>7C7F2626F0357067A07813C0D3F2C868</code><br> <code>76CC1FF1</code></td>
<td><code>FE000100A215D057BC6648453D68C2F4</code> <code>18A38D9D4F4FA47E5D520AC7EBC2ADC3</code> <code>B00075090C10A1E9D96A5DDA127317F2</code> <code>DDC165C5F6C8C2854648C106D0D9DF68</code> <code>4DAE70B0E6021658806245B494B762B1</code> <code>979E8BD597B5CC8E43A80F96CA47FB07</code> <code>65C98D40529F3D94C82113AE32C603AA</code> <code>24411EF8B330565A1D66EA6B89C9D4F8</code> <code>AFFEEA397C4B247564215D147B6AD0DF</code> <code>7F3FB4499E89E34304531D87448B9196</code> <code>7B5BD53093F09386C0F78940C1DD6AA7</code> <code>C8667E15857453E6AAD275F94CD38646</code> <code>8CF49108FB7C54282596A4D0314DCE9E</code> <code>FED4066A6E072471439AEAAA74157DB7</code> <code>DD53F01982982534DEE8740610BA433B</code> <code>F459B3DFE38674561F31991CE007BA11</code><br> <code>2DDA6718</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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<!-- 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 = 54B64366DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390000000000000000FE0001002545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1
padding = BD8A6AC82FFB68885A48E0ED
tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</code></pre>
<pre><code>data = 54B64366406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF0199430000000000000000FE000100A215D057BC6648453D68C2F418A38D9D4F4FA47E5D520AC7EBC2ADC3B00075090C10A1E9D96A5DDA127317F2DDC165C5F6C8C2854648C106D0D9DF684DAE70B0E6021658806245B494B762B1979E8BD597B5CC8E43A80F96CA47FB0765C98D40529F3D94C82113AE32C603AA24411EF8B330565A1D66EA6B89C9D4F8AFFEEA397C4B247564215D147B6AD0DF7F3FB4499E89E34304531D87448B91967B5BD53093F09386C0F78940C1DD6AA7C8667E15857453E6AAD275F94CD386468CF49108FB7C54282596A4D0314DCE9EFED4066A6E072471439AEAAA74157DB7DD53F01982982534DEE8740610BA433BF459B3DFE38674561F31991CE007BA112DDA6718
padding = 74876952857BA6AAA495A20D
tmp_aes_key = 5EA702F743E850F5546E857F08B7D5337BBAEDF9B61248751594851BE2E8C297
tmp_aes_iv = 1CEF8E372A63D97EBFA805C0DBB018BC7C1E0931693FBCB1A1AFC0C0A8BBC849</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 = E3B5716AC2E86342AD2E8C7B75FD17C713CE5C8559659F8301258D63D9101D1DB99EA9C1909315495C8776FD7885CA40AB860F38C8BD946F90CCEC63F3ED2A5A8F06F4E45BFDD0CC4A626AF74C299623B64E8E384BB7A66C36483EA667CE513FB5C2B9C7C635206E824F6BFC45A259CE0692745EBF3FDE3DEE350903FC0E2FF821DAECDF333B23F77866A444E2AC3B1BC8CC2EA38D4C2C3FF375FF70CFAF76E35BE863D54969CF4A887C8D6223874017B4B509CF3DE096E288512FBEF295D4DE4CC3CA6EAEA779B07100D8CC9E2EF7A6B40575CCC5EC93E32E7F8E4FD7332737F3B179573B4BEC13ABD868CC06A725ECFFC29494FE6AFFD3CEF2DE94681D4A3F19DDE0CF9BB0F13974443EA04D6CE173E0655BAFC847B5D55393BE982E00903B557B61FB38F15A88CADA345BC8B7820BB1C051C0A8B13AE70A5479E87D6BCA8A7AA73C306AF0FACD6760C566014DE790</code></pre>
<pre><code>encrypted_data = 14D185E575255986C29BE3A0437D525BA22430CBA0CD755225945AD3A1ACEFB536518514F5086892E6E3FA84D1CBB644BC8F7BEBCDE74E31BA8A073F47623EBB6E7D94B3A676A4C1AFD4689C52D05F73D21C33F64FE6AEABD04273D9117CD064E467E1F8E6C887BCAE4679E0399AD35DB1302A80629618F8C8485248D89A4E3568B464FF7B608CBE24B51EEB81B65D76224B62A1669EAA48A99C122E5E8A778E13DD441DC52175160088A498F186A2B99C736FE8C5C3E274D804C629564A0F15DDABC5B449356A7990900652A7432AFB1499C7CE09246F6B29006425DF2926465B04F17C0077B6A336A50E46B675AD5607F05818F84EADEC1F4847BF311027E742F8B1E183C01810C4CE964F2A0F36E257849C144C9B0B93B4A7A9E57391DB0CCB0D757A2B7A77257C8FF55553D66B6E1D45E9D8CA88E5A47B16322FF2ED5F5ABE099E7006B2D29C829D746B704130B1</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 30 0F 00 00 9B 9E 64
0010 | 78 01 00 00 1F 5F 04 F5 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 FE 50 01 00 E3 B5 71 6A
0040 | C2 E8 63 42 AD 2E 8C 7B 75 FD 17 C7 13 CE 5C 85
0050 | 59 65 9F 83 01 25 8D 63 D9 10 1D 1D B9 9E A9 C1
0060 | 90 93 15 49 5C 87 76 FD 78 85 CA 40 AB 86 0F 38
0070 | C8 BD 94 6F 90 CC EC 63 F3 ED 2A 5A 8F 06 F4 E4
0080 | 5B FD D0 CC 4A 62 6A F7 4C 29 96 23 B6 4E 8E 38
0090 | 4B B7 A6 6C 36 48 3E A6 67 CE 51 3F B5 C2 B9 C7
00A0 | C6 35 20 6E 82 4F 6B FC 45 A2 59 CE 06 92 74 5E
00B0 | BF 3F DE 3D EE 35 09 03 FC 0E 2F F8 21 DA EC DF
00C0 | 33 3B 23 F7 78 66 A4 44 E2 AC 3B 1B C8 CC 2E A3
00D0 | 8D 4C 2C 3F F3 75 FF 70 CF AF 76 E3 5B E8 63 D5
00E0 | 49 69 CF 4A 88 7C 8D 62 23 87 40 17 B4 B5 09 CF
00F0 | 3D E0 96 E2 88 51 2F BE F2 95 D4 DE 4C C3 CA 6E
0100 | AE A7 79 B0 71 00 D8 CC 9E 2E F7 A6 B4 05 75 CC
0110 | C5 EC 93 E3 2E 7F 8E 4F D7 33 27 37 F3 B1 79 57
0120 | 3B 4B EC 13 AB D8 68 CC 06 A7 25 EC FF C2 94 94
0130 | FE 6A FF D3 CE F2 DE 94 68 1D 4A 3F 19 DD E0 CF
0140 | 9B B0 F1 39 74 44 3E A0 4D 6C E1 73 E0 65 5B AF
0150 | C8 47 B5 D5 53 93 BE 98 2E 00 90 3B 55 7B 61 FB
0160 | 38 F1 5A 88 CA DA 34 5B C8 B7 82 0B B1 C0 51 C0
0170 | A8 B1 3A E7 0A 54 79 E8 7D 6B CA 8A 7A A7 3C 30
0180 | 6A F0 FA CD 67 60 C5 66 01 4D E7 90</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 5C 07 00 51 3D C5 65
0010 | 78 01 00 00 1F 5F 04 F5 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 FE 50 01 00 14 D1 85 E5
0040 | 75 25 59 86 C2 9B E3 A0 43 7D 52 5B A2 24 30 CB
0050 | A0 CD 75 52 25 94 5A D3 A1 AC EF B5 36 51 85 14
0060 | F5 08 68 92 E6 E3 FA 84 D1 CB B6 44 BC 8F 7B EB
0070 | CD E7 4E 31 BA 8A 07 3F 47 62 3E BB 6E 7D 94 B3
0080 | A6 76 A4 C1 AF D4 68 9C 52 D0 5F 73 D2 1C 33 F6
0090 | 4F E6 AE AB D0 42 73 D9 11 7C D0 64 E4 67 E1 F8
00A0 | E6 C8 87 BC AE 46 79 E0 39 9A D3 5D B1 30 2A 80
00B0 | 62 96 18 F8 C8 48 52 48 D8 9A 4E 35 68 B4 64 FF
00C0 | 7B 60 8C BE 24 B5 1E EB 81 B6 5D 76 22 4B 62 A1
00D0 | 66 9E AA 48 A9 9C 12 2E 5E 8A 77 8E 13 DD 44 1D
00E0 | C5 21 75 16 00 88 A4 98 F1 86 A2 B9 9C 73 6F E8
00F0 | C5 C3 E2 74 D8 04 C6 29 56 4A 0F 15 DD AB C5 B4
0100 | 49 35 6A 79 90 90 06 52 A7 43 2A FB 14 99 C7 CE
0110 | 09 24 6F 6B 29 00 64 25 DF 29 26 46 5B 04 F1 7C
0120 | 00 77 B6 A3 36 A5 0E 46 B6 75 AD 56 07 F0 58 18
0130 | F8 4E AD EC 1F 48 47 BF 31 10 27 E7 42 F8 B1 E1
0140 | 83 C0 18 10 C4 CE 96 4F 2A 0F 36 E2 57 84 9C 14
0150 | 4C 9B 0B 93 B4 A7 A9 E5 73 91 DB 0C CB 0D 75 7A
0160 | 2B 7A 77 25 7C 8F F5 55 53 D6 6B 6E 1D 45 E9 D8
0170 | CA 88 E5 A4 7B 16 32 2F F2 ED 5F 5A BE 09 9E 70
0180 | 06 B2 D2 9C 82 9D 74 6B 70 41 30 B1</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>E8300F00009B9E64</code></td>
<td><code>185C0700513DC565</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100E3B5716AC2E86342AD2E8C7B</code> <code>75FD17C713CE5C8559659F8301258D63</code> <code>D9101D1DB99EA9C1909315495C8776FD</code> <code>7885CA40AB860F38C8BD946F90CCEC63</code> <code>F3ED2A5A8F06F4E45BFDD0CC4A626AF7</code> <code>4C299623B64E8E384BB7A66C36483EA6</code> <code>67CE513FB5C2B9C7C635206E824F6BFC</code> <code>45A259CE0692745EBF3FDE3DEE350903</code> <code>FC0E2FF821DAECDF333B23F77866A444</code> <code>E2AC3B1BC8CC2EA38D4C2C3FF375FF70</code> <code>CFAF76E35BE863D54969CF4A887C8D62</code> <code>23874017B4B509CF3DE096E288512FBE</code> <code>F295D4DE4CC3CA6EAEA779B07100D8CC</code> <code>9E2EF7A6B40575CCC5EC93E32E7F8E4F</code> <code>D7332737F3B179573B4BEC13ABD868CC</code> <code>06A725ECFFC29494FE6AFFD3CEF2DE94</code> <code>681D4A3F19DDE0CF9BB0F13974443EA0</code> <code>4D6CE173E0655BAFC847B5D55393BE98</code> <code>2E00903B557B61FB38F15A88CADA345B</code> <code>C8B7820BB1C051C0A8B13AE70A5479E8</code> <code>7D6BCA8A7AA73C306AF0FACD6760C566</code><br> <code>014DE790</code></td>
<td><code>FE50010014D185E575255986C29BE3A0</code> <code>437D525BA22430CBA0CD755225945AD3</code> <code>A1ACEFB536518514F5086892E6E3FA84</code> <code>D1CBB644BC8F7BEBCDE74E31BA8A073F</code> <code>47623EBB6E7D94B3A676A4C1AFD4689C</code> <code>52D05F73D21C33F64FE6AEABD04273D9</code> <code>117CD064E467E1F8E6C887BCAE4679E0</code> <code>399AD35DB1302A80629618F8C8485248</code> <code>D89A4E3568B464FF7B608CBE24B51EEB</code> <code>81B65D76224B62A1669EAA48A99C122E</code> <code>5E8A778E13DD441DC52175160088A498</code> <code>F186A2B99C736FE8C5C3E274D804C629</code> <code>564A0F15DDABC5B449356A7990900652</code> <code>A7432AFB1499C7CE09246F6B29006425</code> <code>DF2926465B04F17C0077B6A336A50E46</code> <code>B675AD5607F05818F84EADEC1F4847BF</code> <code>311027E742F8B1E183C01810C4CE964F</code> <code>2A0F36E257849C144C9B0B93B4A7A9E5</code> <code>7391DB0CCB0D757A2B7A77257C8FF555</code> <code>53D66B6E1D45E9D8CA88E5A47B16322F</code> <code>F2ED5F5ABE099E7006B2D29C829D746B</code><br> <code>704130B1</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 = 48892B997A14A133B6D5B234A7F9B19DCE70CB192B9238372639DD6230B1BCC8D31BBBCCFA7F00BBEF38303BAE50FFF3DC814333123CE6E5980EF4493A74F38AD6B05B6737E296ADF4C97C69C95C5EC840BC22694F4CBFC14598B28F83B5CD79FE881F6AB9615226DF63078688371B3CDD2F6E97B35D17E6710E29469E1476B596C1DE136F05D585290776B306D6946B1C33374A459ECB0E9BFBC5A43D145A6B37C276E94C840EA0950B0B2523744CD538817DBA33CD6C84175AEA8561EBA117D2589EFB30A304B0F7AF29FF141E6B3F6F9FA5CEFF31DF1166937EA07D850427B6D779BBAB5B062526D435206EA25158EABC659DE3DC5E4ABF0D93B87B35E5E7</code></pre>
<pre><code>auth_key = ACA2547BAA3B4B3E6AD9129ADEE796042FC4ACAAABA40DCE7A1196640595829E2BA85C5E68E5D2B7B713B28720CCD0E65DA3B80CD8A9282BDE895755B924F4CBBCED119DEE057D3066D7095C25771A53D9AD6EC3464EE0E7FE1A4D9851F17B6CC7D6E636E0BDEA7D66153CF37005835A528E65673C1F5ADAA27465964BA89AA6FD045108B25B1DC9AB2D979864858C9EACBFA4A399CDBF2154D2CC6743C5CAA40683343D80A36C7F1289DC5AC5EE585DEA1E1CD296444EA6CD8F6C3564B2D355B310A3C02608EEA5EC36D38E941BF811489AB7A24C069E44FF54714CB4A45EEE2F310FDDC0A1B08BD3DFF8801E27C8508EFD7AD51EF3C13EF1D9A02EE4601741</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 84 8C 9F 00 9B 9E 64
0010 | 34 00 00 00 34 F7 CB 3B DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 B0 91 C6 77 C6 99 6C 09
0040 | FF 59 F2 F9 AB 28 16 78</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 00 BE 91 51 3D C5 65
0010 | 74 00 00 00 34 F7 CB 3B 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 11 42 87 13 52 16 5E 59
0040 | E1 12 40 36 B4 8B 97 D3</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>01848C9F009B9E64</code></td>
<td><code>0100BE91513DC565</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>34000000</code> (52 in decimal)</td>
<td><code>74000000</code> (116 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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>B091C677C6996C09FF59F2F9AB281678</code></td>
<td><code>1142871352165E59E1124036B48B97D3</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

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>SponsoredWebPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Represents a sponsored website.">
<meta property="og:title" content="SponsoredWebPage">
<meta property="og:image" content="">
<meta property="og:description" content="Represents a sponsored website.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/SponsoredWebPage" >SponsoredWebPage</a></li></ul></div>
<h1 id="dev_page_title">SponsoredWebPage</h1>
<div id="dev_page_content"><p>Represents a sponsored website.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code></code></pre></p>
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
<table class="table">
<thead>
<tr>
<th>Constructor</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/constructor/sponsoredWebPage">sponsoredWebPage</a></td>
<td>Represents a sponsored website.</td>
</tr>
</tbody>
</table></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</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,161 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Messages.WebPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Contains an instant view webpage.">
<meta property="og:title" content="Messages.WebPage">
<meta property="og:image" content="">
<meta property="og:description" content="Contains an instant view webpage.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/messages.WebPage" >Messages.WebPage</a></li></ul></div>
<h1 id="dev_page_title">Messages.WebPage</h1>
<div id="dev_page_content"><p>Contains an instant view webpage.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code></code></pre></p>
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
<table class="table">
<thead>
<tr>
<th>Constructor</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/constructor/messages.webPage">messages.webPage</a></td>
<td>Represents an Instant View webpage.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#methods" id="methods" name="methods"><i class="anchor-icon"></i></a>Methods</h3>
<table class="table">
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/method/messages.getWebPage">messages.getWebPage</a></td>
<td>Get <a href="https://instantview.telegram.org">instant view</a> page</td>
</tr>
</tbody>
</table></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -46,35 +46,36 @@
<p>Interactive <a href="/bots/webapps">HTML5 Mini Apps</a> on Telegram can completely replace <strong>any website</strong>. </p>
<p>They support <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">seamless authorization</a>, <a href="https://core.telegram.org/bots/payments">integrated payments</a> via multiple payment providers (with <em>Google Pay</em> and <em>Apple Pay</em> out of the box), delivering tailored push notifications to users, and <a href="https://core.telegram.org/bots">much more</a>.</p>
<p>This article offers a client-side overview of the implementation of bot mini apps using the MTProto API: see <a href="/bots/webapps">here for an overview of the mini-app side JS API &raquo;</a>. </p>
<h3><a class="anchor" name="outgoing-events-mini-app-to-client" href="#outgoing-events-mini-app-to-client"><i class="anchor-icon"></i></a>Outgoing events: Mini App to client</h3>
<p>Both <a href="#simple-web-apps">simple</a> and <a href="#normal-web-apps">normal</a> Mini Apps can <em>send</em> web events starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for the full list of events that can be <em>sent</em> by the Mini App to the client &raquo;</a>. </p>
<h3><a class="anchor" name="incoming-events-client-to-mini-app" href="#incoming-events-client-to-mini-app"><i class="anchor-icon"></i></a>Incoming events: Client to Mini App</h3>
<p>Mini Apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent(&quot;event_name&quot;, params)</code> method. </p>
<p>Here&#39;s the full list of events that can be <em>received</em> by a Mini App from the client, by calling the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" name="main-button-pressed" href="#main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>This article offers a client-side overview of the implementation of bot mini apps using the MTProto API: see <a href="/bots/webapps">here for an overview of the mini-app side JS API »</a>. </p>
<h3><a class="anchor" href="#outgoing-events-mini-app-to-client" id="outgoing-events-mini-app-to-client" name="outgoing-events-mini-app-to-client"><i class="anchor-icon"></i></a>Outgoing events: Mini App to client</h3>
<p>Mini Apps can <em>send</em> web events starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for the full list of events that can be <em>sent</em> by the Mini App to the client »</a>. </p>
<h3><a class="anchor" href="#incoming-events-client-to-mini-app" id="incoming-events-client-to-mini-app" name="incoming-events-client-to-mini-app"><i class="anchor-icon"></i></a>Incoming events: Client to Mini App</h3>
<p>Mini Apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent("event_name", params)</code> method. </p>
<p>Here's the full list of events that can be <em>received</em> by a Mini App from the client, if the client invokes the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" href="#main-button-pressed" id="main-button-pressed" name="main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the main button located at the bottom of the webview, handle this event only if the main button was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event &raquo;</a>.</p>
<h4><a class="anchor" name="settings-button-pressed" href="#settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
<p>Sent by the client when the user presses the main button located at the bottom of the webview, handle this event only if the main button was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event »</a>.</p>
<h4><a class="anchor" href="#back-button-pressed" id="back-button-pressed" name="back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the settings button, if it was previously enabled in <a href="https://t.me/BotFather">@BotFather</a>, as specified by the <code>has_settings</code> flag of <a href="/constructor/attachMenuBot">attachMenuBot &raquo;</a>. </p>
<h4><a class="anchor" name="back-button-pressed" href="#back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
<p>Sent by the client when the user presses the (OS or UI) back button, if it was <a href="/api/web-events#web-app-setup-back-button">previously enabled by a <code>web_app_setup_back_button</code> event »</a>.</p>
<h4><a class="anchor" href="#settings-button-pressed" id="settings-button-pressed" name="settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the (OS or UI) back button, if it was <a href="/api/web-events#web-app-setup-back-button">previously enabled by a <code>web_app_setup_back_button</code> event &raquo;</a>.</p>
<h4><a class="anchor" name="invoice-closed" href="#invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
<p>Sent by the client when the user presses the settings button, if it was <a href="/api/web-events#web-app-setup-settings-button">previously enabled by a <code>web_app_setup_settings_button</code> event »</a>.</p>
<h4><a class="anchor" href="#invoice-closed" id="invoice-closed" name="invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
<p>Params: JSON object with the following fields:</p>
<ul>
<li><code>slug</code> - Invoice identifier (string)</li>
<li><code>status</code> - One of the following values (string):<ul>
<li><code>cancelled</code> The user closed the invoice popup without paying, before the call to <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a>.</li>
<li><code>failed</code> The user tried to pay, but the payment failed: the call to <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> returned an RPC error and the popup was closed.</li>
<li><code>pending</code> The payment is still processing: the bot will receive a further service message about a successful payment. <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> was successfully invoked returning <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>, the user completed all additional verification forms returned by the method and the invoice popup was closed, but the client hasn&#39;t received a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message yet.<br>Note that eventual errors will not be sent as a <code>failed</code> event if the user fails additional validation (ie 3-D Secure) returned by <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>: the state will remaing <code>pending</code>. </li>
<li><code>paid</code> The invoice was paid successfully: the client completed the <a href="/api/payments">payment flow &raquo;</a>, the invoice popup was closed and a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message was received by the client.</li>
<li><code>pending</code> The payment is still processing: the bot will receive a further service message about a successful payment. <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> was successfully invoked returning <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>, the user completed all additional verification forms returned by the method and the invoice popup was closed, but the client hasn't received a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message yet.<br>
Note that eventual errors will not be sent as a <code>failed</code> event if the user fails additional validation (ie 3-D Secure) returned by <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>: the state will remaing <code>pending</code>. </li>
<li><code>paid</code> The invoice was paid successfully: the client completed the <a href="/api/payments">payment flow »</a>, the invoice popup was closed and a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message was received by the client.</li>
</ul>
</li>
</ul>
<p>Sent by the client to report the <a href="/api/payments">payment status</a> of an invoice obtained from a <a href="/api/web-events#web-app-open-invoice"><code>web_app_open_invoice</code> event &raquo;</a>. </p>
<h4><a class="anchor" name="viewport-changed" href="#viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
<p>Sent by the client to report the <a href="/api/payments">payment status</a> of an invoice obtained from a <a href="/api/web-events#web-app-open-invoice"><code>web_app_open_invoice</code> event »</a>. </p>
<h4><a class="anchor" href="#viewport-changed" id="viewport-changed" name="viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>height</code> - The current height of the visible area of the Mini App (excluding the bottom <a href="#main-button-pressed">main button</a>, if visible) (integer)</li>
@ -82,104 +83,14 @@
<li><code>is_expanded</code> - Whether the Mini App is expanded to its maximum height after the user swiped up or after the Mini App emitted a <a href="/api/web-events#web-app-expand">web_app_expand</a> event (boolean)</li>
</ul>
<p>Emitted when the viewport is changed. </p>
<h4><a class="anchor" name="theme-changed" href="#theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
<h4><a class="anchor" href="#theme-changed" id="theme-changed" name="theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>theme_params</code>: A <a href="#theme-parameters">theme parameters object &raquo;</a> (object)</li>
<li><code>theme_params</code> - A <a href="#theme-parameters">theme parameters object »</a> (object)</li>
</ul>
<p>Emitted when requested by the Mini App using a <a href="/api/web-events#web-app-request-theme"><code>web_app_request_theme</code> event &raquo;</a>, or when the app theme changes. </p>
<h4><a class="anchor" name="popup-closed" href="#popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web-app-open-popup"><code>web_app_open_popup</code> event &raquo;</a>. </p>
<h3><a class="anchor" name="simple-mini-apps" href="#simple-mini-apps"><i class="anchor-icon"></i></a>Simple Mini Apps</h3>
<p>Schema:</p>
<pre><code>replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector&lt;KeyboardButtonRow&gt; placeholder:flags.3?string = ReplyMarkup;
keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
simpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult;
---functions---
messages.requestSimpleWebView#299bec8e flags:# from_switch_webview:flags.1?true bot:InputUser url:string theme_params:flags.0?DataJSON platform:string = SimpleWebViewResult;
messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;</code></pre>
<p>Simple Mini Apps can only send data back to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event &raquo;</a>. </p>
<p>Simple Mini Apps can be opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> button contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, or by clicking on the <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button on top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
<p>To open them, users should call <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the original <code>url</code>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>If and only if the Mini App was opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> reply keyboard button, upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event &raquo;</a> from the Mini App, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
<ul>
<li><code>bot</code> - Bot ID</li>
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple Mini App</li>
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
</ul>
<p>Always ignore all <code>web_app_data_send</code> events received from <a href="/constructor/inlineBotWebView">inlineBotWebView</a> Mini Apps, as only <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> Mini Apps can send this event.</p>
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once. The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
<h3><a class="anchor" name="normal-mini-apps" href="#normal-mini-apps"><i class="anchor-icon"></i></a>Normal Mini Apps</h3>
<p>Schema:</p>
<pre><code>keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
botMenuButton#c7b57ce6 text:string url:string = BotMenuButton;
webViewResultUrl#c14557c query_id:long url:string = WebViewResult;
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;
updateWebViewResultSent#1592b79d query_id:long = Update;
webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;
---functions---
messages.requestWebView#178b480b flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = WebViewResult;
messages.prolongWebView#7ff34309 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = Bool;
messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;</code></pre>
<p>Normal Mini Apps work similarly to <a href="/api/bots/inline">inline bots &raquo;</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>Normal Mini Apps can be opened from:</p>
<ul>
<li>A <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor: in this case, <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>url</code>.</li>
<li>A <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button &raquo;</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set.</li>
<li>An <a href="/api/bots/attach">attachment menu &raquo;</a>: in this case, no special flag should be set, unless the attachment menu is opened via a with a <a href="/api/links#bot-attachment-menu-links">bot attachment menu deep link</a>, in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code>, if present.</li>
</ul>
<p>To open them, clients should call <a href="/method/messages.requestWebView">messages.requestWebView</a>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds: if the method call returns <code>QUERY_ID_INVALID</code>, the webview must be closed. </p>
<p>The opened URL&#39;s fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot Mini Apps JS library</a>: this <code>query_id</code> can then be used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p>
<h3><a class="anchor" name="named-bot-mini-apps" href="#named-bot-mini-apps"><i class="anchor-icon"></i></a>Named bot Mini Apps</h3>
<p>Schema:</p>
<pre><code>inputBotAppID#a920bd7a id:long access_hash:long = InputBotApp;
inputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp;
botAppNotModified#5da674b7 = BotApp;
botApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp;
messages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true app:BotApp = messages.BotApp;
appWebViewResultUrl#3c1b4f0d url:string = AppWebViewResult;
---functions---
messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;
messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult;</code></pre>
<p>Another way to open Mini Apps is by using <a href="/api/links#named-bot-web-app-links">named bot Mini App links &raquo;</a>. </p>
<p>These links are different from <a href="/api/links#bot-attachment-menu-links">bot attachment menu deep links &raquo;</a>, because they don&#39;t require the user to install an attachment menu, and a single bot can offer multiple Mini Apps, distinguished by their <code>short_name</code>. </p>
<p>These links should be handled as follows:<br><em> Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then
</em> Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.<br> If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.<br><em> If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned and its <code>request_write_access</code> flag is set, show a prompt to the user, indicating that the bot is asking permission to send messages to the user.<br> If the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> in the next step.
</em> If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the Mini App by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned.<br> <em> If the client has clicked on the link in a Telegram chat, pass the chat&#39;s peer information into <code>peer</code>; otherwise pass the bot&#39;s peer information, instead.
</em> If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, <strong>ask confirmation from the user</strong> before opening the Mini App; the <code>request_write_access</code> checkbox should be shown in this prompt, if needed.<br> Confirmation should <strong>always</strong> be asked, even if the <code>inactive</code> flag is not set, when opening the link from places where the full link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.).<br> <em> If the <code>startapp</code> query string parameter is present, pass it to <code>start_param</code> when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.
</em> If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>request_write_access</code> flag is set, the bot is asking permission to send messages to the user: if the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
<p>Finally, open the webview using the <code>url</code> contained in the returned <a href="/constructor/appWebViewResultUrl">appWebViewResultUrl</a>. </p>
<p>Since there is no linked inline query, <code>web_app_data_send</code> events must be ignored.<br>The bot can, however, write to the user directly if it already has a chat with the user or if it requested permission via <code>request_write_access</code> and the user granted it with <code>write_allowed</code>. </p>
<h3><a class="anchor" name="theme-parameters" href="#theme-parameters"><i class="anchor-icon"></i></a>Theme parameters</h3>
<p>Bot Mini Apps can be themed according to the following theme parameters, passed as a JSON object to the <code>theme_params</code> parameter of the <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and <a href="/method/messages.requestWebView">messages.requestWebView</a> methods. </p>
<p>Emitted when requested by the Mini App using a <a href="/api/web-events#web-app-request-theme"><code>web_app_request_theme</code> event »</a>, or when the app theme changes. </p>
<h5><a class="anchor" href="#theme-parameters" id="theme-parameters" name="theme-parameters"><i class="anchor-icon"></i></a>Theme parameters</h5>
<p>Bot Mini Apps can be themed according to the following theme parameters, passed as a JSON object to the <code>theme_params</code> parameter of the <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, <a href="/method/messages.requestWebView">messages.requestWebView</a> and <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> methods. </p>
<p>This JSON object has the following keys, containing color theme information (hex string, RGB, no alpha) to pass to the Mini App:</p>
<ul>
<li><code>bg_color</code> - Background color</li>
@ -189,8 +100,201 @@ messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:Inpu
<li><code>link_color</code> - Link color</li>
<li><code>button_color</code> - Button color</li>
<li><code>button_text_color</code> - Button text color</li>
<li><code>header_bg_color</code> - Header background color</li>
<li><code>accent_text_color</code> - Accent text color</li>
<li><code>section_bg_color</code> - Section background color</li>
<li><code>section_header_text_color</code> - Section header text color</li>
<li><code>subtitle_text_color</code> - Sub title text color</li>
<li><code>destructive_text_color</code> - Text color for destructive action buttons in prompts</li>
</ul>
</div>
<h4><a class="anchor" href="#popup-closed" id="popup-closed" name="popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web-app-open-popup"><code>web_app_open_popup</code> event »</a>. </p>
<h4><a class="anchor" href="#write-access-requested" id="write-access-requested" name="write-access-requested"><i class="anchor-icon"></i></a><code>write_access_requested</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>status</code> - <code>allowed</code> or <code>cancelled</code></li>
</ul>
<p>Used by clients to reply to a <a href="/api/web-events#web-app-request-write-access"><code>web_app_request_write_access</code> event »</a>, indicating whether the user has allowed the bot to send messages to the user (<code>allowed</code>) or not (<code>cancelled</code>). </p>
<h4><a class="anchor" href="#phone-requested" id="phone-requested" name="phone-requested"><i class="anchor-icon"></i></a><code>phone_requested</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>status</code> - <code>sent</code> or <code>cancelled</code></li>
</ul>
<p>Used by clients to reply to a <a href="/api/web-events#web-app-request-phone"><code>web_app_request_phone</code> event »</a>, indicating whether the user has shared their phone number with the bot (<code>allowed</code>) or not (<code>cancelled</code>). </p>
<h4><a class="anchor" href="#custom-method-invoked" id="custom-method-invoked" name="custom-method-invoked"><i class="anchor-icon"></i></a><code>custom_method_invoked</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_invoke_custom_method</code> request</li>
<li><code>result</code> - The JSON data contained in the response of the <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> method, if the method call succeeded</li>
<li><code>error</code> - The text of the RPC error, if the method call failed</li>
</ul>
<p>Used by clients to reply to <a href="/api/web-events#web-app-invoke-custom-method"><code>web_app_invoke_custom_method</code> events »</a>. </p>
<h4><a class="anchor" href="#clipboard-text-received" id="clipboard-text-received" name="clipboard-text-received"><i class="anchor-icon"></i></a><code>clipboard_text_received</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_read_text_from_clipboard</code> request</li>
<li><code>data</code> - A string with the clipboard contents (optional, if not provided consider the request failed)</li>
</ul>
<p>Used by clients to reply to <a href="/api/web-events#web-app-read-text-from-clipboard"><code>web_app_read_text_from_clipboard</code> events »</a>. </p>
<h4><a class="anchor" href="#qr-text-received" id="qr-text-received" name="qr-text-received"><i class="anchor-icon"></i></a><code>qr_text_received</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>data</code> - string with the contents of a scanned QR code.</li>
</ul>
<p>Emitted by clients if a new QR code was scanned by the native QR code scanner opened with a <a href="/api/web-events#web-app-open-scan-qr-popup"><code>web_app_open_scan_qr_popup</code> event »</a>. </p>
<h4><a class="anchor" href="#scan-qr-popup-closed" id="scan-qr-popup-closed" name="scan-qr-popup-closed"><i class="anchor-icon"></i></a><code>scan_qr_popup_closed</code></h4>
<p>Params: <code>null</code> or an empty object</p>
<p>Emitted by clients if the QR code scanner popup opened with a <a href="/api/web-events#web-app-open-scan-qr-popup"><code>web_app_open_scan_qr_popup</code> event »</a> was closed by the user or failed to open altogether due to permission issues. </p>
<h3><a class="anchor" href="#keyboard-button-mini-apps" id="keyboard-button-mini-apps" name="keyboard-button-mini-apps"><i class="anchor-icon"></i></a>Keyboard Button Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/replyKeyboardMarkup'>replyKeyboardMarkup</a>#85dd99d1 flags:<a href='/type/%23'>#</a> resize:flags.0?<a href='/constructor/true'>true</a> single_use:flags.1?<a href='/constructor/true'>true</a> selective:flags.2?<a href='/constructor/true'>true</a> persistent:flags.4?<a href='/constructor/true'>true</a> rows:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/KeyboardButtonRow'>KeyboardButtonRow</a>&gt; placeholder:flags.3?<a href='/type/string'>string</a> = <a href='/type/ReplyMarkup'>ReplyMarkup</a>;
<a href='/constructor/keyboardButtonSimpleWebView'>keyboardButtonSimpleWebView</a>#a0c0505c text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/KeyboardButton'>KeyboardButton</a>;
<a href='/constructor/messageActionWebViewDataSentMe'>messageActionWebViewDataSentMe</a>#47dd8079 text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/MessageAction'>MessageAction</a>;
<a href='/constructor/messageActionWebViewDataSent'>messageActionWebViewDataSent</a>#b4c38cb5 text:<a href='/type/string'>string</a> = <a href='/type/MessageAction'>MessageAction</a>;
<a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
<a href='/method/messages.sendWebViewData'>messages.sendWebViewData</a>#dc0242c8 bot:<a href='/type/InputUser'>InputUser</a> random_id:<a href='/type/long'>long</a> button_text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Keyboard Button Mini Apps should be opened when the user clicks a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, by invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the button's <code>url</code> to the <code>url</code> parameter. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Keyboard Button Mini Apps can send data back to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a>. </p>
<p>Upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a> <strong>only</strong> from Keyboard Button Mini Apps, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
<ul>
<li><code>bot</code> - Bot ID</li>
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple Mini App</li>
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
</ul>
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once. The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
<h3><a class="anchor" href="#inline-button-mini-apps" id="inline-button-mini-apps" name="inline-button-mini-apps"><i class="anchor-icon"></i></a>Inline button Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/keyboardButtonWebView'>keyboardButtonWebView</a>#13767230 text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/KeyboardButton'>KeyboardButton</a>;
<a href='/constructor/webViewResultUrl'>webViewResultUrl</a>#c14557c query_id:<a href='/type/long'>long</a> url:<a href='/type/string'>string</a> = <a href='/type/WebViewResult'>WebViewResult</a>;
<a href='/constructor/inputBotInlineResult'>inputBotInlineResult</a>#88bf9319 flags:<a href='/type/%23'>#</a> id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> title:flags.1?<a href='/type/string'>string</a> description:flags.2?<a href='/type/string'>string</a> url:flags.3?<a href='/type/string'>string</a> thumb:flags.4?<a href='/type/InputWebDocument'>InputWebDocument</a> content:flags.5?<a href='/type/InputWebDocument'>InputWebDocument</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultPhoto'>inputBotInlineResultPhoto</a>#a8d864a7 id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> photo:<a href='/type/InputPhoto'>InputPhoto</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultDocument'>inputBotInlineResultDocument</a>#fff8fdc4 flags:<a href='/type/%23'>#</a> id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> title:flags.1?<a href='/type/string'>string</a> description:flags.2?<a href='/type/string'>string</a> document:<a href='/type/InputDocument'>InputDocument</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultGame'>inputBotInlineResultGame</a>#4fa417f2 id:<a href='/type/string'>string</a> short_name:<a href='/type/string'>string</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/updateWebViewResultSent'>updateWebViewResultSent</a>#1592b79d query_id:<a href='/type/long'>long</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/webViewMessageSent'>webViewMessageSent</a>#c94511c flags:<a href='/type/%23'>#</a> msg_id:flags.0?<a href='/type/InputBotInlineMessageID'>InputBotInlineMessageID</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;
---functions---
<a href='/method/messages.requestWebView'>messages.requestWebView</a>#269dc2c1 flags:<a href='/type/%23'>#</a> from_bot_menu:flags.4?<a href='/constructor/true'>true</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.1?<a href='/type/string'>string</a> start_param:flags.3?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/WebViewResult'>WebViewResult</a>;
<a href='/method/messages.prolongWebView'>messages.prolongWebView</a>#b0d81a83 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> query_id:<a href='/type/long'>long</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.sendWebViewResultMessage'>messages.sendWebViewResultMessage</a>#a4314f5 bot_query_id:<a href='/type/string'>string</a> result:<a href='/type/InputBotInlineResult'>InputBotInlineResult</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;</code></pre>
<p>Inline Button Mini Apps work similarly to <a href="/api/bots/inline">inline bots »</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>When the user clicks on an <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> inline button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor, <a href="/method/messages.requestWebView">messages.requestWebView</a> should be invoked, passing <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to the method's <code>url</code> parameter. </p>
<p>Then, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds: if the method call returns <code>QUERY_ID_INVALID</code>, the webview must be closed. </p>
<p>The opened URL's fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot Mini Apps JS library</a>: this <code>query_id</code> can then be passed to the bot (within the Mini App itself, for example via an AJAX query or form submission to the server hosting the Mini App and the bot) and then used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p>
<h3><a class="anchor" href="#menu-button-mini-apps" id="menu-button-mini-apps" name="menu-button-mini-apps"><i class="anchor-icon"></i></a>Menu button Mini Apps</h3>
<p>Menu button Mini Apps work similarly to <a href="#inline-button-mini-apps">inline button Mini Apps »</a>: they send messages on behalf of the user to the chat from where the <a href="/api/bots/menu">bot menu button »</a> was clicked. </p>
<p>Menu button Mini Apps can be opened from a <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button »</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set, and the <a href="/constructor/botMenuButton">botMenuButton</a>.<code>url</code> field must be passed to the method's <code>url</code> parameter. </p>
<p>The full flow is identical to the flow for <a href="#inline-button-mini-apps">inline button Mini Apps »</a>, apart from the different flags passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>, as described above.</p>
<h3><a class="anchor" href="#attachment-menu-mini-apps" id="attachment-menu-mini-apps" name="attachment-menu-mini-apps"><i class="anchor-icon"></i></a>Attachment menu Mini Apps</h3>
<p>Attachment menu Mini Apps work similarly to <a href="#inline-button-mini-apps">inline button Mini Apps »</a>: they send messages on behalf of the user to the chat where the bot's <a href="/api/bots/attach">attachment menu »</a> was opened. </p>
<p>Attachment menu Mini Apps can be opened from an <a href="/api/bots/attach">attachment menu entry »</a>: in this case, no special flag should be set when invoking <a href="/method/messages.requestWebView">messages.requestWebView</a>. </p>
<p>Attachment menu Mini Apps can also be opened from a <a href="/api/links#bot-attachment-or-side-menu-links">bot attachment menu deep link</a>, in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code>, if present.</p>
<p>The full flow is identical to the flow for <a href="#inline-button-mini-apps">inline button Mini Apps »</a>, apart from the different flags passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>, as described above.</p>
<h3><a class="anchor" href="#inline-mode-mini-apps" id="inline-mode-mini-apps" name="inline-mode-mini-apps"><i class="anchor-icon"></i></a>Inline mode Mini Apps</h3>
<pre><code><a href='/constructor/messages.botResults'>messages.botResults</a>#e021f2f6 flags:<a href='/type/%23'>#</a> gallery:flags.0?<a href='/constructor/true'>true</a> query_id:<a href='/type/long'>long</a> next_offset:flags.1?<a href='/type/string'>string</a> switch_pm:flags.2?<a href='/type/InlineBotSwitchPM'>InlineBotSwitchPM</a> switch_webview:flags.3?<a href='/type/InlineBotWebView'>InlineBotWebView</a> results:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInlineResult'>BotInlineResult</a>&gt; cache_time:<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/messages.BotResults'>messages.BotResults</a>;
<a href='/constructor/inlineBotWebView'>inlineBotWebView</a>#b57295d5 text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/InlineBotWebView'>InlineBotWebView</a>;
<a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.getInlineBotResults'>messages.getInlineBotResults</a>#514e999d flags:<a href='/type/%23'>#</a> bot:<a href='/type/InputUser'>InputUser</a> peer:<a href='/type/InputPeer'>InputPeer</a> geo_point:flags.0?<a href='/type/InputGeoPoint'>InputGeoPoint</a> query:<a href='/type/string'>string</a> offset:<a href='/type/string'>string</a> = <a href='/type/messages.BotResults'>messages.BotResults</a>;
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;</code></pre>
<p>Not to be confused with <a href="#inline-button-mini-apps">inline button mini apps »</a>. </p>
<p>Inline mode Mini Apps can be used to generate a custom set of inline results in response to a user's <a href="/api/bots/inline">inline query »</a> via a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a>. </p>
<p>Inline mode Mini Apps can be opened by clicking on an <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button returned at the top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
<p>Pass the <code>url</code> to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, while also setting the <code>from_switch_webview</code> flag. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Once the user has finished making their choices in the Mini App, a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a> should be emitted, containing a JSON object with the following fields:</p>
<ul>
<li><code>query</code> - The inline query that will be inserted in the chat's input field, after the bot's username.<br>
May be an empty string, in which case just the bot's username will be inserted, triggering an empty inline query.</li>
<li><code>chat_types</code> - An array of strings, containing a combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code>.<br>
If non-empty, the client should prompt the user to choose a specific chat of the specified type(s), then open the chosen chat and inserts the bot's username and the specified inline query in the input field.<br>
The array values specify which types of chats the user will be able to choose from.<br>
If empty, the current chat is used. </li>
</ul>
<p>Upon receiving a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a> from the Mini App, the client should <a href="/api/bots/inline">make a new inline query »</a> to the same bot, with the newly specified <code>query</code>, either in the current chat or in the newly chosen chat, as specified by the <code>chat_types</code> field. </p>
<h3><a class="anchor" href="#side-menu-mini-apps" id="side-menu-mini-apps" name="side-menu-mini-apps"><i class="anchor-icon"></i></a>Side menu Mini Apps</h3>
<pre><code><a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;</code></pre>
<p>Side menu Mini Apps can be opened by clicking on the installed <a href="/api/bots/attach">side menu entry »</a>. </p>
<p>This action must trigger a <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> query with the <code>from_side_menu</code> flag set: clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Side menu Mini Apps can also be opened by clicking on a <a href="/api/links#mini-app-links">Mini App link »</a>: in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>.<code>start_param</code>, if present; note that in this case, the app should be opened (with an <a href="/api/bots/attach">installation prompt »</a> before, if not already installed) even if the client is minimized. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<h3><a class="anchor" href="#direct-link-mini-apps" id="direct-link-mini-apps" name="direct-link-mini-apps"><i class="anchor-icon"></i></a>Direct Link Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/inputBotAppID'>inputBotAppID</a>#a920bd7a id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputBotApp'>InputBotApp</a>;
<a href='/constructor/inputBotAppShortName'>inputBotAppShortName</a>#908c0407 bot_id:<a href='/type/InputUser'>InputUser</a> short_name:<a href='/type/string'>string</a> = <a href='/type/InputBotApp'>InputBotApp</a>;
<a href='/constructor/botAppNotModified'>botAppNotModified</a>#5da674b7 = <a href='/type/BotApp'>BotApp</a>;
<a href='/constructor/botApp'>botApp</a>#95fcd1d6 flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> short_name:<a href='/type/string'>string</a> title:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> photo:<a href='/type/Photo'>Photo</a> document:flags.0?<a href='/type/Document'>Document</a> hash:<a href='/type/long'>long</a> = <a href='/type/BotApp'>BotApp</a>;
<a href='/constructor/messages.botApp'>messages.botApp</a>#eb50adf5 flags:<a href='/type/%23'>#</a> inactive:flags.0?<a href='/constructor/true'>true</a> request_write_access:flags.1?<a href='/constructor/true'>true</a> has_settings:flags.2?<a href='/constructor/true'>true</a> app:<a href='/type/BotApp'>BotApp</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
<a href='/constructor/appWebViewResultUrl'>appWebViewResultUrl</a>#3c1b4f0d url:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;
---functions---
<a href='/method/messages.getBotApp'>messages.getBotApp</a>#34fdc5c3 app:<a href='/type/InputBotApp'>InputBotApp</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
<a href='/method/messages.requestAppWebView'>messages.requestAppWebView</a>#8c5a3b3c flags:<a href='/type/%23'>#</a> write_allowed:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> app:<a href='/type/InputBotApp'>InputBotApp</a> start_param:flags.1?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;</code></pre>
<p>Another way to open Mini Apps is by using <a href="/api/links#direct-mini-app-links">Direct Mini App links »</a>. </p>
<p>These links are different from all other Mini App links, because they don't require the user to install an attachment menu, and a single bot can offer multiple Mini Apps, distinguished by their <code>short_name</code>. </p>
<p>These links should be handled as follows: </p>
<ul>
<li>
<p>Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then</p>
</li>
<li>
<p>Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.
If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.</p>
</li>
<li>
<p>If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the Mini App by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned. </p>
<ul>
<li>
<p>If the client has clicked on the link in a Telegram chat, pass the chat's peer information into <code>peer</code>; otherwise pass the bot's peer information, instead.</p>
</li>
<li>
<p>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>request_write_access</code> flag is set, the bot is asking permission to send messages to the user: <strong>ask confirmation from the user</strong> with a prompt and a checkbox, and if the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
</li>
<li>
<p>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, <strong>ask confirmation from the user</strong> before opening the Mini App; the <code>request_write_access</code> checkbox should be shown in this prompt, if needed.<br>
Confirmation should <strong>always</strong> be asked, even if the <code>inactive</code> flag is not set, when opening the link from places where the full link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<p>Don't use two prompts if confirmation to open the Mini App is required <em>and</em> <code>request_write_access</code> is set, use just one prompt with an optional checkbox for <code>request_write_access</code>. </p>
</li>
<li>
<p>If the <code>startapp</code> query string parameter is present, pass it to <code>start_param</code> when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
</li>
</ul>
</li>
</ul>
<p>Finally, open the webview using the <code>url</code> contained in the returned <a href="/constructor/appWebViewResultUrl">appWebViewResultUrl</a>.</p></div>
</div>

View file

@ -181,12 +181,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"qr_login_code": "primary",
"dialog_filters_enabled": true,
"dialog_filters_tooltip": true,
"autoarchive_setting_available": false,
"autoarchive_setting_available": true,
"pending_suggestions": [
"AUTOARCHIVE_POPULAR",
"VALIDATE_PASSWORD",
"VALIDATE_PHONE_NUMBER",
"NEWCOMER_TICKS"
"NEWCOMER_TICKS",
"SETUP_PASSWORD"
],
"autologin_domains": [
"instantview.telegram.org",
@ -203,7 +204,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"diameter": 384,
"video_bitrate": 1000,
"audio_bitrate": 64,
"max_size": 12582912
"max_size": 16777216
},
"chat_read_mark_expire_period": 604800,
"chat_read_mark_size_threshold": 100,
@ -219,7 +220,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"stickers_faved_limit_default": 5,
"stickers_faved_limit_premium": 10,
"dialog_filters_limit_default": 10,
"dialog_filters_limit_premium": 20,
"dialog_filters_limit_premium": 30,
"dialog_filters_chats_limit_default": 100,
"dialog_filters_chats_limit_premium": 200,
"dialogs_pinned_limit_default": 5,
@ -242,12 +243,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"reactions_in_chat_max": 100,
"default_emoji_statuses_stickerset_id": "773947703670341676",
"premium_promo_order": [
"stories",
"more_upload",
"double_limits",
"voice_to_text",
"faster_download",
"translations",
"animated_emoji",
"more_upload",
"emoji_status",
"profile_badge",
"advanced_chat_management",
@ -255,7 +257,9 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"app_icons",
"infinite_reactions",
"animated_userpics",
"premium_stickers"
"premium_stickers",
"wallpapers",
"peer_colors"
],
"premium_bot_username": "PremiumBot",
"whitelisted_domains": [
@ -264,7 +268,8 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"telegram.org",
"t.me",
"telesco.pe",
"fragment.com"
"fragment.com",
"translations.telegram.org"
],
"topics_pinned_limit": 5,
"telegram_antispam_user_id": "5434988373",
@ -281,7 +286,46 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"chatlists_joined_limit_premium": 20,
"chatlist_update_period": 300,
"small_queue_max_active_operations_count": 5,
"large_queue_max_active_operations_count": 2
"large_queue_max_active_operations_count": 2,
"story_viewers_expire_period": 86400,
"story_expiring_limit_default": 3,
"story_expiring_limit_premium": 100,
"story_caption_length_limit_premium": 2048,
"story_caption_length_limit_default": 200,
"stories_posting": "enabled",
"stories_stealth_past_period": 300,
"stories_stealth_future_period": 1500,
"stories_stealth_cooldown_period": 10800,
"stories_sent_weekly_limit_default": 7,
"stories_sent_weekly_limit_premium": 700,
"stories_sent_monthly_limit_default": 30,
"stories_sent_monthly_limit_premium": 3000,
"stories_venue_search_username": "foursquare",
"stories_entities": "premium",
"stories_changelog_user_id": 777000,
"authorization_autoconfirm_period": 604800,
"stories_suggested_reactions_limit_default": 1,
"stories_suggested_reactions_limit_premium": 5,
"giveaway_gifts_purchase_available": true,
"giveaway_add_peers_max": 10,
"giveaway_countries_max": 10,
"giveaway_boosts_per_premium": 4,
"giveaway_period_max": 2678400,
"boosts_channel_level_max": 100,
"boosts_per_sent_gift": 3,
"quote_length_max": 1024,
"transcribe_audio_trial_weekly_number": 2,
"transcribe_audio_trial_duration_max": 300,
"recommended_channels_limit_default": 10,
"recommended_channels_limit_premium": 100,
"channel_bg_icon_level_min": 4,
"channel_profile_bg_icon_level_min": 7,
"channel_emoji_status_level_min": 8,
"channel_wallpaper_level_min": 9,
"channel_custom_wallpaper_level_min": 10,
"saved_dialogs_pinned_limit_default": 5,
"saved_dialogs_pinned_limit_premium": 100,
"pm_read_date_expire_period": 604800
}</code></pre>
<p>Typical fields included in the resulting JSON object are: </p>
<h4><a class="anchor" href="#emojies-animated-zoom" id="emojies-animated-zoom" name="emojies-animated-zoom"><i class="anchor-icon"></i></a><code>emojies_animated_zoom</code></h4>
@ -333,14 +377,16 @@ When fetching the admin list of a supergroup using <a href="/method/channels.get
<p>A list of Telegram domains that support automatic login with no user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
<h4><a class="anchor" href="#whitelisted-domains" id="whitelisted-domains" name="whitelisted-domains"><i class="anchor-icon"></i></a><code>whitelisted_domains</code></h4>
<p>A list of Telegram domains that can always be opened without additional user confirmation, when clicking on in-app links where the URL is not fully displayed (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> entities). (array of strings)</p>
<p>Note that when opening <a href="/api/links#named-bot-web-app-links">named bot web app links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/&lt;bot_username&gt;/&lt;short_name&gt;?startapp=&lt;start_parameter&gt;</code>, where <code>t.me</code> is whitelisted). </p>
<p>Confirmation should <strong>always</strong> be asked, even if we already opened the <a href="/api/links#named-bot-web-app-links">named bot web app</a> before, if the link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<p>Note that when opening <a href="/api/links#direct-mini-app-links">direct Mini App links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/&lt;bot_username&gt;/&lt;short_name&gt;?startapp=&lt;start_parameter&gt;</code>, where <code>t.me</code> is whitelisted). </p>
<p>Confirmation should <strong>always</strong> be asked, even if we already opened the <a href="/api/links#direct-mini-app-links">direct Mini App</a> before, if the link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<h4><a class="anchor" href="#round-video-encoding" id="round-video-encoding" name="round-video-encoding"><i class="anchor-icon"></i></a><code>round_video_encoding</code></h4>
<p>Contains a set of recommended codec parameters for round videos. (object, as described in the example)</p>
<h4><a class="anchor" href="#chat-read-mark-size-threshold" id="chat-read-mark-size-threshold" name="chat-read-mark-size-threshold"><i class="anchor-icon"></i></a><code>chat_read_mark_size_threshold</code></h4>
<p>Per-user read receipts, fetchable using <a href="/method/messages.getMessageReadParticipants">messages.getMessageReadParticipants</a>, will be available in groups with an amount of participants less or equal to <code>chat_read_mark_size_threshold</code>. (integer)</p>
<h4><a class="anchor" href="#chat-read-mark-expire-period" id="chat-read-mark-expire-period" name="chat-read-mark-expire-period"><i class="anchor-icon"></i></a><code>chat_read_mark_expire_period</code></h4>
<p>To protect user privacy, read receipts are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (integer)</p>
<p>To protect user privacy, read receipts for chats are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (integer)</p>
<h4><a class="anchor" href="#pm-read-date-expire-period" id="pm-read-date-expire-period" name="pm-read-date-expire-period"><i class="anchor-icon"></i></a><code>pm_read_date_expire_period</code></h4>
<p>To protect user privacy, read receipts for private chats are only stored for <code>pm_read_date_expire_period</code> seconds after the message was sent. (integer)</p>
<h4><a class="anchor" href="#groupcall-video-participants-max" id="groupcall-video-participants-max" name="groupcall-video-participants-max"><i class="anchor-icon"></i></a><code>groupcall_video_participants_max</code></h4>
<p>Maximum number of participants in a group call (livestreams allow ∞ participants) (integer)</p>
<h4><a class="anchor" href="#reactions-uniq-max" id="reactions-uniq-max" name="reactions-uniq-max"><i class="anchor-icon"></i></a><code>reactions_uniq_max</code></h4>
@ -403,7 +449,7 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#caption-length-limit-default" id="caption-length-limit-default" name="caption-length-limit-default"><i class="anchor-icon"></i></a><code>caption_length_limit_default</code></h4>
<p>The maximum UTF-8 length of media captions sendable by non-<a href="/api/premium">Premium</a> users (integer)</p>
<h4><a class="anchor" href="#caption-length-limit-premium" id="caption-length-limit-premium" name="caption-length-limit-premium"><i class="anchor-icon"></i></a><code>caption_length_limit_premium</code></h4>
<p>The maximum UTF-8 length of media captions sendable by non-<a href="/api/premium">Premium</a> users (integer)</p>
<p>The maximum UTF-8 length of media captions sendable by <a href="/api/premium">Premium</a> users (integer)</p>
<h4><a class="anchor" href="#upload-max-fileparts-default" id="upload-max-fileparts-default" name="upload-max-fileparts-default"><i class="anchor-icon"></i></a><code>upload_max_fileparts_default</code></h4>
<p>The maximum number of file parts uploadable by non-<a href="/api/premium">Premium</a> users (integer, the maximum file size can be extrapolated by multiplying this value by <code>524288</code>, the biggest possible chunk size)</p>
<h4><a class="anchor" href="#upload-max-fileparts-premium" id="upload-max-fileparts-premium" name="upload-max-fileparts-premium"><i class="anchor-icon"></i></a><code>upload_max_fileparts_premium</code></h4>
@ -436,6 +482,90 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files smaller than 20MB. (integer)</p>
<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>
<p>An <a href="/api/auth#confirming-login">unconfirmed session »</a> will be autoconfirmed this many seconds after login. (integer)</p>
<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 <a href="/api/stories">stories</a> for non-<a href="/api/premium">Premium</a> users (integer).</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>
<p>The maximum number of active <a href="/api/stories">stories</a> for <a href="/api/premium">Premium</a> users (integer).</p>
<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>
<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>
<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>
<ul>
<li><code>enabled</code> - Any user can post stories.</li>
<li><code>premium</code> - Only users with a <a href="/api/premium">Premium</a> subscription can post stories.</li>
<li><code>disabled</code> - Users can't post stories.</li>
</ul>
<h4><a class="anchor" href="#stories-stealth-past-period" id="stories-stealth-past-period" name="stories-stealth-past-period"><i class="anchor-icon"></i></a><code>stories_stealth_past_period</code></h4>
<p>Enabling <a href="/api/stories#stealth-mode">stories stealth mode</a> with the <code>past</code> flag will erase views of any story opened in the past <code>stories_stealth_past_period</code> seconds. (integer)</p>
<h4><a class="anchor" href="#stories-stealth-future-period" id="stories-stealth-future-period" name="stories-stealth-future-period"><i class="anchor-icon"></i></a><code>stories_stealth_future_period</code></h4>
<p>Enabling <a href="/api/stories#stealth-mode">stories stealth mode</a> with the <code>future</code> flag will hide views of any story opened in the next <code>stories_stealth_future_period</code> seconds. (integer)</p>
<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-suggested-reactions-limit-default" id="stories-suggested-reactions-limit-default" name="stories-suggested-reactions-limit-default"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_default</code></h4>
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-suggested-reactions-limit-premium" id="stories-suggested-reactions-limit-premium" name="stories-suggested-reactions-limit-premium"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_premium</code></h4>
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story 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-changelog-user-id" id="stories-changelog-user-id" name="stories-changelog-user-id"><i class="anchor-icon"></i></a><code>stories_changelog_user_id</code></h4>
<p>ID of the official Telegram user that will post stories about new Telegram features: stories posted by this user should be shown on the <a href="/api/stories#watching-stories">active or active and hidden stories bar</a> just like for contacts, even if the user was removed from the contact list. (integer, defaults to <code>777000</code>)</p>
<h4><a class="anchor" href="#stories-entities" id="stories-entities" name="stories-entities"><i class="anchor-icon"></i></a><code>stories_entities</code></h4>
<p>Whether <a href="/api/entities">styled text entities</a> and links in story text captions can be used by all users (<code>enabled</code>), only [Premium](/api/premium users) (<code>premium</code>), or no one (<code>disabled</code>). (string)</p>
<p>This field is used both when posting stories, to indicate to the user whether they can use entities, and when viewing stories, to hide entities (client-side) on stories posted by users whose <a href="/api/premium">Premium</a> subscription has expired (if <code>stories_entities == "premium"</code> and <a href="/constructor/user">user</a>.<code>premium</code> is not set, or if <code>stories_entities == "disabled"</code>). </p>
<h4><a class="anchor" href="#giveaway-gifts-purchase-available" id="giveaway-gifts-purchase-available" name="giveaway-gifts-purchase-available"><i class="anchor-icon"></i></a><code>giveaway_gifts_purchase_available</code></h4>
<p>Whether <a href="/api/giveaways">giveaways</a> can be started by the current user. (boolean)</p>
<h4><a class="anchor" href="#giveaway-add-peers-max" id="giveaway-add-peers-max" name="giveaway-add-peers-max"><i class="anchor-icon"></i></a><code>giveaway_add_peers_max</code></h4>
<p>The maximum number of users that can be specified when making a <a href="/api/giveaways">direct giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#giveaway-countries-max" id="giveaway-countries-max" name="giveaway-countries-max"><i class="anchor-icon"></i></a><code>giveaway_countries_max</code></h4>
<p>The maximum number of countries that can be specified when restricting the set of participating countries in a <a href="/api/giveaways">giveaway</a>. (itneger)</p>
<h4><a class="anchor" href="#giveaway-boosts-per-premium" id="giveaway-boosts-per-premium" name="giveaway-boosts-per-premium"><i class="anchor-icon"></i></a><code>giveaway_boosts_per_premium</code></h4>
<p>The number of <a href="/api/boost">boosts</a> that will be gained by a channel for each winner of a <a href="/api/giveaways">giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#giveaway-period-max" id="giveaway-period-max" name="giveaway-period-max"><i class="anchor-icon"></i></a><code>giveaway_period_max</code></h4>
<p>The maximum duration in seconds of a <a href="/api/giveaways">giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#boosts-channel-level-max" id="boosts-channel-level-max" name="boosts-channel-level-max"><i class="anchor-icon"></i></a><code>boosts_channel_level_max</code></h4>
<p>Maximum <a href="/api/boost">boost level</a> for channels. (integer)</p>
<h4><a class="anchor" href="#boosts-per-sent-gift" id="boosts-per-sent-gift" name="boosts-per-sent-gift"><i class="anchor-icon"></i></a><code>boosts_per_sent_gift</code></h4>
<p>The number of additional <a href="/api/boost">boost slots</a> that the current user will receive when <a href="/api/premium#gifting-telegram-premium">gifting a Telegram Premium subscription</a>. </p>
<h4><a class="anchor" href="#transcribe-audio-trial-weekly-number" id="transcribe-audio-trial-weekly-number" name="transcribe-audio-trial-weekly-number"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_weekly_number</code></h4>
<p>The maximum number of <a href="/api/transcribe">speech recognition »</a> calls per week for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#transcribe-audio-trial-duration-max" id="transcribe-audio-trial-duration-max" name="transcribe-audio-trial-duration-max"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_duration_max</code></h4>
<p>The maximum allowed duration of media in seconds for <a href="/api/transcribe">speech recognition »</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-default" id="recommended-channels-limit-default" name="recommended-channels-limit-default"><i class="anchor-icon"></i></a><code>recommended_channels_limit_default</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-premium" id="recommended-channels-limit-premium" name="recommended-channels-limit-premium"><i class="anchor-icon"></i></a><code>recommended_channels_limit_premium</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#quote-length-max" id="quote-length-max" name="quote-length-max"><i class="anchor-icon"></i></a><code>quote_length_max</code></h4>
<p>Maximum UTF-8 length of <a href="/constructor/inputReplyToMessage">quoted text</a>. (integer)</p>
<h4><a class="anchor" href="#channel-bg-icon-level-min" id="channel-bg-icon-level-min" name="channel-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_bg_icon_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">message accent palette emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-profile-bg-icon-level-min" id="channel-profile-bg-icon-level-min" name="channel-profile-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_profile_bg_icon_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">profile accent palette emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-emoji-status-level-min" id="channel-emoji-status-level-min" name="channel-emoji-status-level-min"><i class="anchor-icon"></i></a><code>channel_emoji_status_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-wallpaper-level-min" id="channel-wallpaper-level-min" name="channel-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_wallpaper_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set a <a href="/api/wallpapers#channel-wallpapers">fill channel wallpaper, see here » for more info</a>. (integer)</p>
<h4><a class="anchor" href="#channel-custom-wallpaper-level-min" id="channel-custom-wallpaper-level-min" name="channel-custom-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_custom_wallpaper_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill channel wallpapers, see here » for more info</a>. (integer)</p>
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-default" id="saved-dialogs-pinned-limit-default" name="saved-dialogs-pinned-limit-default"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_default</code></h4>
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-premium" id="saved-dialogs-pinned-limit-premium" name="saved-dialogs-pinned-limit-premium"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_premium</code></h4>
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for <a href="/api/premium">Premium</a> users. (integer)</p>
<h3><a class="anchor" href="#suggestions" id="suggestions" name="suggestions"><i class="anchor-icon"></i></a>Suggestions</h3>
<p>The API can return a set of useful suggestions for users of graphical clients. </p>
<h4><a class="anchor" href="#basic-suggestions" id="basic-suggestions" name="basic-suggestions"><i class="anchor-icon"></i></a>Basic suggestions</h4>
@ -460,13 +590,17 @@ A full list of these parameters can be seen in the <a href="#client-configuratio
<li><code>"VALIDATE_PASSWORD"</code> - Users should make sure they still remember their <a href="/api/srp">2-step verification password</a>.</li>
<li><code>"VALIDATE_PHONE_NUMBER"</code> - Users should check whether their <a href="/api/auth">authorization phone number</a> is correct and change the phone number if it is inaccessible.</li>
<li><code>"NEWCOMER_TICKS"</code> - Show the user a hint about the meaning of one and two ticks on sent messages.</li>
<li><code>"SETUP_PASSWORD"</code> - Show the user a hint, asking them to check whether they still remember their <a href="/api/srp">2FA password</a></li>
<li><code>"PREMIUM_ANNUAL"</code> - Suggests the user to subscribe to the Premium subscription (with annual payments)</li>
<li><code>"PREMIUM_UPGRADE"</code> - Suggests the user to upgrade their existing Premium subscription from monthly payments to annual payments</li>
<li><code>"PREMIUM_RESTORE"</code> - Suggests the user to restore a recently expired Premium subscription</li>
</ul>
</li>
</ul>
<h4><a class="anchor" href="#channel-suggestions" id="channel-suggestions" name="channel-suggestions"><i class="anchor-icon"></i></a>Channel suggestions</h4>
<pre><code><a href='/constructor/messages.chatFull'>messages.chatFull</a>#e5d7d19c full_chat:<a href='/type/ChatFull'>ChatFull</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.ChatFull'>messages.ChatFull</a>;
<a href='/constructor/channelFull'>channelFull</a>#f2355507 flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> = <a href='/type/ChatFull'>ChatFull</a>;
<a href='/constructor/channelFull'>channelFull</a>#f2bcb6f flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> stories_pinned_available:flags2.5?<a href='/constructor/true'>true</a> view_forum_as_messages:flags2.6?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> stories:flags2.4?<a href='/type/PeerStories'>PeerStories</a> wallpaper:flags2.7?<a href='/type/WallPaper'>WallPaper</a> = <a href='/type/ChatFull'>ChatFull</a>;
---functions---
@ -490,19 +624,17 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/constructor/help.noAppUpdate'>help.noAppUpdate</a>#c45a6536 = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
<a href='/constructor/updates'>updates</a>#74ae4240 updates:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Update'>Update</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; date:<a href='/type/int'>int</a> seq:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/constructor/updateServiceNotification'>updateServiceNotification</a>#ebe46819 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> inbox_date:flags.1?<a href='/type/int'>int</a> type:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> media:<a href='/type/MessageMedia'>MessageMedia</a> entities:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateServiceNotification'>updateServiceNotification</a>#ebe46819 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> invert_media:flags.2?<a href='/constructor/true'>true</a> inbox_date:flags.1?<a href='/type/int'>int</a> type:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> media:<a href='/type/MessageMedia'>MessageMedia</a> entities:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/help.inviteText'>help.inviteText</a>#18cb9f78 message:<a href='/type/string'>string</a> = <a href='/type/help.InviteText'>help.InviteText</a>;
---functions---
<a href='/method/help.getAppUpdate'>help.getAppUpdate</a>#522d5a7d source:<a href='/type/string'>string</a> = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
<a href='/method/help.getAppChangelog'>help.getAppChangelog</a>#9010ef6f prev_app_version:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/help.getInviteText'>help.getInviteText</a>#4d392343 = <a href='/type/help.InviteText'>help.InviteText</a>;</code></pre>
<ul>
<li><a href="/method/help.getAppUpdate">help.getAppUpdate</a> - Get info about an application update, can contain the updated application binary in the attached document</li>
<li><a href="/method/help.getAppChangelog">help.getAppChangelog</a> - Get a list of service messages with app-specific changelogs</li>
<li><a href="/method/help.getInviteText">help.getInviteText</a> - Returns a localized invitation message that can be sent via SMS to contacts that haven't signed up to Telegram yet</li>
</ul>
<h3><a class="anchor" href="#terms-of-service" id="terms-of-service" name="terms-of-service"><i class="anchor-icon"></i></a>Terms of service</h3>
@ -522,13 +654,13 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/method/account.deleteAccount'>account.deleteAccount</a>#a2c0cf74 flags:<a href='/type/%23'>#</a> reason:<a href='/type/string'>string</a> password:flags.0?<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>These methods can be used for managing consent to Telegram's <a href="https://telegram.org/tos">Terms Of Service</a>. </p>
<p>Typically, before a user <a href="/api/auth#sign-insign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>Typically, before a user <a href="/api/auth#sign-in-sign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>When signing up for the first time, the <a href="/constructor/help.termsOfService">help.termsOfService</a> is to be obtained from the <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a> constructor returned by the <a href="/method/auth.signIn">auth.signIn</a>. </p>
<p>After signing up, or when logging in as an existing user, apps are supposed to call <a href="/method/help.getTermsOfServiceUpdate">help.getTermsOfServiceUpdate</a> to check for any updates to the Terms of Service; this call should be repeated after <code>expires</code> seconds have elapsed.<br>
If an update to the Terms Of Service is available, clients are supposed to show a consent popup; if accepted, clients should call <a href="/method/help.acceptTermsOfService">help.acceptTermsOfService</a>, providing the <a href="/constructor/help.termsOfService">termsOfService <code>id</code> JSON object</a>; in case of denial, clients are to delete the account using <a href="/method/account.deleteAccount">account.deleteAccount</a>, providing <code>Decline ToS update</code> as deletion <code>reason</code>. </p>
<p>Example implementation: <a href="https://github.com/DrKLO/Telegram/blob/dbf81a34affcd1c24d78e1403347ea8b3a186154/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java#L3510">android (signup)</a>, <a href="https://github.com/DrKLO/Telegram/blob/ed9e38da5b3b6ca80a7cb719a000d310d07497b0/TMessagesProj/src/main/java/org/telegram/ui/Components/TermsOfServiceView.java">android (after login)</a></p>
<h3><a class="anchor" href="#telegram-support-info" id="telegram-support-info" name="telegram-support-info"><i class="anchor-icon"></i></a>Telegram support info</h3>
<pre><code><a href='/constructor/user'>user</a>#8f97c628 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> 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; = <a href='/type/User'>User</a>;
<pre><code><a href='/constructor/user'>user</a>#215c4438 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> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> = <a href='/type/User'>User</a>;
<a href='/constructor/help.support'>help.support</a>#17c6b5f6 phone_number:<a href='/type/string'>string</a> user:<a href='/type/User'>User</a> = <a href='/type/help.Support'>help.Support</a>;
<a href='/constructor/help.supportName'>help.supportName</a>#8c05f1c9 name:<a href='/type/string'>string</a> = <a href='/type/help.SupportName'>help.SupportName</a>;

View file

@ -53,7 +53,7 @@ This is implemented by using the dice constructors: </p>
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7547c966 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> top_msg_id:flags.9?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#c8a0ec74 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> hash:<a href='/type/int'>int</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;

View file

@ -47,6 +47,7 @@
<table class="table">
<tbody>
<tr>
<td> </td>
<td><strong>in_seq_no</strong></td>
<td><strong>out_seq_no</strong></td>
</tr>
@ -77,7 +78,7 @@
<li>If the received <strong>out_seq_no&gt;C+1</strong>, it most likely means that the server left out some messages due to a technical failure or due to the messages becoming obsolete. A temporary solution to this is to simply abort the secret chat. But since this may cause some existing older secret chats to be aborted, it is strongly recommended for the client to properly handle such <strong>seq_no</strong> gaps. Note that <strong>in_seq_no</strong> is not increased upon receipt of such a message; it is advanced only after all preceding gaps are filled.</li>
</ul>
<h4><a class="anchor" href="#proper-handling-of-gaps" id="proper-handling-of-gaps" name="proper-handling-of-gaps"><i class="anchor-icon"></i></a>Proper handling of gaps</h4>
<p>In order to correctly handle incoming messages after a hole has been identified (when received <strong>out_seq_no&gt;C+1</strong>), it is necessary to put received messages with the wrong <strong>seq_no</strong> into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor <a href="/constructor/decryptedMessageActionResend">decryptedMessageActionResend</a> <code>start_seq_no:<a href='/type/int'>int</a> end_seq_no:<a href='/type/int'>int</a> = <a href='/type/DecryptedMessageAction'>DecryptedMessageAction</a>;</code>. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore <em>cannot</em> be in their raw form: you can easily get the necessary <strong>start_seq_no</strong> by adding 2 to the <strong>out_seq_no</strong> of the last message before the hole and the <strong>end_seq_no</strong> by subtracting 2 from the <strong>out_seq_no</strong> of the received message with the wrong sequence number.</p>
<p>In order to correctly handle incoming messages after a hole has been identified (when received <strong>out_seq_no&gt;C+1</strong>), it is necessary to put received messages with the wrong <strong>seq_no</strong> into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor <a href="/constructor/decryptedMessageActionResend">decryptedMessageActionResend</a>. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore <em>cannot</em> be in their raw form: you can easily get the necessary <strong>start_seq_no</strong> by adding 2 to the <strong>out_seq_no</strong> of the last message before the hole and the <strong>end_seq_no</strong> by subtracting 2 from the <strong>out_seq_no</strong> of the received message with the wrong sequence number.</p>
<p>Each hole normally requires only one request to resend messages — if the remote client keeps sending out of sync messages, they should be put into the queue without sending a new request. Having received the missing messages, the local client must first interpret these messages in the right order by their <strong>seq_no</strong>. Once this is done, the client can proceed to interpret messages from the queue (again, in the right <strong>seq_no</strong> order).</p>
<p>Special cases:</p>
<ul>

View file

@ -54,7 +54,7 @@
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7547c966 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> top_msg_id:flags.9?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>To send a poll in a chat, call <a href="/method/messages.sendMedia">messages.sendMedia</a>, providing an <a href="/constructor/inputMediaPoll">inputMediaPoll</a>:</p>
<ul>
<li>
@ -85,7 +85,7 @@ These last two parameters are exactly the same, except that one uses absolute, t
<h3><a class="anchor" href="#voting-in-polls" id="voting-in-polls" name="voting-in-polls"><i class="anchor-icon"></i></a>Voting in polls</h3>
<pre><code><a href='/constructor/pollAnswerVoters'>pollAnswerVoters</a>#3b6ddad2 flags:<a href='/type/%23'>#</a> chosen:flags.0?<a href='/constructor/true'>true</a> correct:flags.1?<a href='/constructor/true'>true</a> option:<a href='/type/bytes'>bytes</a> voters:<a href='/type/int'>int</a> = <a href='/type/PollAnswerVoters'>PollAnswerVoters</a>;
<a href='/constructor/pollResults'>pollResults</a>#dcb82ea3 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/pollResults'>pollResults</a>#7adf2420 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Peer'>Peer</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/poll'>poll</a>#86e18161 id:<a href='/type/long'>long</a> flags:<a href='/type/%23'>#</a> closed:flags.0?<a href='/constructor/true'>true</a> public_voters:flags.1?<a href='/constructor/true'>true</a> multiple_choice:flags.2?<a href='/constructor/true'>true</a> quiz:flags.3?<a href='/constructor/true'>true</a> question:<a href='/type/string'>string</a> answers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswer'>PollAnswer</a>&gt; close_period:flags.4?<a href='/type/int'>int</a> close_date:flags.5?<a href='/type/int'>int</a> = <a href='/type/Poll'>Poll</a>;
@ -101,7 +101,7 @@ These last two parameters are exactly the same, except that one uses absolute, t
<h3><a class="anchor" href="#getting-poll-votes" id="getting-poll-votes" name="getting-poll-votes"><i class="anchor-icon"></i></a>Getting poll votes</h3>
<pre><code><a href='/constructor/pollAnswerVoters'>pollAnswerVoters</a>#3b6ddad2 flags:<a href='/type/%23'>#</a> chosen:flags.0?<a href='/constructor/true'>true</a> correct:flags.1?<a href='/constructor/true'>true</a> option:<a href='/type/bytes'>bytes</a> voters:<a href='/type/int'>int</a> = <a href='/type/PollAnswerVoters'>PollAnswerVoters</a>;
<a href='/constructor/pollResults'>pollResults</a>#dcb82ea3 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/pollResults'>pollResults</a>#7adf2420 flags:<a href='/type/%23'>#</a> min:flags.0?<a href='/constructor/true'>true</a> results:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PollAnswerVoters'>PollAnswerVoters</a>&gt; total_voters:flags.2?<a href='/type/int'>int</a> recent_voters:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Peer'>Peer</a>&gt; solution:flags.4?<a href='/type/string'>string</a> solution_entities:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/PollResults'>PollResults</a>;
<a href='/constructor/updateMessagePoll'>updateMessagePoll</a>#aca1657b flags:<a href='/type/%23'>#</a> poll_id:<a href='/type/long'>long</a> poll:flags.0?<a href='/type/Poll'>Poll</a> results:<a href='/type/PollResults'>PollResults</a> = <a href='/type/Update'>Update</a>;
@ -111,13 +111,13 @@ These last two parameters are exactly the same, except that one uses absolute, t
<p>Regularly, if new users have voted in polls available to the user, they will receive an <a href="/constructor/updateMessagePoll">updateMessagePoll</a>, with updated <a href="/constructor/pollResults">pollResults</a>. </p>
<p>The same constructor can also be fetched manually using <a href="/method/messages.getPollResults">messages.getPollResults</a>.</p>
<h3><a class="anchor" href="#getting-poll-voters-in-non-anonymous-polls" id="getting-poll-voters-in-non-anonymous-polls" name="getting-poll-voters-in-non-anonymous-polls"><i class="anchor-icon"></i></a>Getting poll voters in non-anonymous polls</h3>
<pre><code><a href='/constructor/messageUserVote'>messageUserVote</a>#34d247b4 user_id:<a href='/type/long'>long</a> option:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> = <a href='/type/MessageUserVote'>MessageUserVote</a>;
<a href='/constructor/messageUserVoteInputOption'>messageUserVoteInputOption</a>#3ca5b0ec user_id:<a href='/type/long'>long</a> date:<a href='/type/int'>int</a> = <a href='/type/MessageUserVote'>MessageUserVote</a>;
<a href='/constructor/messageUserVoteMultiple'>messageUserVoteMultiple</a>#8a65e557 user_id:<a href='/type/long'>long</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; date:<a href='/type/int'>int</a> = <a href='/type/MessageUserVote'>MessageUserVote</a>;
<pre><code><a href='/constructor/messagePeerVote'>messagePeerVote</a>#b6cc2d5c peer:<a href='/type/Peer'>Peer</a> option:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> = <a href='/type/MessagePeerVote'>MessagePeerVote</a>;
<a href='/constructor/messagePeerVoteInputOption'>messagePeerVoteInputOption</a>#74cda504 peer:<a href='/type/Peer'>Peer</a> date:<a href='/type/int'>int</a> = <a href='/type/MessagePeerVote'>MessagePeerVote</a>;
<a href='/constructor/messagePeerVoteMultiple'>messagePeerVoteMultiple</a>#4628f6e6 peer:<a href='/type/Peer'>Peer</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; date:<a href='/type/int'>int</a> = <a href='/type/MessagePeerVote'>MessagePeerVote</a>;
<a href='/constructor/messages.votesList'>messages.votesList</a>#823f649 flags:<a href='/type/%23'>#</a> count:<a href='/type/int'>int</a> votes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageUserVote'>MessageUserVote</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; next_offset:flags.0?<a href='/type/string'>string</a> = <a href='/type/messages.VotesList'>messages.VotesList</a>;
<a href='/constructor/messages.votesList'>messages.votesList</a>#4899484e flags:<a href='/type/%23'>#</a> count:<a href='/type/int'>int</a> votes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessagePeerVote'>MessagePeerVote</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; next_offset:flags.0?<a href='/type/string'>string</a> = <a href='/type/messages.VotesList'>messages.VotesList</a>;
<a href='/constructor/updateMessagePollVote'>updateMessagePollVote</a>#106395c9 poll_id:<a href='/type/long'>long</a> user_id:<a href='/type/long'>long</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; qts:<a href='/type/int'>int</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateMessagePollVote'>updateMessagePollVote</a>#24f40e77 poll_id:<a href='/type/long'>long</a> peer:<a href='/type/Peer'>Peer</a> options:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/bytes'>bytes</a>&gt; qts:<a href='/type/int'>int</a> = <a href='/type/Update'>Update</a>;
---functions---

View file

@ -63,7 +63,7 @@
<p>Bots can use <a href="/method/bots.setBotBroadcastDefaultAdminRights">bots.setBotBroadcastDefaultAdminRights</a> to indicate a suggested set of <a href="/api/rights">admin rights »</a> to use when adding the bot to a <a href="/api/channel">channel</a>, and <a href="/method/bots.setBotGroupDefaultAdminRights">bots.setBotGroupDefaultAdminRights</a> when adding the bot to a <a href="/api/channel">group</a>. </p>
<p>These suggested admin rights are contained in the <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code> paremeters of <a href="/constructor/userFull">userFull</a>, obtainable using <a href="/method/users.getFullUser">users.getFullUser</a>. </p>
<p>A client application trying to add a bot as admin should fetch the default rights and present them as editable defaults to the user: the rights can then be modified before <a href="#admin-rights">setting the bot as admin</a>.</p>
<p>Note that admin rights suggested by a <a href="/api/links#groupchannel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin. </p></div>
<p>Note that admin rights suggested by a <a href="/api/links#group-channel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin.</p></div>
</div>

View file

@ -48,7 +48,7 @@
<p>Schema: </p>
<pre><code><a href='/constructor/updateTranscribedAudio'>updateTranscribedAudio</a>#84cd5a flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/Peer'>Peer</a> msg_id:<a href='/type/int'>int</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/messages.transcribedAudio'>messages.transcribedAudio</a>#93752c52 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> = <a href='/type/messages.TranscribedAudio'>messages.TranscribedAudio</a>;
<a href='/constructor/messages.transcribedAudio'>messages.transcribedAudio</a>#cfb9d957 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> trial_remains_num:flags.1?<a href='/type/int'>int</a> trial_remains_until_date:flags.1?<a href='/type/int'>int</a> = <a href='/type/messages.TranscribedAudio'>messages.TranscribedAudio</a>;
---functions---
@ -57,7 +57,9 @@
<p>Use <a href="/method/messages.transcribeAudio">messages.transcribeAudio</a> to initiate transcription of a message.<br>
The returned <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> constructor will have the <code>pending</code> flag set if the transcription is still in progress and the transcribed text contained in <code>text</code> will be updated in future with <a href="/constructor/updateTranscribedAudio">updateTranscribedAudio</a> updates.<br>
These updates will contain the updated <code>text</code> with the same <code>transcription_id</code> returned in the first <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a>, and the <code>pending</code> flag will be set if the transcription is still in progress. </p>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p></div>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p>
<p>Users without a <a href="/api/premium">Telegram Premium</a> subscription can only transcribe <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a> messages per week, each of maximum duration equal to <a href="/api/config#transcribe-audio-trial-duration-max">transcribe_audio_trial_duration_max</a> seconds.<br>
For non-premium users, the <code>trial_remains_num</code> and <code>trial_remains_until_date</code> flags of <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> will also be set, indicating the remaining transcriptions, and the date when the <code>trial_remains_num</code> counter will be reset to the maximum value of <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a>.</p></div>
</div>

View file

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>messages.webPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Represents an Instant View webpage.">
<meta property="og:title" content="messages.webPage">
<meta property="og:image" content="">
<meta property="og:description" content="Represents an Instant View webpage.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/messages.webPage" >messages.webPage</a></li></ul></div>
<h1 id="dev_page_title">messages.webPage</h1>
<div id="dev_page_content"><p>Represents an Instant View webpage.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 165. <a href="?layer=165">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>webpage</strong></td>
<td style="text-align: center;"><a href="/type/WebPage">WebPage</a></td>
<td>The instant view webpage.</td>
</tr>
<tr>
<td><strong>chats</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/Chat">Chat</a>&gt;</td>
<td>Chats mentioned in the webpage.</td>
</tr>
<tr>
<td><strong>users</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/User">User</a>&gt;</td>
<td>Users mentioned in the webpage.</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/messages.WebPage">messages.WebPage</a></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</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,165 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>sponsoredWebPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Represents a sponsored website.">
<meta property="og:title" content="sponsoredWebPage">
<meta property="og:image" content="">
<meta property="og:description" content="Represents a sponsored website.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/sponsoredWebPage" >sponsoredWebPage</a></li></ul></div>
<h1 id="dev_page_title">sponsoredWebPage</h1>
<div id="dev_page_content"><p>Represents a sponsored website.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 159. <a href="?layer=159">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>flags</strong></td>
<td style="text-align: center;"><a href="/type/%23">#</a></td>
<td>Flags, see <a href="/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></td>
</tr>
<tr>
<td><strong>url</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Web page URL.</td>
</tr>
<tr>
<td><strong>site_name</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Website name.</td>
</tr>
<tr>
<td><strong>photo</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/Photo">Photo</a></td>
<td>Optional image preview.</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/SponsoredWebPage">SponsoredWebPage</a></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -110,8 +110,8 @@ Client developers are required to comply with the <a href="/mtproto/security_gui
MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is deprecated and is currently being phased out. </p>
</blockquote>
<h3><a class="anchor" href="#brief-component-summary" id="brief-component-summary" name="brief-component-summary"><i class="anchor-icon"></i></a>Brief Component Summary</h3>
<h4><a class="anchor" href="#high-level-component-rpc-query-languageapi" id="high-level-component-rpc-query-languageapi" name="high-level-component-rpc-query-languageapi"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific websocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
<h4><a class="anchor" href="#high-level-component-rpc-query-language-api" id="high-level-component-rpc-query-language-api" name="high-level-component-rpc-query-language-api"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific WebSocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
<p>Several connections to a server may be open; messages may be sent in either direction through any of the connections (a response to a query is not necessarily returned through the same connection that carried the original query, although most often, that is the case; however, in no case can a message be returned through a connection belonging to a different session). When the UDP protocol is used, a response might be returned by a different IP address than the one to which the query had been sent.</p>
<p>There are several types of messages:</p>
<ul>
@ -157,8 +157,8 @@ Additionally, the following transport features can be used: </p>
Multiple transport protocols are defined:</p>
<ul>
<li><a href="/mtproto/transports#tcp">TCP</a></li>
<li><a href="/mtproto/transports#websocket">Websocket</a></li>
<li><a href="/mtproto/transports#websocket-over-https">Websocket over HTTPS</a></li>
<li><a href="/mtproto/transports#websocket">WebSocket</a></li>
<li><a href="/mtproto/transports#websocket-over-https">WebSocket over HTTPS</a></li>
<li><a href="/mtproto/transports#http">HTTP</a></li>
<li><a href="/mtproto/transports#https">HTTPS</a></li>
<li>UDP</li>
@ -167,7 +167,7 @@ Multiple transport protocols are defined:</p>
<h3><a class="anchor" href="#recap" id="recap" name="recap"><i class="anchor-icon"></i></a>Recap</h3>
<p>To recap, using the <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_architecture">ISO/OSI stack as comparison</a>: </p>
<ul>
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-languageapi">High-level RPC API</a></li>
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-language-api">High-level RPC API</a></li>
<li>Layer 6 (Presentation): <a href="/mtproto/TL">Type Language</a></li>
<li>Layer 5 (Session): <a href="https://core.telegram.org/mtproto/description#session">MTProto session</a></li>
<li>Layer 4 (Transport):<ul>

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 54 BC 00 00 FF 9A 9E 64
0010 | 14 00 00 00 F1 8E 7E BE DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 72 06 00 50 3D C5 65
0010 | 14 00 00 00 F1 8E 7E BE 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF</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>54BC0000FF9A9E64</code></td>
<td><code>D4720600503DC565</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,15 +104,15 @@
<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 64 63 C2 FF 9A 9E 64
0010 | 50 00 00 00 63 24 16 05 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 08 1D 03 06 D7 8C 29 2A
0040 | 69 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 D8 31 75 50 3D C5 65
0010 | A8 00 00 00 63 24 16 05 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 08 25 65 95 ED B7 76 67
0040 | 97 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>
<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector&lt;long&gt; = ResPQ;</code></pre>
<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector&lt;strlong&gt; = ResPQ;</code></pre>
<table class="table">
<thead>
<tr>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>016463C2FF9A9E64</code></td>
<td><code>01D83175503DC565</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>50000000</code> (80 in decimal)</td>
<td><code>A8000000</code> (168 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,23 +150,23 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</td>
<td><code>08256595EDB7766797000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2694724800268887959</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>%(Vector long)</td>
<td>%(Vector strlong)</td>
<td>68, 4</td>
<td><code>15c4b51c</code></td>
<td><em>Vector t</em> constructor number from TL schema</td>
@ -206,24 +206,24 @@
<p>Let's choose the only matching key, the one with fingerprint equal to <code>85FD64DE851D9DD0</code>.</p>
<!-- end fingerprints -->
<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>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-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 = 2090522174869285481</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2090522174869285481 = 1112973847 * 1878321023</code></p>
<pre><code>p = 1112973847
q = 1878321023</code></pre>
<pre><code>pq = 2694724800268887959</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2694724800268887959 = 1513098571 * 1780931429</code></p>
<pre><code>p = 1513098571
q = 1780931429</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 1D 03 06 D7 8C 29 2A 69 00 00 00
0010 | 04 42 56 A2 17 00 00 00 04 6F F4 E7 7F 00 00 00
0020 | DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8 3A F2 02 7D
0030 | 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7 EF 43 97 39
0040 | 0E 63 58 A8 84 41 7C 48 A8 81 CD B2 44 E1 CE 7D
0050 | 3F F7 C4 E4 4E 38 10 39 EF DC E2 57 66 F4 8C E4
<pre><code>0000 | 95 5F F5 A9 08 25 65 95 ED B7 76 67 97 00 00 00
0010 | 04 5A 30 0D 4B 00 00 00 04 6A 26 DB 65 00 00 00
0020 | 40 67 09 F6 12 FA DF BE C3 F0 28 9D 0A A6 7E EF
0030 | E1 1D BC 3B C9 7D 91 A2 61 54 F9 32 AF 01 99 43
0040 | A8 BB C8 49 51 2D AC 6C 67 B6 EF D9 15 7D 6C A7
0050 | 37 7A 17 76 30 7D 84 26 5C 6B E9 BD CF 80 2A C1
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 = 1878321023</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</td>
<td><code>08256595EDB7766797000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2694724800268887959</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>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</td>
<td><code>045A300D4B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1513098571</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>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</td>
<td><code>046A26DB65000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1780931429</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>0E6358A884417C48A881CDB244E1CE7D</code> <code>3FF7C4E44E381039EFDCE25766F48CE4</code></td>
<td><code>A8BBC849512DAC6C67B6EFD9157D6CA7</code> <code>377A1776307D84265C6BE9BDCF802AC1</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1878321023</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 = 955FF5A9081D0306D78C292A69000000044256A217000000046FF4E77F000000DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390E6358A884417C48A881CDB244E1CE7D3FF7C4E44E381039EFDCE25766F48CE402000000
random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907CBA6FFDE7C240684F1767F3ABECA72A65B6B737894D25CF280679407F569BD4F5A52BCEB645852B499E9A467DFFD015FC2AA75DE1AB51568B018CEE65999DD3</code></pre>
<pre><code>data = 955FF5A908256595EDB7766797000000045A300D4B000000046A26DB65000000406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF019943A8BBC849512DAC6C67B6EFD9157D6CA7377A1776307D84265C6BE9BDCF802AC102000000
random_padding_bytes = D944BB8347C876177FE03C2562BF4E87258EF147A7815D8853AA4B1065A5A385D0DA7E0B6100FAF55728D04DFC84E7E0D20006E07E1CB036730F5B3209CF85B2365B39DE2CBC56F40B725AD347835E5D1973567ECE8A02CF343D54F7</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 = 978CD0DA71C89E58D5DD3A369FD23C91CDF29AE8DEF7D7FADC5303F2D7D0BF676E6408C20F9888167525245E891B2884D4894406FD34D0A3739BB89D8BEFC5982F4CE7D899CAD65156931C8048627A86C3549183D914CFFBCB3B39E2B719B1F243CEFBFEEB8E5EBCD0C343772500D27BA8CEB80A46FA4EEBD88435FDF979DF40938AC43C6947D55F7C3130122D5D90BAA23C03CDBD5EEDDF9D1F0D46054856E3A3F4A86E9BE4FF61E80FA5606A9A0D1F797DE334D6DE845B71C48544A5AC2ECEFC92F0194789C66085F6DBC1D81E6674A8CDAC6D1911BAEAE1279133C162A4091E04B85732AEBEC304C17DCD5A8637413EC2CAE8B00A06A2121179D4DBAACBB7</code></pre>
<pre><code>encrypted_data = B80632B3F0D1AB28EFAE2CF974C4A2D51A77FCB6DEFD415E1EC284CAB2B5F88D5C4C5B19AFF5E940CE14CCB6A7F340EC88DF7C1F091FB6F7323B047C02DC63212D0DEBE4B3B7A0310E26DB1289CBA24112DF37506C90DEAB797623E4AFF4643D2A921891346BC176C4E1CCE14F64FA59526DD021EFFA428E8F8ACEEB96DBD4729E99BBB26DDDC744D584B732415DFFE20418953F4EAFC81DADE5C6606A1E7FAA3EDB90F36ECF405422C97C360CC31A444B1EEB6C33D62C5802165C72BBC85D1ADBCCD17988DE7F43DA0F340502744B52B196A78EF1ED1372C6EA1232603FDB9C28F7F8783F29098FFD0FE9B066C460ECBA0A2962B82398C1B32D3DCB3BC3A59E</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 9C A0 09 00 FF 9A 9E 64
0010 | 40 01 00 00 BE E4 12 D7 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 04 42 56 A2 17 00 00 00
0040 | 04 6F F4 E7 7F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 97 8C D0 DA 71 C8 9E 58 D5 DD 3A 36
0060 | 9F D2 3C 91 CD F2 9A E8 DE F7 D7 FA DC 53 03 F2
0070 | D7 D0 BF 67 6E 64 08 C2 0F 98 88 16 75 25 24 5E
0080 | 89 1B 28 84 D4 89 44 06 FD 34 D0 A3 73 9B B8 9D
0090 | 8B EF C5 98 2F 4C E7 D8 99 CA D6 51 56 93 1C 80
00A0 | 48 62 7A 86 C3 54 91 83 D9 14 CF FB CB 3B 39 E2
00B0 | B7 19 B1 F2 43 CE FB FE EB 8E 5E BC D0 C3 43 77
00C0 | 25 00 D2 7B A8 CE B8 0A 46 FA 4E EB D8 84 35 FD
00D0 | F9 79 DF 40 93 8A C4 3C 69 47 D5 5F 7C 31 30 12
00E0 | 2D 5D 90 BA A2 3C 03 CD BD 5E ED DF 9D 1F 0D 46
00F0 | 05 48 56 E3 A3 F4 A8 6E 9B E4 FF 61 E8 0F A5 60
0100 | 6A 9A 0D 1F 79 7D E3 34 D6 DE 84 5B 71 C4 85 44
0110 | A5 AC 2E CE FC 92 F0 19 47 89 C6 60 85 F6 DB C1
0120 | D8 1E 66 74 A8 CD AC 6D 19 11 BA EA E1 27 91 33
0130 | C1 62 A4 09 1E 04 B8 57 32 AE BE C3 04 C1 7D CD
0140 | 5A 86 37 41 3E C2 CA E8 B0 0A 06 A2 12 11 79 D4
0150 | DB AA CB B7</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 72 06 00 50 3D C5 65
0010 | 40 01 00 00 BE E4 12 D7 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 04 5A 30 0D 4B 00 00 00
0040 | 04 6A 26 DB 65 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 B8 06 32 B3 F0 D1 AB 28 EF AE 2C F9
0060 | 74 C4 A2 D5 1A 77 FC B6 DE FD 41 5E 1E C2 84 CA
0070 | B2 B5 F8 8D 5C 4C 5B 19 AF F5 E9 40 CE 14 CC B6
0080 | A7 F3 40 EC 88 DF 7C 1F 09 1F B6 F7 32 3B 04 7C
0090 | 02 DC 63 21 2D 0D EB E4 B3 B7 A0 31 0E 26 DB 12
00A0 | 89 CB A2 41 12 DF 37 50 6C 90 DE AB 79 76 23 E4
00B0 | AF F4 64 3D 2A 92 18 91 34 6B C1 76 C4 E1 CC E1
00C0 | 4F 64 FA 59 52 6D D0 21 EF FA 42 8E 8F 8A CE EB
00D0 | 96 DB D4 72 9E 99 BB B2 6D DD C7 44 D5 84 B7 32
00E0 | 41 5D FF E2 04 18 95 3F 4E AF C8 1D AD E5 C6 60
00F0 | 6A 1E 7F AA 3E DB 90 F3 6E CF 40 54 22 C9 7C 36
0100 | 0C C3 1A 44 4B 1E EB 6C 33 D6 2C 58 02 16 5C 72
0110 | BB C8 5D 1A DB CC D1 79 88 DE 7F 43 DA 0F 34 05
0120 | 02 74 4B 52 B1 96 A7 8E F1 ED 13 72 C6 EA 12 32
0130 | 60 3F DB 9C 28 F7 F8 78 3F 29 09 8F FD 0F E9 B0
0140 | 66 C4 60 EC BA 0A 29 62 B8 23 98 C1 B3 2D 3D CB
0150 | 3B C3 A5 9E</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>9CA00900FF9A9E64</code></td>
<td><code>D8720600503DC565</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</td>
<td><code>045A300D4B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1513098571</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>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</td>
<td><code>046A26DB65000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1780931429</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100978CD0DA71C89E58D5DD3A36</code> <code>9FD23C91CDF29AE8DEF7D7FADC5303F2</code> <code>D7D0BF676E6408C20F9888167525245E</code> <code>891B2884D4894406FD34D0A3739BB89D</code> <code>8BEFC5982F4CE7D899CAD65156931C80</code> <code>48627A86C3549183D914CFFBCB3B39E2</code> <code>B719B1F243CEFBFEEB8E5EBCD0C34377</code> <code>2500D27BA8CEB80A46FA4EEBD88435FD</code> <code>F979DF40938AC43C6947D55F7C313012</code> <code>2D5D90BAA23C03CDBD5EEDDF9D1F0D46</code> <code>054856E3A3F4A86E9BE4FF61E80FA560</code> <code>6A9A0D1F797DE334D6DE845B71C48544</code> <code>A5AC2ECEFC92F0194789C66085F6DBC1</code> <code>D81E6674A8CDAC6D1911BAEAE1279133</code> <code>C162A4091E04B85732AEBEC304C17DCD</code> <code>5A8637413EC2CAE8B00A06A2121179D4</code><br> <code>DBAACBB7</code></td>
<td><code>FE000100B80632B3F0D1AB28EFAE2CF9</code> <code>74C4A2D51A77FCB6DEFD415E1EC284CA</code> <code>B2B5F88D5C4C5B19AFF5E940CE14CCB6</code> <code>A7F340EC88DF7C1F091FB6F7323B047C</code> <code>02DC63212D0DEBE4B3B7A0310E26DB12</code> <code>89CBA24112DF37506C90DEAB797623E4</code> <code>AFF4643D2A921891346BC176C4E1CCE1</code> <code>4F64FA59526DD021EFFA428E8F8ACEEB</code> <code>96DBD4729E99BBB26DDDC744D584B732</code> <code>415DFFE20418953F4EAFC81DADE5C660</code> <code>6A1E7FAA3EDB90F36ECF405422C97C36</code> <code>0CC31A444B1EEB6C33D62C5802165C72</code> <code>BBC85D1ADBCCD17988DE7F43DA0F3405</code> <code>02744B52B196A78EF1ED1372C6EA1232</code> <code>603FDB9C28F7F8783F29098FFD0FE9B0</code> <code>66C460ECBA0A2962B82398C1B32D3DCB</code><br> <code>3BC3A59E</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<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 98 C2 50 00 9B 9E 64
0010 | 78 02 00 00 5C 07 E8 D0 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 FE 50 02 00 A0 35 2C C0
0040 | 87 EA 1E 38 08 20 F7 C9 46 61 88 32 08 B6 F3 9D
0050 | 47 BA DA 5D C7 2B 94 D7 22 F6 F7 C4 19 4B D2 56
0060 | B0 75 4F BD 65 E2 C2 CA 64 28 AB 69 7A 3C D2 25
0070 | 5C 3C 28 96 7A 0B 83 3C 1B 51 C9 D5 73 F2 DE BC
0080 | B9 AE 8E BF 03 F6 C8 63 55 7D 44 02 7F 39 60 8B
0090 | 2C A0 2F C9 8F EF CD 0C 1F 31 54 95 E7 EC C8 B1
00A0 | 7A 33 47 D6 6C FD E0 35 3D E7 EB 42 1F E0 63 B0
00B0 | C2 E4 85 DC 3E F6 EB 7B AE 57 4B 21 DD DB F7 D2
00C0 | 73 BF D0 8B 0A 17 CF B9 34 0D D2 C9 C4 B6 FF F2
00D0 | 4E 02 DE 47 32 22 D0 86 9E D1 A2 2E C6 59 3F 3A
00E0 | 6E B6 55 07 2A CA B4 54 DC 17 33 A8 BA 64 A2 FA
00F0 | FC B9 67 9D 8F 1A 43 20 4C BB F3 59 60 5A FB A7
0100 | 7F 4F 4B 89 86 D8 A8 4B 35 76 83 38 09 78 BB 66
0110 | F7 15 8C 5A 89 ED 75 B1 07 99 8E 89 51 6D D9 33
0120 | DE DE 35 D2 FA 4F 53 DF 49 29 54 1B 45 26 FB 13
0130 | 49 38 1F 96 A8 57 EE FB 9D F2 65 84 FF 51 6F D0
0140 | 6B 23 67 96 0A 4E 38 6D 7D FA 06 7E 60 30 41 DB
0150 | 1A BD 27 48 28 BD 3D 5F B7 43 6D B2 B1 C2 5D 81
0160 | 05 F2 10 8A 48 AE 0B F4 19 65 24 E6 83 EC 10 CC
0170 | 3A B8 CD 58 35 8C 02 AC 41 D9 26 FF 1E CD 4A 5F
0180 | 19 36 98 6B C9 73 21 BD 4C 88 ED 7B 5F 09 4B 1E
0190 | 70 B7 2B 5E FC 1D 86 E9 82 43 05 19 52 35 F0 E0
01A0 | 66 F2 DF A0 BB D2 48 8C C8 8B B5 7A C7 89 59 59
01B0 | CB 1A FE BF B0 36 FB 92 00 E8 44 D2 60 31 A1 4A
01C0 | BB F5 18 B0 89 3A FA 4C 29 D7 B0 6C 69 0D 5A 7F
01D0 | D3 16 CC 92 08 17 D4 5E 7E FE BF EB B5 89 BA 99
01E0 | F4 10 40 93 29 6E 99 99 B0 9E A6 6A 72 67 9A DD
01F0 | BA CE C3 63 D1 50 E1 6D FB 8D 51 C4 6E 19 50 5D
0200 | C1 53 97 32 DD D3 CF F3 51 BD CE B2 8A D3 79 3C
0210 | 0D A3 08 D1 2A 31 3B D7 D2 66 BB BA 88 76 5E 20
0220 | F3 39 22 08 58 43 97 68 07 2F 26 C4 AB EC CE 48
0230 | A5 F8 99 C5 26 E5 26 6F 7A 4A 4E F2 F3 B0 8B 5F
0240 | 53 AB 6B 45 90 F9 E0 DF 8B 44 10 05 C8 0C E4 72
0250 | E2 68 31 F8 64 E0 A9 CE 06 C9 DF FE C4 E6 01 3A
0260 | 26 B8 23 A8 3B A4 64 3D 5F DD B6 DE EA F7 5D A3
0270 | 0C 87 AB FE 29 F4 71 DD 82 7B 39 9C 6E C5 9D 98
0280 | CE EE 1F D4 30 19 63 95 88 5F DB F9</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 4C 6E 1E 51 3D C5 65
0010 | C4 02 00 00 5C 07 E8 D0 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 FE 50 02 00 6A D7 DD 5D
0040 | 8B 25 26 C7 61 AB E5 0E 93 C8 2A 6F 33 1B 1E AE
0050 | 0A D0 11 89 3D A9 76 E3 77 1D 4A A4 52 09 D2 34
0060 | FE A6 56 42 98 53 86 B8 17 BF 89 80 F5 17 F6 D3
0070 | 2D BE B4 7E 34 53 45 56 F9 50 DD F9 60 DB 72 1A
0080 | 48 48 02 31 61 91 61 11 26 82 C6 04 6D 56 29 C7
0090 | 1C D1 EC 80 61 DF CD D7 04 70 3E C7 A8 AE BD CB
00A0 | D1 59 57 9F C8 88 6D 9F A5 1E 00 9A F4 9B 5A B9
00B0 | 0C 76 28 EB 81 C9 78 8A 2E B6 AC 0E 75 7A 7D EB
00C0 | E3 D9 49 F8 0A 99 0B ED B4 D2 DB AE 43 F0 03 28
00D0 | B8 2F 4D 8F C8 3A 9B 9C FE EF 46 7E 15 93 BB 45
00E0 | 79 EE 32 41 2F 16 7A 78 0C FA 51 76 50 BD 0E B5
00F0 | 1C BF B5 0E 3A FE 97 88 39 46 61 31 FC D9 56 71
0100 | 1E 63 61 4F 00 6A 55 ED 35 ED 2B 1F 83 3C 29 F4
0110 | FD 7A 84 F0 C8 F1 C1 0D FC 1A 1A AF 9A 8A 57 10
0120 | 8D EC F2 06 E3 96 84 06 F0 FB 25 E9 22 DF 15 4F
0130 | 49 7B 51 52 7E 48 34 20 2F AB 47 7A 13 7D 0A 99
0140 | D1 C3 47 19 6F BA 10 69 9F 52 EA 56 F0 1E F9 38
0150 | 29 B3 10 A5 C9 7D B9 5F D5 7E 64 41 7E 52 6E B9
0160 | 20 D2 61 15 7C 6E 38 79 1B DD 53 89 EE B7 44 E0
0170 | 75 D9 52 DB 33 A8 15 12 07 D0 AB 3C 62 9E 30 A7
0180 | 23 A5 20 5F 8F A1 83 98 93 7E D2 71 4A 4E 76 A5
0190 | F4 51 25 08 A4 BE 1B 4D 6A E4 6F D1 56 C6 F0 63
01A0 | 47 AF 5E 07 CE 49 27 91 95 13 3B 07 CC E4 BC 67
01B0 | 75 D8 8F 36 11 18 0D 23 C4 C7 09 46 61 9A D7 59
01C0 | AB 9F 18 3A 38 5C CF 9B F1 93 15 FA DB E8 A4 FD
01D0 | C7 48 AF 52 DF 93 03 45 90 9C 87 0D E4 B4 89 01
01E0 | E9 F9 0E 56 D7 4C A5 34 D8 E1 FE 3A 35 A9 2A 18
01F0 | D6 76 95 8E B8 FC 3D 82 F9 CE E3 08 DF 2A 9E 4C
0200 | CD 23 FF 89 EA 25 5B 9E ED BC 33 78 14 88 79 66
0210 | 6F FC 2E 19 A4 31 CB B5 7A E1 A0 10 FF E5 CB 39
0220 | AB F1 31 AD D9 E9 0B F9 69 A1 12 C4 35 50 9B 78
0230 | 96 0E 0B 20 03 1C 82 21 90 84 15 61 E8 39 04 46
0240 | 22 76 60 BB AC CF 3D 53 57 4B FB A3 3B F4 76 E3
0250 | BD C9 EB 68 0A A2 A1 7F D6 75 6F 65 27 25 ED 03
0260 | 13 E5 EB 0F D6 A9 C8 C9 49 EE FB E8 09 A8 93 11
0270 | BF 20 F4 00 55 CA 25 FD 16 9D C1 3E E1 4B 31 50
0280 | 92 FD E4 18 46 38 D8 49 68 2F D8 62</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,13 +464,13 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0198C250009B9E64</code></td>
<td><code>014C6E1E513DC565</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>78020000</code> (632 in decimal)</td>
<td><code>C4020000</code> (708 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200A0352CC087EA1E380820F7C9</code> <code>4661883208B6F39D47BADA5DC72B94D7</code> <code>22F6F7C4194BD256B0754FBD65E2C2CA</code> <code>6428AB697A3CD2255C3C28967A0B833C</code> <code>1B51C9D573F2DEBCB9AE8EBF03F6C863</code> <code>557D44027F39608B2CA02FC98FEFCD0C</code> <code>1F315495E7ECC8B17A3347D66CFDE035</code> <code>3DE7EB421FE063B0C2E485DC3EF6EB7B</code> <code>AE574B21DDDBF7D273BFD08B0A17CFB9</code> <code>340DD2C9C4B6FFF24E02DE473222D086</code> <code>9ED1A22EC6593F3A6EB655072ACAB454</code> <code>DC1733A8BA64A2FAFCB9679D8F1A4320</code> <code>4CBBF359605AFBA77F4F4B8986D8A84B</code> <code>357683380978BB66F7158C5A89ED75B1</code> <code>07998E89516DD933DEDE35D2FA4F53DF</code> <code>4929541B4526FB1349381F96A857EEFB</code> <code>9DF26584FF516FD06B2367960A4E386D</code> <code>7DFA067E603041DB1ABD274828BD3D5F</code> <code>B7436DB2B1C25D8105F2108A48AE0BF4</code> <code>196524E683EC10CC3AB8CD58358C02AC</code> <code>41D926FF1ECD4A5F1936986BC97321BD</code> <code>4C88ED7B5F094B1E70B72B5EFC1D86E9</code> <code>824305195235F0E066F2DFA0BBD2488C</code> <code>C88BB57AC7895959CB1AFEBFB036FB92</code> <code>00E844D26031A14ABBF518B0893AFA4C</code> <code>29D7B06C690D5A7FD316CC920817D45E</code> <code>7EFEBFEBB589BA99F4104093296E9999</code> <code>B09EA66A72679ADDBACEC363D150E16D</code> <code>FB8D51C46E19505DC1539732DDD3CFF3</code> <code>51BDCEB28AD3793C0DA308D12A313BD7</code> <code>D266BBBA88765E20F339220858439768</code> <code>072F26C4ABECCE48A5F899C526E5266F</code> <code>7A4A4EF2F3B08B5F53AB6B4590F9E0DF</code> <code>8B441005C80CE472E26831F864E0A9CE</code> <code>06C9DFFEC4E6013A26B823A83BA4643D</code> <code>5FDDB6DEEAF75DA30C87ABFE29F471DD</code> <code>827B399C6EC59D98CEEE1FD430196395</code><br> <code>885FDBF9</code></td>
<td><code>FE5002006AD7DD5D8B2526C761ABE50E</code> <code>93C82A6F331B1EAE0AD011893DA976E3</code> <code>771D4AA45209D234FEA65642985386B8</code> <code>17BF8980F517F6D32DBEB47E34534556</code> <code>F950DDF960DB721A4848023161916111</code> <code>2682C6046D5629C71CD1EC8061DFCDD7</code> <code>04703EC7A8AEBDCBD159579FC8886D9F</code> <code>A51E009AF49B5AB90C7628EB81C9788A</code> <code>2EB6AC0E757A7DEBE3D949F80A990BED</code> <code>B4D2DBAE43F00328B82F4D8FC83A9B9C</code> <code>FEEF467E1593BB4579EE32412F167A78</code> <code>0CFA517650BD0EB51CBFB50E3AFE9788</code> <code>39466131FCD956711E63614F006A55ED</code> <code>35ED2B1F833C29F4FD7A84F0C8F1C10D</code> <code>FC1A1AAF9A8A57108DECF206E3968406</code> <code>F0FB25E922DF154F497B51527E483420</code> <code>2FAB477A137D0A99D1C347196FBA1069</code> <code>9F52EA56F01EF93829B310A5C97DB95F</code> <code>D57E64417E526EB920D261157C6E3879</code> <code>1BDD5389EEB744E075D952DB33A81512</code> <code>07D0AB3C629E30A723A5205F8FA18398</code> <code>937ED2714A4E76A5F4512508A4BE1B4D</code> <code>6AE46FD156C6F06347AF5E07CE492791</code> <code>95133B07CCE4BC6775D88F3611180D23</code> <code>C4C70946619AD759AB9F183A385CCF9B</code> <code>F19315FADBE8A4FDC748AF52DF930345</code> <code>909C870DE4B48901E9F90E56D74CA534</code> <code>D8E1FE3A35A92A18D676958EB8FC3D82</code> <code>F9CEE308DF2A9E4CCD23FF89EA255B9E</code> <code>EDBC3378148879666FFC2E19A431CBB5</code> <code>7AE1A010FFE5CB39ABF131ADD9E90BF9</code> <code>69A112C435509B78960E0B20031C8221</code> <code>90841561E8390446227660BBACCF3D53</code> <code>574BFBA33BF476E3BDC9EB680AA2A17F</code> <code>D6756F652725ED0313E5EB0FD6A9C8C9</code> <code>49EEFBE809A89311BF20F40055CA25FD</code> <code>169DC13EE14B315092FDE4184638D849</code><br> <code>682FD862</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<!-- 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 = A0352CC087EA1E380820F7C94661883208B6F39D47BADA5DC72B94D722F6F7C4194BD256B0754FBD65E2C2CA6428AB697A3CD2255C3C28967A0B833C1B51C9D573F2DEBCB9AE8EBF03F6C863557D44027F39608B2CA02FC98FEFCD0C1F315495E7ECC8B17A3347D66CFDE0353DE7EB421FE063B0C2E485DC3EF6EB7BAE574B21DDDBF7D273BFD08B0A17CFB9340DD2C9C4B6FFF24E02DE473222D0869ED1A22EC6593F3A6EB655072ACAB454DC1733A8BA64A2FAFCB9679D8F1A43204CBBF359605AFBA77F4F4B8986D8A84B357683380978BB66F7158C5A89ED75B107998E89516DD933DEDE35D2FA4F53DF4929541B4526FB1349381F96A857EEFB9DF26584FF516FD06B2367960A4E386D7DFA067E603041DB1ABD274828BD3D5FB7436DB2B1C25D8105F2108A48AE0BF4196524E683EC10CC3AB8CD58358C02AC41D926FF1ECD4A5F1936986BC97321BD4C88ED7B5F094B1E70B72B5EFC1D86E9824305195235F0E066F2DFA0BBD2488CC88BB57AC7895959CB1AFEBFB036FB9200E844D26031A14ABBF518B0893AFA4C29D7B06C690D5A7FD316CC920817D45E7EFEBFEBB589BA99F4104093296E9999B09EA66A72679ADDBACEC363D150E16DFB8D51C46E19505DC1539732DDD3CFF351BDCEB28AD3793C0DA308D12A313BD7D266BBBA88765E20F339220858439768072F26C4ABECCE48A5F899C526E5266F7A4A4EF2F3B08B5F53AB6B4590F9E0DF8B441005C80CE472E26831F864E0A9CE06C9DFFEC4E6013A26B823A83BA4643D5FDDB6DEEAF75DA30C87ABFE29F471DD827B399C6EC59D98CEEE1FD430196395885FDBF9
tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</code></pre>
<pre><code>encrypted_answer = 6AD7DD5D8B2526C761ABE50E93C82A6F331B1EAE0AD011893DA976E3771D4AA45209D234FEA65642985386B817BF8980F517F6D32DBEB47E34534556F950DDF960DB721A48480231619161112682C6046D5629C71CD1EC8061DFCDD704703EC7A8AEBDCBD159579FC8886D9FA51E009AF49B5AB90C7628EB81C9788A2EB6AC0E757A7DEBE3D949F80A990BEDB4D2DBAE43F00328B82F4D8FC83A9B9CFEEF467E1593BB4579EE32412F167A780CFA517650BD0EB51CBFB50E3AFE978839466131FCD956711E63614F006A55ED35ED2B1F833C29F4FD7A84F0C8F1C10DFC1A1AAF9A8A57108DECF206E3968406F0FB25E922DF154F497B51527E4834202FAB477A137D0A99D1C347196FBA10699F52EA56F01EF93829B310A5C97DB95FD57E64417E526EB920D261157C6E38791BDD5389EEB744E075D952DB33A8151207D0AB3C629E30A723A5205F8FA18398937ED2714A4E76A5F4512508A4BE1B4D6AE46FD156C6F06347AF5E07CE49279195133B07CCE4BC6775D88F3611180D23C4C70946619AD759AB9F183A385CCF9BF19315FADBE8A4FDC748AF52DF930345909C870DE4B48901E9F90E56D74CA534D8E1FE3A35A92A18D676958EB8FC3D82F9CEE308DF2A9E4CCD23FF89EA255B9EEDBC3378148879666FFC2E19A431CBB57AE1A010FFE5CB39ABF131ADD9E90BF969A112C435509B78960E0B20031C822190841561E8390446227660BBACCF3D53574BFBA33BF476E3BDC9EB680AA2A17FD6756F652725ED0313E5EB0FD6A9C8C949EEFBE809A89311BF20F40055CA25FD169DC13EE14B315092FDE4184638D849682FD862
tmp_aes_key = 5EA702F743E850F5546E857F08B7D5337BBAEDF9B61248751594851BE2E8C297
tmp_aes_iv = 1CEF8E372A63D97EBFA805C0DBB018BC7C1E0931693FBCB1A1AFC0C0A8BBC849</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 46A914334DFF3DF06D9A1E5330BF60A105E40B07BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B
answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B</code></pre>
<pre><code>answer_with_hash = 60026275CC91DDEC5371C67B10331C4C1D362585BA0D89B5406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF01994303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A77200BDFF6E6C4C126A2C41DF310AB3A3BDBD698CD480749E1F3C64FB1CFC9DFC70AC6F1AA671019620A640055B2CF7D7D99CC86533645C0FA000954DE2987BAD68D7450CF134C9F0305F34C1BB285DA8233F65970A01C4BD3AFD5EA3CD5864B8F1DCB35D5E9737DF15063C54CF53048EF519A280498DDDAF23764F29FFB0C5813CAAD90C319BE8592B78C4BE815E65ADA7C62EA23754B5A2C5A86C4721872D0CC48E0F895C3EBE186E81E5F0E88A6B3F09101C409AF3410B64238FBF2A2095E3F3B7FFC7EB3A02A319B99A155647BC59958BCDFED8A1CC6EB7F13F8600E521D9D0247B0F639F2FA3B09F72987781F71C0E8AA950167DE5092380B4853E7F1513DC565C26F8049523E89D2
answer = BA0D89B5406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF01994303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A77200BDFF6E6C4C126A2C41DF310AB3A3BDBD698CD480749E1F3C64FB1CFC9DFC70AC6F1AA671019620A640055B2CF7D7D99CC86533645C0FA000954DE2987BAD68D7450CF134C9F0305F34C1BB285DA8233F65970A01C4BD3AFD5EA3CD5864B8F1DCB35D5E9737DF15063C54CF53048EF519A280498DDDAF23764F29FFB0C5813CAAD90C319BE8592B78C4BE815E65ADA7C62EA23754B5A2C5A86C4721872D0CC48E0F895C3EBE186E81E5F0E88A6B3F09101C409AF3410B64238FBF2A2095E3F3B7FFC7EB3A02A319B99A155647BC59958BCDFED8A1CC6EB7F13F8600E521D9D0247B0F639F2FA3B09F72987781F71C0E8AA950167DE5092380B4853E7F1513DC565C26F8049523E89D2</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 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | EF 43 97 39 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 40 67 09 F6 12 FA DF BE C3 F0 28 9D
0010 | 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2 61 54 F9 32
0020 | AF 01 99 43 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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
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 | 35 D6 63 91 75 B1 FF 6E 0A C4 01 89 37 0B 30 67
0140 | AF 8D 52 CE A7 08 7E 49 E0 17 07 B5 E6 11 2C B3
0150 | 33 27 26 7B D5 26 CD CD 1E 97 1B 04 88 E8 C9 35
0160 | 10 E8 60 49 B2 5F 64 01 70 B0 2B DE 60 9E 83 05
0170 | 0E 5F AB 06 54 C0 38 37 E7 83 20 18 15 2B 11 92
0180 | 8E 0F 2E 4C 33 27 DB E2 71 7E 12 3C C5 99 4E A0
0190 | A6 03 4C ED 7E AD 34 D9 9C A9 0D 89 40 B2 06 58
01A0 | 97 EB F6 17 B9 B1 66 2E 68 20 53 CD C7 5A 31 FD
01B0 | 6D 7B 27 B1 B8 FE 86 8C 81 39 75 2A 48 48 A5 49
01C0 | 3D FC 71 47 70 09 E0 65 3D 18 50 51 A7 D6 F6 C3
01D0 | A5 9C 2A 89 EC 8B 9B CD D8 7C B8 49 89 3D 70 92
01E0 | 61 D6 90 E3 84 35 65 DE B1 9B 76 B2 1F B8 A0 A2
01F0 | 8D E3 BE A1 98 69 F1 D7 33 46 90 9D 17 66 6F 94
0200 | 77 80 77 C5 99 76 11 76 24 85 36 A8 BB 94 4F 4F
0210 | 73 C3 66 BF 70 A0 4D 13 32 6D 22 79 99 E1 46 C8
0220 | 30 A4 73 FC 9B 1F 35 25 26 3F E3 0B 7D 82 C2 B7
0230 | 00 9B 9E 64</code></pre>
0130 | 0A 77 20 0B DF F6 E6 C4 C1 26 A2 C4 1D F3 10 AB
0140 | 3A 3B DB D6 98 CD 48 07 49 E1 F3 C6 4F B1 CF C9
0150 | DF C7 0A C6 F1 AA 67 10 19 62 0A 64 00 55 B2 CF
0160 | 7D 7D 99 CC 86 53 36 45 C0 FA 00 09 54 DE 29 87
0170 | BA D6 8D 74 50 CF 13 4C 9F 03 05 F3 4C 1B B2 85
0180 | DA 82 33 F6 59 70 A0 1C 4B D3 AF D5 EA 3C D5 86
0190 | 4B 8F 1D CB 35 D5 E9 73 7D F1 50 63 C5 4C F5 30
01A0 | 48 EF 51 9A 28 04 98 DD DA F2 37 64 F2 9F FB 0C
01B0 | 58 13 CA AD 90 C3 19 BE 85 92 B7 8C 4B E8 15 E6
01C0 | 5A DA 7C 62 EA 23 75 4B 5A 2C 5A 86 C4 72 18 72
01D0 | D0 CC 48 E0 F8 95 C3 EB E1 86 E8 1E 5F 0E 88 A6
01E0 | B3 F0 91 01 C4 09 AF 34 10 B6 42 38 FB F2 A2 09
01F0 | 5E 3F 3B 7F FC 7E B3 A0 2A 31 9B 99 A1 55 64 7B
0200 | C5 99 58 BC DF ED 8A 1C C6 EB 7F 13 F8 60 0E 52
0210 | 1D 9D 02 47 B0 F6 39 F2 FA 3B 09 F7 29 87 78 1F
0220 | 71 C0 E8 AA 95 01 67 DE 50 92 38 0B 48 53 E7 F1
0230 | 51 3D C5 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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010035D6639175B1FF6E0AC40189</code> <code>370B3067AF8D52CEA7087E49E01707B5</code> <code>E6112CB33327267BD526CDCD1E971B04</code> <code>88E8C93510E86049B25F640170B02BDE</code> <code>609E83050E5FAB0654C03837E7832018</code> <code>152B11928E0F2E4C3327DBE2717E123C</code> <code>C5994EA0A6034CED7EAD34D99CA90D89</code> <code>40B2065897EBF617B9B1662E682053CD</code> <code>C75A31FD6D7B27B1B8FE868C8139752A</code> <code>4848A5493DFC71477009E0653D185051</code> <code>A7D6F6C3A59C2A89EC8B9BCDD87CB849</code> <code>893D709261D690E3843565DEB19B76B2</code> <code>1FB8A0A28DE3BEA19869F1D73346909D</code> <code>17666F94778077C599761176248536A8</code> <code>BB944F4F73C366BF70A04D13326D2279</code> <code>99E146C830A473FC9B1F3525263FE30B</code><br> <code>7D82C2B7</code></td>
<td><code>FE0001000A77200BDFF6E6C4C126A2C4</code> <code>1DF310AB3A3BDBD698CD480749E1F3C6</code> <code>4FB1CFC9DFC70AC6F1AA671019620A64</code> <code>0055B2CF7D7D99CC86533645C0FA0009</code> <code>54DE2987BAD68D7450CF134C9F0305F3</code> <code>4C1BB285DA8233F65970A01C4BD3AFD5</code> <code>EA3CD5864B8F1DCB35D5E9737DF15063</code> <code>C54CF53048EF519A280498DDDAF23764</code> <code>F29FFB0C5813CAAD90C319BE8592B78C</code> <code>4BE815E65ADA7C62EA23754B5A2C5A86</code> <code>C4721872D0CC48E0F895C3EBE186E81E</code> <code>5F0E88A6B3F09101C409AF3410B64238</code> <code>FBF2A2095E3F3B7FFC7EB3A02A319B99</code> <code>A155647BC59958BCDFED8A1CC6EB7F13</code> <code>F8600E521D9D0247B0F639F2FA3B09F7</code> <code>2987781F71C0E8AA950167DE5092380B</code><br> <code>4853E7F1</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>009B9E64</code> (1688115968 in decimal)</td>
<td><code>513DC565</code> (1707425105 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<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 = F7C5CD46D4A88DED59C1B412D39FEC78BD86A6DC2BF2C5C5D8AF305204158F14B3244D42FFCF2363DC0D25DC6C48A16A3A0E63813D9E87442CA3C2CF84DF848C540531FCDBAD8290A6B25E021EB9AAEEB702F6FB31DC39C48EF615BB0CBBEDE1958D8BF5DCC205CBED3A9DFCD597115163A131DFD4939E68EB2C6F097A5632A3773D5201783A3B6CDE805794F5CBEEFD9FCB8DEAEAD1C5BCADD6366C8A907FABE99A026E59E8521085CE6130123E80B72DFD5EF3D2C0BC880F52DEEF7404638D8053D464036BF7057A77BE75EDA78D3C82221BB131FE6ECB8C43F77DF1D04935F978BA40F3F59385D6D6C2E7782BFFB040AB60F28459EB68A42A904B55E8088C</code></pre>
<pre><code>b = 1376A5A6BF7A9F874B47028F3D5CFF0689FD52F58949BB0EE9BACDBE81DD1CED07101844EB6F2AE19E61120B84799431F445785E33A18141399821479AE96786E0F4E9C5C6C9E46BF562C21C96B0F8F7438C8CABA3DFCB3DD3B886C2A37B95ED804315335C0DDFFEB3A278243D89F964278BC734D1087D6D4B554C1F78397A414F440E38BA9A4F1211B20AE835437762F81A45FDB035BB2220D939693084B39A3C7BE2481309AB9AE378EAB8BB3A15A69EBA80BEF683582E2218FA604E823EABD111553D31DBB46B9383A0D8EEF615FFF9CF266C970800AA28AC5E962D20351311A815FFA7562989CA6D6323BF2B5AF40EF3F45021B7445664852D07B80172CE</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 = 2545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1</code></pre>
<pre><code>g_b = A215D057BC6648453D68C2F418A38D9D4F4FA47E5D520AC7EBC2ADC3B00075090C10A1E9D96A5DDA127317F2DDC165C5F6C8C2854648C106D0D9DF684DAE70B0E6021658806245B494B762B1979E8BD597B5CC8E43A80F96CA47FB0765C98D40529F3D94C82113AE32C603AA24411EF8B330565A1D66EA6B89C9D4F8AFFEEA397C4B247564215D147B6AD0DF7F3FB4499E89E34304531D87448B91967B5BD53093F09386C0F78940C1DD6AA7C8667E15857453E6AAD275F94CD386468CF49108FB7C54282596A4D0314DCE9EFED4066A6E072471439AEAAA74157DB7DD53F01982982534DEE8740610BA433BF459B3DFE38674561F31991CE007BA112DDA6718</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 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | EF 43 97 39 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 25 45 CE 89 DA D1 4B DF 0F 1E 2E 34 F3 66 12 44
0040 | 74 E2 21 B5 C2 01 9C F5 24 06 12 B8 17 98 31 1E
0050 | 9E D3 32 01 DE 78 EA 34 B5 9D C0 15 1E 4C F8 20
0060 | DE EC 38 50 E1 B0 81 14 B7 59 9A 1C 99 F2 8A 85
0070 | 23 4A BC F8 DC 8B E8 AB 0C D1 01 9E C5 6A B7 BB
0080 | 2E 05 F0 7B 76 56 33 8B E2 54 AB B2 F4 5A D4 2A
0090 | 86 84 8E 60 2B 04 A6 B9 CC 92 62 78 0D 4F 87 50
00A0 | 5A 8B 17 19 1F 53 E7 2B DB 00 AB 29 0B 76 81 0E
00B0 | B1 5C 87 31 83 D7 2E C3 D2 CB 41 1C 3F 4B DC 79
00C0 | 44 E1 CA BF 55 71 B1 52 F7 FC 3C A1 DA 47 09 77
00D0 | 32 9D C4 98 54 BA 62 A8 5A E7 64 5F EC BD 81 83
00E0 | B5 A4 AA D0 6D FC 56 D4 BA 61 06 F8 1A 45 BE F3
00F0 | 2A 9E 4F 56 A2 13 FB 2A 02 7B 3A CD FD DD E6 A6
0100 | D5 7E 68 35 2C 82 F7 C0 D2 10 8F C0 10 72 59 29
0110 | CB 7C 88 EE 73 7F 7B 49 8D 86 13 4C 7C 7F 26 26
0120 | F0 35 70 67 A0 78 13 C0 D3 F2 C8 68 76 CC 1F F1</code></pre>
<pre><code>0000 | 54 B6 43 66 40 67 09 F6 12 FA DF BE C3 F0 28 9D
0010 | 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2 61 54 F9 32
0020 | AF 01 99 43 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | A2 15 D0 57 BC 66 48 45 3D 68 C2 F4 18 A3 8D 9D
0040 | 4F 4F A4 7E 5D 52 0A C7 EB C2 AD C3 B0 00 75 09
0050 | 0C 10 A1 E9 D9 6A 5D DA 12 73 17 F2 DD C1 65 C5
0060 | F6 C8 C2 85 46 48 C1 06 D0 D9 DF 68 4D AE 70 B0
0070 | E6 02 16 58 80 62 45 B4 94 B7 62 B1 97 9E 8B D5
0080 | 97 B5 CC 8E 43 A8 0F 96 CA 47 FB 07 65 C9 8D 40
0090 | 52 9F 3D 94 C8 21 13 AE 32 C6 03 AA 24 41 1E F8
00A0 | B3 30 56 5A 1D 66 EA 6B 89 C9 D4 F8 AF FE EA 39
00B0 | 7C 4B 24 75 64 21 5D 14 7B 6A D0 DF 7F 3F B4 49
00C0 | 9E 89 E3 43 04 53 1D 87 44 8B 91 96 7B 5B D5 30
00D0 | 93 F0 93 86 C0 F7 89 40 C1 DD 6A A7 C8 66 7E 15
00E0 | 85 74 53 E6 AA D2 75 F9 4C D3 86 46 8C F4 91 08
00F0 | FB 7C 54 28 25 96 A4 D0 31 4D CE 9E FE D4 06 6A
0100 | 6E 07 24 71 43 9A EA AA 74 15 7D B7 DD 53 F0 19
0110 | 82 98 25 34 DE E8 74 06 10 BA 43 3B F4 59 B3 DF
0120 | E3 86 74 56 1F 31 99 1C E0 07 BA 11 2D DA 67 18</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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001002545CE89DAD14BDF0F1E2E34</code> <code>F366124474E221B5C2019CF5240612B8</code> <code>1798311E9ED33201DE78EA34B59DC015</code> <code>1E4CF820DEEC3850E1B08114B7599A1C</code> <code>99F28A85234ABCF8DC8BE8AB0CD1019E</code> <code>C56AB7BB2E05F07B7656338BE254ABB2</code> <code>F45AD42A86848E602B04A6B9CC926278</code> <code>0D4F87505A8B17191F53E72BDB00AB29</code> <code>0B76810EB15C873183D72EC3D2CB411C</code> <code>3F4BDC7944E1CABF5571B152F7FC3CA1</code> <code>DA470977329DC49854BA62A85AE7645F</code> <code>ECBD8183B5A4AAD06DFC56D4BA6106F8</code> <code>1A45BEF32A9E4F56A213FB2A027B3ACD</code> <code>FDDDE6A6D57E68352C82F7C0D2108FC0</code> <code>10725929CB7C88EE737F7B498D86134C</code> <code>7C7F2626F0357067A07813C0D3F2C868</code><br> <code>76CC1FF1</code></td>
<td><code>FE000100A215D057BC6648453D68C2F4</code> <code>18A38D9D4F4FA47E5D520AC7EBC2ADC3</code> <code>B00075090C10A1E9D96A5DDA127317F2</code> <code>DDC165C5F6C8C2854648C106D0D9DF68</code> <code>4DAE70B0E6021658806245B494B762B1</code> <code>979E8BD597B5CC8E43A80F96CA47FB07</code> <code>65C98D40529F3D94C82113AE32C603AA</code> <code>24411EF8B330565A1D66EA6B89C9D4F8</code> <code>AFFEEA397C4B247564215D147B6AD0DF</code> <code>7F3FB4499E89E34304531D87448B9196</code> <code>7B5BD53093F09386C0F78940C1DD6AA7</code> <code>C8667E15857453E6AAD275F94CD38646</code> <code>8CF49108FB7C54282596A4D0314DCE9E</code> <code>FED4066A6E072471439AEAAA74157DB7</code> <code>DD53F01982982534DEE8740610BA433B</code> <code>F459B3DFE38674561F31991CE007BA11</code><br> <code>2DDA6718</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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<!-- 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 = 54B64366DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390000000000000000FE0001002545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1
padding = BD8A6AC82FFB68885A48E0ED
tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</code></pre>
<pre><code>data = 54B64366406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF0199430000000000000000FE000100A215D057BC6648453D68C2F418A38D9D4F4FA47E5D520AC7EBC2ADC3B00075090C10A1E9D96A5DDA127317F2DDC165C5F6C8C2854648C106D0D9DF684DAE70B0E6021658806245B494B762B1979E8BD597B5CC8E43A80F96CA47FB0765C98D40529F3D94C82113AE32C603AA24411EF8B330565A1D66EA6B89C9D4F8AFFEEA397C4B247564215D147B6AD0DF7F3FB4499E89E34304531D87448B91967B5BD53093F09386C0F78940C1DD6AA7C8667E15857453E6AAD275F94CD386468CF49108FB7C54282596A4D0314DCE9EFED4066A6E072471439AEAAA74157DB7DD53F01982982534DEE8740610BA433BF459B3DFE38674561F31991CE007BA112DDA6718
padding = 74876952857BA6AAA495A20D
tmp_aes_key = 5EA702F743E850F5546E857F08B7D5337BBAEDF9B61248751594851BE2E8C297
tmp_aes_iv = 1CEF8E372A63D97EBFA805C0DBB018BC7C1E0931693FBCB1A1AFC0C0A8BBC849</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 = E3B5716AC2E86342AD2E8C7B75FD17C713CE5C8559659F8301258D63D9101D1DB99EA9C1909315495C8776FD7885CA40AB860F38C8BD946F90CCEC63F3ED2A5A8F06F4E45BFDD0CC4A626AF74C299623B64E8E384BB7A66C36483EA667CE513FB5C2B9C7C635206E824F6BFC45A259CE0692745EBF3FDE3DEE350903FC0E2FF821DAECDF333B23F77866A444E2AC3B1BC8CC2EA38D4C2C3FF375FF70CFAF76E35BE863D54969CF4A887C8D6223874017B4B509CF3DE096E288512FBEF295D4DE4CC3CA6EAEA779B07100D8CC9E2EF7A6B40575CCC5EC93E32E7F8E4FD7332737F3B179573B4BEC13ABD868CC06A725ECFFC29494FE6AFFD3CEF2DE94681D4A3F19DDE0CF9BB0F13974443EA04D6CE173E0655BAFC847B5D55393BE982E00903B557B61FB38F15A88CADA345BC8B7820BB1C051C0A8B13AE70A5479E87D6BCA8A7AA73C306AF0FACD6760C566014DE790</code></pre>
<pre><code>encrypted_data = 14D185E575255986C29BE3A0437D525BA22430CBA0CD755225945AD3A1ACEFB536518514F5086892E6E3FA84D1CBB644BC8F7BEBCDE74E31BA8A073F47623EBB6E7D94B3A676A4C1AFD4689C52D05F73D21C33F64FE6AEABD04273D9117CD064E467E1F8E6C887BCAE4679E0399AD35DB1302A80629618F8C8485248D89A4E3568B464FF7B608CBE24B51EEB81B65D76224B62A1669EAA48A99C122E5E8A778E13DD441DC52175160088A498F186A2B99C736FE8C5C3E274D804C629564A0F15DDABC5B449356A7990900652A7432AFB1499C7CE09246F6B29006425DF2926465B04F17C0077B6A336A50E46B675AD5607F05818F84EADEC1F4847BF311027E742F8B1E183C01810C4CE964F2A0F36E257849C144C9B0B93B4A7A9E57391DB0CCB0D757A2B7A77257C8FF55553D66B6E1D45E9D8CA88E5A47B16322FF2ED5F5ABE099E7006B2D29C829D746B704130B1</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 30 0F 00 00 9B 9E 64
0010 | 78 01 00 00 1F 5F 04 F5 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 FE 50 01 00 E3 B5 71 6A
0040 | C2 E8 63 42 AD 2E 8C 7B 75 FD 17 C7 13 CE 5C 85
0050 | 59 65 9F 83 01 25 8D 63 D9 10 1D 1D B9 9E A9 C1
0060 | 90 93 15 49 5C 87 76 FD 78 85 CA 40 AB 86 0F 38
0070 | C8 BD 94 6F 90 CC EC 63 F3 ED 2A 5A 8F 06 F4 E4
0080 | 5B FD D0 CC 4A 62 6A F7 4C 29 96 23 B6 4E 8E 38
0090 | 4B B7 A6 6C 36 48 3E A6 67 CE 51 3F B5 C2 B9 C7
00A0 | C6 35 20 6E 82 4F 6B FC 45 A2 59 CE 06 92 74 5E
00B0 | BF 3F DE 3D EE 35 09 03 FC 0E 2F F8 21 DA EC DF
00C0 | 33 3B 23 F7 78 66 A4 44 E2 AC 3B 1B C8 CC 2E A3
00D0 | 8D 4C 2C 3F F3 75 FF 70 CF AF 76 E3 5B E8 63 D5
00E0 | 49 69 CF 4A 88 7C 8D 62 23 87 40 17 B4 B5 09 CF
00F0 | 3D E0 96 E2 88 51 2F BE F2 95 D4 DE 4C C3 CA 6E
0100 | AE A7 79 B0 71 00 D8 CC 9E 2E F7 A6 B4 05 75 CC
0110 | C5 EC 93 E3 2E 7F 8E 4F D7 33 27 37 F3 B1 79 57
0120 | 3B 4B EC 13 AB D8 68 CC 06 A7 25 EC FF C2 94 94
0130 | FE 6A FF D3 CE F2 DE 94 68 1D 4A 3F 19 DD E0 CF
0140 | 9B B0 F1 39 74 44 3E A0 4D 6C E1 73 E0 65 5B AF
0150 | C8 47 B5 D5 53 93 BE 98 2E 00 90 3B 55 7B 61 FB
0160 | 38 F1 5A 88 CA DA 34 5B C8 B7 82 0B B1 C0 51 C0
0170 | A8 B1 3A E7 0A 54 79 E8 7D 6B CA 8A 7A A7 3C 30
0180 | 6A F0 FA CD 67 60 C5 66 01 4D E7 90</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 5C 07 00 51 3D C5 65
0010 | 78 01 00 00 1F 5F 04 F5 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 FE 50 01 00 14 D1 85 E5
0040 | 75 25 59 86 C2 9B E3 A0 43 7D 52 5B A2 24 30 CB
0050 | A0 CD 75 52 25 94 5A D3 A1 AC EF B5 36 51 85 14
0060 | F5 08 68 92 E6 E3 FA 84 D1 CB B6 44 BC 8F 7B EB
0070 | CD E7 4E 31 BA 8A 07 3F 47 62 3E BB 6E 7D 94 B3
0080 | A6 76 A4 C1 AF D4 68 9C 52 D0 5F 73 D2 1C 33 F6
0090 | 4F E6 AE AB D0 42 73 D9 11 7C D0 64 E4 67 E1 F8
00A0 | E6 C8 87 BC AE 46 79 E0 39 9A D3 5D B1 30 2A 80
00B0 | 62 96 18 F8 C8 48 52 48 D8 9A 4E 35 68 B4 64 FF
00C0 | 7B 60 8C BE 24 B5 1E EB 81 B6 5D 76 22 4B 62 A1
00D0 | 66 9E AA 48 A9 9C 12 2E 5E 8A 77 8E 13 DD 44 1D
00E0 | C5 21 75 16 00 88 A4 98 F1 86 A2 B9 9C 73 6F E8
00F0 | C5 C3 E2 74 D8 04 C6 29 56 4A 0F 15 DD AB C5 B4
0100 | 49 35 6A 79 90 90 06 52 A7 43 2A FB 14 99 C7 CE
0110 | 09 24 6F 6B 29 00 64 25 DF 29 26 46 5B 04 F1 7C
0120 | 00 77 B6 A3 36 A5 0E 46 B6 75 AD 56 07 F0 58 18
0130 | F8 4E AD EC 1F 48 47 BF 31 10 27 E7 42 F8 B1 E1
0140 | 83 C0 18 10 C4 CE 96 4F 2A 0F 36 E2 57 84 9C 14
0150 | 4C 9B 0B 93 B4 A7 A9 E5 73 91 DB 0C CB 0D 75 7A
0160 | 2B 7A 77 25 7C 8F F5 55 53 D6 6B 6E 1D 45 E9 D8
0170 | CA 88 E5 A4 7B 16 32 2F F2 ED 5F 5A BE 09 9E 70
0180 | 06 B2 D2 9C 82 9D 74 6B 70 41 30 B1</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>E8300F00009B9E64</code></td>
<td><code>185C0700513DC565</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100E3B5716AC2E86342AD2E8C7B</code> <code>75FD17C713CE5C8559659F8301258D63</code> <code>D9101D1DB99EA9C1909315495C8776FD</code> <code>7885CA40AB860F38C8BD946F90CCEC63</code> <code>F3ED2A5A8F06F4E45BFDD0CC4A626AF7</code> <code>4C299623B64E8E384BB7A66C36483EA6</code> <code>67CE513FB5C2B9C7C635206E824F6BFC</code> <code>45A259CE0692745EBF3FDE3DEE350903</code> <code>FC0E2FF821DAECDF333B23F77866A444</code> <code>E2AC3B1BC8CC2EA38D4C2C3FF375FF70</code> <code>CFAF76E35BE863D54969CF4A887C8D62</code> <code>23874017B4B509CF3DE096E288512FBE</code> <code>F295D4DE4CC3CA6EAEA779B07100D8CC</code> <code>9E2EF7A6B40575CCC5EC93E32E7F8E4F</code> <code>D7332737F3B179573B4BEC13ABD868CC</code> <code>06A725ECFFC29494FE6AFFD3CEF2DE94</code> <code>681D4A3F19DDE0CF9BB0F13974443EA0</code> <code>4D6CE173E0655BAFC847B5D55393BE98</code> <code>2E00903B557B61FB38F15A88CADA345B</code> <code>C8B7820BB1C051C0A8B13AE70A5479E8</code> <code>7D6BCA8A7AA73C306AF0FACD6760C566</code><br> <code>014DE790</code></td>
<td><code>FE50010014D185E575255986C29BE3A0</code> <code>437D525BA22430CBA0CD755225945AD3</code> <code>A1ACEFB536518514F5086892E6E3FA84</code> <code>D1CBB644BC8F7BEBCDE74E31BA8A073F</code> <code>47623EBB6E7D94B3A676A4C1AFD4689C</code> <code>52D05F73D21C33F64FE6AEABD04273D9</code> <code>117CD064E467E1F8E6C887BCAE4679E0</code> <code>399AD35DB1302A80629618F8C8485248</code> <code>D89A4E3568B464FF7B608CBE24B51EEB</code> <code>81B65D76224B62A1669EAA48A99C122E</code> <code>5E8A778E13DD441DC52175160088A498</code> <code>F186A2B99C736FE8C5C3E274D804C629</code> <code>564A0F15DDABC5B449356A7990900652</code> <code>A7432AFB1499C7CE09246F6B29006425</code> <code>DF2926465B04F17C0077B6A336A50E46</code> <code>B675AD5607F05818F84EADEC1F4847BF</code> <code>311027E742F8B1E183C01810C4CE964F</code> <code>2A0F36E257849C144C9B0B93B4A7A9E5</code> <code>7391DB0CCB0D757A2B7A77257C8FF555</code> <code>53D66B6E1D45E9D8CA88E5A47B16322F</code> <code>F2ED5F5ABE099E7006B2D29C829D746B</code><br> <code>704130B1</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 = 48892B997A14A133B6D5B234A7F9B19DCE70CB192B9238372639DD6230B1BCC8D31BBBCCFA7F00BBEF38303BAE50FFF3DC814333123CE6E5980EF4493A74F38AD6B05B6737E296ADF4C97C69C95C5EC840BC22694F4CBFC14598B28F83B5CD79FE881F6AB9615226DF63078688371B3CDD2F6E97B35D17E6710E29469E1476B596C1DE136F05D585290776B306D6946B1C33374A459ECB0E9BFBC5A43D145A6B37C276E94C840EA0950B0B2523744CD538817DBA33CD6C84175AEA8561EBA117D2589EFB30A304B0F7AF29FF141E6B3F6F9FA5CEFF31DF1166937EA07D850427B6D779BBAB5B062526D435206EA25158EABC659DE3DC5E4ABF0D93B87B35E5E7</code></pre>
<pre><code>auth_key = ACA2547BAA3B4B3E6AD9129ADEE796042FC4ACAAABA40DCE7A1196640595829E2BA85C5E68E5D2B7B713B28720CCD0E65DA3B80CD8A9282BDE895755B924F4CBBCED119DEE057D3066D7095C25771A53D9AD6EC3464EE0E7FE1A4D9851F17B6CC7D6E636E0BDEA7D66153CF37005835A528E65673C1F5ADAA27465964BA89AA6FD045108B25B1DC9AB2D979864858C9EACBFA4A399CDBF2154D2CC6743C5CAA40683343D80A36C7F1289DC5AC5EE585DEA1E1CD296444EA6CD8F6C3564B2D355B310A3C02608EEA5EC36D38E941BF811489AB7A24C069E44FF54714CB4A45EEE2F310FDDC0A1B08BD3DFF8801E27C8508EFD7AD51EF3C13EF1D9A02EE4601741</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 84 8C 9F 00 9B 9E 64
0010 | 34 00 00 00 34 F7 CB 3B DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 B0 91 C6 77 C6 99 6C 09
0040 | FF 59 F2 F9 AB 28 16 78</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 00 BE 91 51 3D C5 65
0010 | 74 00 00 00 34 F7 CB 3B 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 11 42 87 13 52 16 5E 59
0040 | E1 12 40 36 B4 8B 97 D3</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>01848C9F009B9E64</code></td>
<td><code>0100BE91513DC565</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>34000000</code> (52 in decimal)</td>
<td><code>74000000</code> (116 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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>B091C677C6996C09FF59F2F9AB281678</code></td>
<td><code>1142871352165E59E1124036B48B97D3</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

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>SponsoredWebPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Represents a sponsored website.">
<meta property="og:title" content="SponsoredWebPage">
<meta property="og:image" content="">
<meta property="og:description" content="Represents a sponsored website.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/SponsoredWebPage" >SponsoredWebPage</a></li></ul></div>
<h1 id="dev_page_title">SponsoredWebPage</h1>
<div id="dev_page_content"><p>Represents a sponsored website.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code></code></pre></p>
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
<table class="table">
<thead>
<tr>
<th>Constructor</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/constructor/sponsoredWebPage">sponsoredWebPage</a></td>
<td>Represents a sponsored website.</td>
</tr>
</tbody>
</table></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</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,161 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Messages.WebPage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Contains an instant view webpage.">
<meta property="og:title" content="Messages.WebPage">
<meta property="og:image" content="">
<meta property="og:description" content="Contains an instant view webpage.">
<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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/messages.WebPage" >Messages.WebPage</a></li></ul></div>
<h1 id="dev_page_title">Messages.WebPage</h1>
<div id="dev_page_content"><p>Contains an instant view webpage.</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 158 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138">138 &ndash; GIF Sticker Packs</a></li><li><a href="?layer=139">139 &ndash; RTMP streaming</a></li><li><a href="?layer=140">140 &ndash; WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 &ndash; TCP Reflectors</a></li><li><a href="?layer=143">143 &ndash; Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 &ndash; Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 &ndash; Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 &ndash; Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 &ndash; Forums, collectible usernames</a></li><li><a href="?layer=150">150 &ndash; Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 &ndash; Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 &ndash; Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 &ndash; Modify created stickersets</a></li><li><a href="?layer=155">155 &ndash; Dates for reactions</a></li><li><a href="?layer=158"><strong>158 &ndash; Shared folders, per-chat wallpapers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code></code></pre></p>
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
<table class="table">
<thead>
<tr>
<th>Constructor</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/constructor/messages.webPage">messages.webPage</a></td>
<td>Represents an Instant View webpage.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#methods" id="methods" name="methods"><i class="anchor-icon"></i></a>Methods</h3>
<table class="table">
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/method/messages.getWebPage">messages.getWebPage</a></td>
<td>Get <a href="https://instantview.telegram.org">instant view</a> page</td>
</tr>
</tbody>
</table></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="/">Platform</a></h5>
<ul>
<li><a href="/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="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -46,35 +46,36 @@
<p>Interactive <a href="/bots/webapps">HTML5 Mini Apps</a> on Telegram can completely replace <strong>any website</strong>. </p>
<p>They support <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">seamless authorization</a>, <a href="https://core.telegram.org/bots/payments">integrated payments</a> via multiple payment providers (with <em>Google Pay</em> and <em>Apple Pay</em> out of the box), delivering tailored push notifications to users, and <a href="https://core.telegram.org/bots">much more</a>.</p>
<p>This article offers a client-side overview of the implementation of bot mini apps using the MTProto API: see <a href="/bots/webapps">here for an overview of the mini-app side JS API &raquo;</a>. </p>
<h3><a class="anchor" name="outgoing-events-mini-app-to-client" href="#outgoing-events-mini-app-to-client"><i class="anchor-icon"></i></a>Outgoing events: Mini App to client</h3>
<p>Both <a href="#simple-web-apps">simple</a> and <a href="#normal-web-apps">normal</a> Mini Apps can <em>send</em> web events starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for the full list of events that can be <em>sent</em> by the Mini App to the client &raquo;</a>. </p>
<h3><a class="anchor" name="incoming-events-client-to-mini-app" href="#incoming-events-client-to-mini-app"><i class="anchor-icon"></i></a>Incoming events: Client to Mini App</h3>
<p>Mini Apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent(&quot;event_name&quot;, params)</code> method. </p>
<p>Here&#39;s the full list of events that can be <em>received</em> by a Mini App from the client, by calling the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" name="main-button-pressed" href="#main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>This article offers a client-side overview of the implementation of bot mini apps using the MTProto API: see <a href="/bots/webapps">here for an overview of the mini-app side JS API »</a>. </p>
<h3><a class="anchor" href="#outgoing-events-mini-app-to-client" id="outgoing-events-mini-app-to-client" name="outgoing-events-mini-app-to-client"><i class="anchor-icon"></i></a>Outgoing events: Mini App to client</h3>
<p>Mini Apps can <em>send</em> web events starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for the full list of events that can be <em>sent</em> by the Mini App to the client »</a>. </p>
<h3><a class="anchor" href="#incoming-events-client-to-mini-app" id="incoming-events-client-to-mini-app" name="incoming-events-client-to-mini-app"><i class="anchor-icon"></i></a>Incoming events: Client to Mini App</h3>
<p>Mini Apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent("event_name", params)</code> method. </p>
<p>Here's the full list of events that can be <em>received</em> by a Mini App from the client, if the client invokes the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" href="#main-button-pressed" id="main-button-pressed" name="main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the main button located at the bottom of the webview, handle this event only if the main button was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event &raquo;</a>.</p>
<h4><a class="anchor" name="settings-button-pressed" href="#settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
<p>Sent by the client when the user presses the main button located at the bottom of the webview, handle this event only if the main button was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event »</a>.</p>
<h4><a class="anchor" href="#back-button-pressed" id="back-button-pressed" name="back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the settings button, if it was previously enabled in <a href="https://t.me/BotFather">@BotFather</a>, as specified by the <code>has_settings</code> flag of <a href="/constructor/attachMenuBot">attachMenuBot &raquo;</a>. </p>
<h4><a class="anchor" name="back-button-pressed" href="#back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
<p>Sent by the client when the user presses the (OS or UI) back button, if it was <a href="/api/web-events#web-app-setup-back-button">previously enabled by a <code>web_app_setup_back_button</code> event »</a>.</p>
<h4><a class="anchor" href="#settings-button-pressed" id="settings-button-pressed" name="settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
<p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the (OS or UI) back button, if it was <a href="/api/web-events#web-app-setup-back-button">previously enabled by a <code>web_app_setup_back_button</code> event &raquo;</a>.</p>
<h4><a class="anchor" name="invoice-closed" href="#invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
<p>Sent by the client when the user presses the settings button, if it was <a href="/api/web-events#web-app-setup-settings-button">previously enabled by a <code>web_app_setup_settings_button</code> event »</a>.</p>
<h4><a class="anchor" href="#invoice-closed" id="invoice-closed" name="invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
<p>Params: JSON object with the following fields:</p>
<ul>
<li><code>slug</code> - Invoice identifier (string)</li>
<li><code>status</code> - One of the following values (string):<ul>
<li><code>cancelled</code> The user closed the invoice popup without paying, before the call to <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a>.</li>
<li><code>failed</code> The user tried to pay, but the payment failed: the call to <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> returned an RPC error and the popup was closed.</li>
<li><code>pending</code> The payment is still processing: the bot will receive a further service message about a successful payment. <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> was successfully invoked returning <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>, the user completed all additional verification forms returned by the method and the invoice popup was closed, but the client hasn&#39;t received a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message yet.<br>Note that eventual errors will not be sent as a <code>failed</code> event if the user fails additional validation (ie 3-D Secure) returned by <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>: the state will remaing <code>pending</code>. </li>
<li><code>paid</code> The invoice was paid successfully: the client completed the <a href="/api/payments">payment flow &raquo;</a>, the invoice popup was closed and a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message was received by the client.</li>
<li><code>pending</code> The payment is still processing: the bot will receive a further service message about a successful payment. <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> was successfully invoked returning <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>, the user completed all additional verification forms returned by the method and the invoice popup was closed, but the client hasn't received a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message yet.<br>
Note that eventual errors will not be sent as a <code>failed</code> event if the user fails additional validation (ie 3-D Secure) returned by <a href="/constructor/payments.paymentVerificationNeeded">payments.paymentVerificationNeeded</a>: the state will remaing <code>pending</code>. </li>
<li><code>paid</code> The invoice was paid successfully: the client completed the <a href="/api/payments">payment flow »</a>, the invoice popup was closed and a <a href="/constructor/messageActionPaymentSent">messageActionPaymentSent</a> service message was received by the client.</li>
</ul>
</li>
</ul>
<p>Sent by the client to report the <a href="/api/payments">payment status</a> of an invoice obtained from a <a href="/api/web-events#web-app-open-invoice"><code>web_app_open_invoice</code> event &raquo;</a>. </p>
<h4><a class="anchor" name="viewport-changed" href="#viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
<p>Sent by the client to report the <a href="/api/payments">payment status</a> of an invoice obtained from a <a href="/api/web-events#web-app-open-invoice"><code>web_app_open_invoice</code> event »</a>. </p>
<h4><a class="anchor" href="#viewport-changed" id="viewport-changed" name="viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>height</code> - The current height of the visible area of the Mini App (excluding the bottom <a href="#main-button-pressed">main button</a>, if visible) (integer)</li>
@ -82,104 +83,14 @@
<li><code>is_expanded</code> - Whether the Mini App is expanded to its maximum height after the user swiped up or after the Mini App emitted a <a href="/api/web-events#web-app-expand">web_app_expand</a> event (boolean)</li>
</ul>
<p>Emitted when the viewport is changed. </p>
<h4><a class="anchor" name="theme-changed" href="#theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
<h4><a class="anchor" href="#theme-changed" id="theme-changed" name="theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>theme_params</code>: A <a href="#theme-parameters">theme parameters object &raquo;</a> (object)</li>
<li><code>theme_params</code> - A <a href="#theme-parameters">theme parameters object »</a> (object)</li>
</ul>
<p>Emitted when requested by the Mini App using a <a href="/api/web-events#web-app-request-theme"><code>web_app_request_theme</code> event &raquo;</a>, or when the app theme changes. </p>
<h4><a class="anchor" name="popup-closed" href="#popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web-app-open-popup"><code>web_app_open_popup</code> event &raquo;</a>. </p>
<h3><a class="anchor" name="simple-mini-apps" href="#simple-mini-apps"><i class="anchor-icon"></i></a>Simple Mini Apps</h3>
<p>Schema:</p>
<pre><code>replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector&lt;KeyboardButtonRow&gt; placeholder:flags.3?string = ReplyMarkup;
keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
simpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult;
---functions---
messages.requestSimpleWebView#299bec8e flags:# from_switch_webview:flags.1?true bot:InputUser url:string theme_params:flags.0?DataJSON platform:string = SimpleWebViewResult;
messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;</code></pre>
<p>Simple Mini Apps can only send data back to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event &raquo;</a>. </p>
<p>Simple Mini Apps can be opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> button contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, or by clicking on the <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button on top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
<p>To open them, users should call <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the original <code>url</code>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>If and only if the Mini App was opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> reply keyboard button, upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event &raquo;</a> from the Mini App, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
<ul>
<li><code>bot</code> - Bot ID</li>
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple Mini App</li>
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
</ul>
<p>Always ignore all <code>web_app_data_send</code> events received from <a href="/constructor/inlineBotWebView">inlineBotWebView</a> Mini Apps, as only <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> Mini Apps can send this event.</p>
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once. The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
<h3><a class="anchor" name="normal-mini-apps" href="#normal-mini-apps"><i class="anchor-icon"></i></a>Normal Mini Apps</h3>
<p>Schema:</p>
<pre><code>keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
botMenuButton#c7b57ce6 text:string url:string = BotMenuButton;
webViewResultUrl#c14557c query_id:long url:string = WebViewResult;
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;
updateWebViewResultSent#1592b79d query_id:long = Update;
webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;
---functions---
messages.requestWebView#178b480b flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = WebViewResult;
messages.prolongWebView#7ff34309 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = Bool;
messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;</code></pre>
<p>Normal Mini Apps work similarly to <a href="/api/bots/inline">inline bots &raquo;</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>Normal Mini Apps can be opened from:</p>
<ul>
<li>A <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor: in this case, <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>url</code>.</li>
<li>A <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button &raquo;</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set.</li>
<li>An <a href="/api/bots/attach">attachment menu &raquo;</a>: in this case, no special flag should be set, unless the attachment menu is opened via a with a <a href="/api/links#bot-attachment-menu-links">bot attachment menu deep link</a>, in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code>, if present.</li>
</ul>
<p>To open them, clients should call <a href="/method/messages.requestWebView">messages.requestWebView</a>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds: if the method call returns <code>QUERY_ID_INVALID</code>, the webview must be closed. </p>
<p>The opened URL&#39;s fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot Mini Apps JS library</a>: this <code>query_id</code> can then be used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p>
<h3><a class="anchor" name="named-bot-mini-apps" href="#named-bot-mini-apps"><i class="anchor-icon"></i></a>Named bot Mini Apps</h3>
<p>Schema:</p>
<pre><code>inputBotAppID#a920bd7a id:long access_hash:long = InputBotApp;
inputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp;
botAppNotModified#5da674b7 = BotApp;
botApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp;
messages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true app:BotApp = messages.BotApp;
appWebViewResultUrl#3c1b4f0d url:string = AppWebViewResult;
---functions---
messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;
messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult;</code></pre>
<p>Another way to open Mini Apps is by using <a href="/api/links#named-bot-web-app-links">named bot Mini App links &raquo;</a>. </p>
<p>These links are different from <a href="/api/links#bot-attachment-menu-links">bot attachment menu deep links &raquo;</a>, because they don&#39;t require the user to install an attachment menu, and a single bot can offer multiple Mini Apps, distinguished by their <code>short_name</code>. </p>
<p>These links should be handled as follows:<br><em> Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then
</em> Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.<br> If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.<br><em> If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned and its <code>request_write_access</code> flag is set, show a prompt to the user, indicating that the bot is asking permission to send messages to the user.<br> If the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> in the next step.
</em> If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the Mini App by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned.<br> <em> If the client has clicked on the link in a Telegram chat, pass the chat&#39;s peer information into <code>peer</code>; otherwise pass the bot&#39;s peer information, instead.
</em> If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, <strong>ask confirmation from the user</strong> before opening the Mini App; the <code>request_write_access</code> checkbox should be shown in this prompt, if needed.<br> Confirmation should <strong>always</strong> be asked, even if the <code>inactive</code> flag is not set, when opening the link from places where the full link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.).<br> <em> If the <code>startapp</code> query string parameter is present, pass it to <code>start_param</code> when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.
</em> If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>request_write_access</code> flag is set, the bot is asking permission to send messages to the user: if the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
<p>Finally, open the webview using the <code>url</code> contained in the returned <a href="/constructor/appWebViewResultUrl">appWebViewResultUrl</a>. </p>
<p>Since there is no linked inline query, <code>web_app_data_send</code> events must be ignored.<br>The bot can, however, write to the user directly if it already has a chat with the user or if it requested permission via <code>request_write_access</code> and the user granted it with <code>write_allowed</code>. </p>
<h3><a class="anchor" name="theme-parameters" href="#theme-parameters"><i class="anchor-icon"></i></a>Theme parameters</h3>
<p>Bot Mini Apps can be themed according to the following theme parameters, passed as a JSON object to the <code>theme_params</code> parameter of the <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and <a href="/method/messages.requestWebView">messages.requestWebView</a> methods. </p>
<p>Emitted when requested by the Mini App using a <a href="/api/web-events#web-app-request-theme"><code>web_app_request_theme</code> event »</a>, or when the app theme changes. </p>
<h5><a class="anchor" href="#theme-parameters" id="theme-parameters" name="theme-parameters"><i class="anchor-icon"></i></a>Theme parameters</h5>
<p>Bot Mini Apps can be themed according to the following theme parameters, passed as a JSON object to the <code>theme_params</code> parameter of the <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, <a href="/method/messages.requestWebView">messages.requestWebView</a> and <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> methods. </p>
<p>This JSON object has the following keys, containing color theme information (hex string, RGB, no alpha) to pass to the Mini App:</p>
<ul>
<li><code>bg_color</code> - Background color</li>
@ -189,8 +100,201 @@ messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:Inpu
<li><code>link_color</code> - Link color</li>
<li><code>button_color</code> - Button color</li>
<li><code>button_text_color</code> - Button text color</li>
<li><code>header_bg_color</code> - Header background color</li>
<li><code>accent_text_color</code> - Accent text color</li>
<li><code>section_bg_color</code> - Section background color</li>
<li><code>section_header_text_color</code> - Section header text color</li>
<li><code>subtitle_text_color</code> - Sub title text color</li>
<li><code>destructive_text_color</code> - Text color for destructive action buttons in prompts</li>
</ul>
</div>
<h4><a class="anchor" href="#popup-closed" id="popup-closed" name="popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web-app-open-popup"><code>web_app_open_popup</code> event »</a>. </p>
<h4><a class="anchor" href="#write-access-requested" id="write-access-requested" name="write-access-requested"><i class="anchor-icon"></i></a><code>write_access_requested</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>status</code> - <code>allowed</code> or <code>cancelled</code></li>
</ul>
<p>Used by clients to reply to a <a href="/api/web-events#web-app-request-write-access"><code>web_app_request_write_access</code> event »</a>, indicating whether the user has allowed the bot to send messages to the user (<code>allowed</code>) or not (<code>cancelled</code>). </p>
<h4><a class="anchor" href="#phone-requested" id="phone-requested" name="phone-requested"><i class="anchor-icon"></i></a><code>phone_requested</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>status</code> - <code>sent</code> or <code>cancelled</code></li>
</ul>
<p>Used by clients to reply to a <a href="/api/web-events#web-app-request-phone"><code>web_app_request_phone</code> event »</a>, indicating whether the user has shared their phone number with the bot (<code>allowed</code>) or not (<code>cancelled</code>). </p>
<h4><a class="anchor" href="#custom-method-invoked" id="custom-method-invoked" name="custom-method-invoked"><i class="anchor-icon"></i></a><code>custom_method_invoked</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_invoke_custom_method</code> request</li>
<li><code>result</code> - The JSON data contained in the response of the <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> method, if the method call succeeded</li>
<li><code>error</code> - The text of the RPC error, if the method call failed</li>
</ul>
<p>Used by clients to reply to <a href="/api/web-events#web-app-invoke-custom-method"><code>web_app_invoke_custom_method</code> events »</a>. </p>
<h4><a class="anchor" href="#clipboard-text-received" id="clipboard-text-received" name="clipboard-text-received"><i class="anchor-icon"></i></a><code>clipboard_text_received</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_read_text_from_clipboard</code> request</li>
<li><code>data</code> - A string with the clipboard contents (optional, if not provided consider the request failed)</li>
</ul>
<p>Used by clients to reply to <a href="/api/web-events#web-app-read-text-from-clipboard"><code>web_app_read_text_from_clipboard</code> events »</a>. </p>
<h4><a class="anchor" href="#qr-text-received" id="qr-text-received" name="qr-text-received"><i class="anchor-icon"></i></a><code>qr_text_received</code></h4>
<p>Params: a JSON object with the following fields:</p>
<ul>
<li><code>data</code> - string with the contents of a scanned QR code.</li>
</ul>
<p>Emitted by clients if a new QR code was scanned by the native QR code scanner opened with a <a href="/api/web-events#web-app-open-scan-qr-popup"><code>web_app_open_scan_qr_popup</code> event »</a>. </p>
<h4><a class="anchor" href="#scan-qr-popup-closed" id="scan-qr-popup-closed" name="scan-qr-popup-closed"><i class="anchor-icon"></i></a><code>scan_qr_popup_closed</code></h4>
<p>Params: <code>null</code> or an empty object</p>
<p>Emitted by clients if the QR code scanner popup opened with a <a href="/api/web-events#web-app-open-scan-qr-popup"><code>web_app_open_scan_qr_popup</code> event »</a> was closed by the user or failed to open altogether due to permission issues. </p>
<h3><a class="anchor" href="#keyboard-button-mini-apps" id="keyboard-button-mini-apps" name="keyboard-button-mini-apps"><i class="anchor-icon"></i></a>Keyboard Button Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/replyKeyboardMarkup'>replyKeyboardMarkup</a>#85dd99d1 flags:<a href='/type/%23'>#</a> resize:flags.0?<a href='/constructor/true'>true</a> single_use:flags.1?<a href='/constructor/true'>true</a> selective:flags.2?<a href='/constructor/true'>true</a> persistent:flags.4?<a href='/constructor/true'>true</a> rows:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/KeyboardButtonRow'>KeyboardButtonRow</a>&gt; placeholder:flags.3?<a href='/type/string'>string</a> = <a href='/type/ReplyMarkup'>ReplyMarkup</a>;
<a href='/constructor/keyboardButtonSimpleWebView'>keyboardButtonSimpleWebView</a>#a0c0505c text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/KeyboardButton'>KeyboardButton</a>;
<a href='/constructor/messageActionWebViewDataSentMe'>messageActionWebViewDataSentMe</a>#47dd8079 text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/MessageAction'>MessageAction</a>;
<a href='/constructor/messageActionWebViewDataSent'>messageActionWebViewDataSent</a>#b4c38cb5 text:<a href='/type/string'>string</a> = <a href='/type/MessageAction'>MessageAction</a>;
<a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
<a href='/method/messages.sendWebViewData'>messages.sendWebViewData</a>#dc0242c8 bot:<a href='/type/InputUser'>InputUser</a> random_id:<a href='/type/long'>long</a> button_text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Keyboard Button Mini Apps should be opened when the user clicks a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, by invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the button's <code>url</code> to the <code>url</code> parameter. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Keyboard Button Mini Apps can send data back to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a>. </p>
<p>Upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a> <strong>only</strong> from Keyboard Button Mini Apps, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
<ul>
<li><code>bot</code> - Bot ID</li>
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple Mini App</li>
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
</ul>
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once. The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
<h3><a class="anchor" href="#inline-button-mini-apps" id="inline-button-mini-apps" name="inline-button-mini-apps"><i class="anchor-icon"></i></a>Inline button Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/keyboardButtonWebView'>keyboardButtonWebView</a>#13767230 text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/KeyboardButton'>KeyboardButton</a>;
<a href='/constructor/webViewResultUrl'>webViewResultUrl</a>#c14557c query_id:<a href='/type/long'>long</a> url:<a href='/type/string'>string</a> = <a href='/type/WebViewResult'>WebViewResult</a>;
<a href='/constructor/inputBotInlineResult'>inputBotInlineResult</a>#88bf9319 flags:<a href='/type/%23'>#</a> id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> title:flags.1?<a href='/type/string'>string</a> description:flags.2?<a href='/type/string'>string</a> url:flags.3?<a href='/type/string'>string</a> thumb:flags.4?<a href='/type/InputWebDocument'>InputWebDocument</a> content:flags.5?<a href='/type/InputWebDocument'>InputWebDocument</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultPhoto'>inputBotInlineResultPhoto</a>#a8d864a7 id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> photo:<a href='/type/InputPhoto'>InputPhoto</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultDocument'>inputBotInlineResultDocument</a>#fff8fdc4 flags:<a href='/type/%23'>#</a> id:<a href='/type/string'>string</a> type:<a href='/type/string'>string</a> title:flags.1?<a href='/type/string'>string</a> description:flags.2?<a href='/type/string'>string</a> document:<a href='/type/InputDocument'>InputDocument</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/inputBotInlineResultGame'>inputBotInlineResultGame</a>#4fa417f2 id:<a href='/type/string'>string</a> short_name:<a href='/type/string'>string</a> send_message:<a href='/type/InputBotInlineMessage'>InputBotInlineMessage</a> = <a href='/type/InputBotInlineResult'>InputBotInlineResult</a>;
<a href='/constructor/updateWebViewResultSent'>updateWebViewResultSent</a>#1592b79d query_id:<a href='/type/long'>long</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/webViewMessageSent'>webViewMessageSent</a>#c94511c flags:<a href='/type/%23'>#</a> msg_id:flags.0?<a href='/type/InputBotInlineMessageID'>InputBotInlineMessageID</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;
---functions---
<a href='/method/messages.requestWebView'>messages.requestWebView</a>#269dc2c1 flags:<a href='/type/%23'>#</a> from_bot_menu:flags.4?<a href='/constructor/true'>true</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.1?<a href='/type/string'>string</a> start_param:flags.3?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/WebViewResult'>WebViewResult</a>;
<a href='/method/messages.prolongWebView'>messages.prolongWebView</a>#b0d81a83 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> query_id:<a href='/type/long'>long</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.sendWebViewResultMessage'>messages.sendWebViewResultMessage</a>#a4314f5 bot_query_id:<a href='/type/string'>string</a> result:<a href='/type/InputBotInlineResult'>InputBotInlineResult</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;</code></pre>
<p>Inline Button Mini Apps work similarly to <a href="/api/bots/inline">inline bots »</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>When the user clicks on an <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> inline button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor, <a href="/method/messages.requestWebView">messages.requestWebView</a> should be invoked, passing <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to the method's <code>url</code> parameter. </p>
<p>Then, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds: if the method call returns <code>QUERY_ID_INVALID</code>, the webview must be closed. </p>
<p>The opened URL's fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot Mini Apps JS library</a>: this <code>query_id</code> can then be passed to the bot (within the Mini App itself, for example via an AJAX query or form submission to the server hosting the Mini App and the bot) and then used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p>
<h3><a class="anchor" href="#menu-button-mini-apps" id="menu-button-mini-apps" name="menu-button-mini-apps"><i class="anchor-icon"></i></a>Menu button Mini Apps</h3>
<p>Menu button Mini Apps work similarly to <a href="#inline-button-mini-apps">inline button Mini Apps »</a>: they send messages on behalf of the user to the chat from where the <a href="/api/bots/menu">bot menu button »</a> was clicked. </p>
<p>Menu button Mini Apps can be opened from a <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button »</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set, and the <a href="/constructor/botMenuButton">botMenuButton</a>.<code>url</code> field must be passed to the method's <code>url</code> parameter. </p>
<p>The full flow is identical to the flow for <a href="#inline-button-mini-apps">inline button Mini Apps »</a>, apart from the different flags passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>, as described above.</p>
<h3><a class="anchor" href="#attachment-menu-mini-apps" id="attachment-menu-mini-apps" name="attachment-menu-mini-apps"><i class="anchor-icon"></i></a>Attachment menu Mini Apps</h3>
<p>Attachment menu Mini Apps work similarly to <a href="#inline-button-mini-apps">inline button Mini Apps »</a>: they send messages on behalf of the user to the chat where the bot's <a href="/api/bots/attach">attachment menu »</a> was opened. </p>
<p>Attachment menu Mini Apps can be opened from an <a href="/api/bots/attach">attachment menu entry »</a>: in this case, no special flag should be set when invoking <a href="/method/messages.requestWebView">messages.requestWebView</a>. </p>
<p>Attachment menu Mini Apps can also be opened from a <a href="/api/links#bot-attachment-or-side-menu-links">bot attachment menu deep link</a>, in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code>, if present.</p>
<p>The full flow is identical to the flow for <a href="#inline-button-mini-apps">inline button Mini Apps »</a>, apart from the different flags passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>, as described above.</p>
<h3><a class="anchor" href="#inline-mode-mini-apps" id="inline-mode-mini-apps" name="inline-mode-mini-apps"><i class="anchor-icon"></i></a>Inline mode Mini Apps</h3>
<pre><code><a href='/constructor/messages.botResults'>messages.botResults</a>#e021f2f6 flags:<a href='/type/%23'>#</a> gallery:flags.0?<a href='/constructor/true'>true</a> query_id:<a href='/type/long'>long</a> next_offset:flags.1?<a href='/type/string'>string</a> switch_pm:flags.2?<a href='/type/InlineBotSwitchPM'>InlineBotSwitchPM</a> switch_webview:flags.3?<a href='/type/InlineBotWebView'>InlineBotWebView</a> results:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInlineResult'>BotInlineResult</a>&gt; cache_time:<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/messages.BotResults'>messages.BotResults</a>;
<a href='/constructor/inlineBotWebView'>inlineBotWebView</a>#b57295d5 text:<a href='/type/string'>string</a> url:<a href='/type/string'>string</a> = <a href='/type/InlineBotWebView'>InlineBotWebView</a>;
<a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.getInlineBotResults'>messages.getInlineBotResults</a>#514e999d flags:<a href='/type/%23'>#</a> bot:<a href='/type/InputUser'>InputUser</a> peer:<a href='/type/InputPeer'>InputPeer</a> geo_point:flags.0?<a href='/type/InputGeoPoint'>InputGeoPoint</a> query:<a href='/type/string'>string</a> offset:<a href='/type/string'>string</a> = <a href='/type/messages.BotResults'>messages.BotResults</a>;
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;</code></pre>
<p>Not to be confused with <a href="#inline-button-mini-apps">inline button mini apps »</a>. </p>
<p>Inline mode Mini Apps can be used to generate a custom set of inline results in response to a user's <a href="/api/bots/inline">inline query »</a> via a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a>. </p>
<p>Inline mode Mini Apps can be opened by clicking on an <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button returned at the top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
<p>Pass the <code>url</code> to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, while also setting the <code>from_switch_webview</code> flag. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Once the user has finished making their choices in the Mini App, a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a> should be emitted, containing a JSON object with the following fields:</p>
<ul>
<li><code>query</code> - The inline query that will be inserted in the chat's input field, after the bot's username.<br>
May be an empty string, in which case just the bot's username will be inserted, triggering an empty inline query.</li>
<li><code>chat_types</code> - An array of strings, containing a combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code>.<br>
If non-empty, the client should prompt the user to choose a specific chat of the specified type(s), then open the chosen chat and inserts the bot's username and the specified inline query in the input field.<br>
The array values specify which types of chats the user will be able to choose from.<br>
If empty, the current chat is used. </li>
</ul>
<p>Upon receiving a <a href="/api/web-events#web-app-switch-inline-query"><code>web_app_switch_inline_query</code> JS event »</a> from the Mini App, the client should <a href="/api/bots/inline">make a new inline query »</a> to the same bot, with the newly specified <code>query</code>, either in the current chat or in the newly chosen chat, as specified by the <code>chat_types</code> field. </p>
<h3><a class="anchor" href="#side-menu-mini-apps" id="side-menu-mini-apps" name="side-menu-mini-apps"><i class="anchor-icon"></i></a>Side menu Mini Apps</h3>
<pre><code><a href='/constructor/simpleWebViewResultUrl'>simpleWebViewResultUrl</a>#882f76bb url:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;
---functions---
<a href='/method/messages.requestSimpleWebView'>messages.requestSimpleWebView</a>#1a46500a flags:<a href='/type/%23'>#</a> from_switch_webview:flags.1?<a href='/constructor/true'>true</a> from_side_menu:flags.2?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> url:flags.3?<a href='/type/string'>string</a> start_param:flags.4?<a href='/type/string'>string</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/SimpleWebViewResult'>SimpleWebViewResult</a>;</code></pre>
<p>Side menu Mini Apps can be opened by clicking on the installed <a href="/api/bots/attach">side menu entry »</a>. </p>
<p>This action must trigger a <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> query with the <code>from_side_menu</code> flag set: clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<p>Side menu Mini Apps can also be opened by clicking on a <a href="/api/links#mini-app-links">Mini App link »</a>: in which case the <code>start_parameter</code> should be provided to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>.<code>start_param</code>, if present; note that in this case, the app should be opened (with an <a href="/api/bots/attach">installation prompt »</a> before, if not already installed) even if the client is minimized. </p>
<p>After invoking <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> and obtaining a <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a> result, clients should open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
<h3><a class="anchor" href="#direct-link-mini-apps" id="direct-link-mini-apps" name="direct-link-mini-apps"><i class="anchor-icon"></i></a>Direct Link Mini Apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/inputBotAppID'>inputBotAppID</a>#a920bd7a id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputBotApp'>InputBotApp</a>;
<a href='/constructor/inputBotAppShortName'>inputBotAppShortName</a>#908c0407 bot_id:<a href='/type/InputUser'>InputUser</a> short_name:<a href='/type/string'>string</a> = <a href='/type/InputBotApp'>InputBotApp</a>;
<a href='/constructor/botAppNotModified'>botAppNotModified</a>#5da674b7 = <a href='/type/BotApp'>BotApp</a>;
<a href='/constructor/botApp'>botApp</a>#95fcd1d6 flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> short_name:<a href='/type/string'>string</a> title:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> photo:<a href='/type/Photo'>Photo</a> document:flags.0?<a href='/type/Document'>Document</a> hash:<a href='/type/long'>long</a> = <a href='/type/BotApp'>BotApp</a>;
<a href='/constructor/messages.botApp'>messages.botApp</a>#eb50adf5 flags:<a href='/type/%23'>#</a> inactive:flags.0?<a href='/constructor/true'>true</a> request_write_access:flags.1?<a href='/constructor/true'>true</a> has_settings:flags.2?<a href='/constructor/true'>true</a> app:<a href='/type/BotApp'>BotApp</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
<a href='/constructor/appWebViewResultUrl'>appWebViewResultUrl</a>#3c1b4f0d url:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;
---functions---
<a href='/method/messages.getBotApp'>messages.getBotApp</a>#34fdc5c3 app:<a href='/type/InputBotApp'>InputBotApp</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
<a href='/method/messages.requestAppWebView'>messages.requestAppWebView</a>#8c5a3b3c flags:<a href='/type/%23'>#</a> write_allowed:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> app:<a href='/type/InputBotApp'>InputBotApp</a> start_param:flags.1?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;</code></pre>
<p>Another way to open Mini Apps is by using <a href="/api/links#direct-mini-app-links">Direct Mini App links »</a>. </p>
<p>These links are different from all other Mini App links, because they don't require the user to install an attachment menu, and a single bot can offer multiple Mini Apps, distinguished by their <code>short_name</code>. </p>
<p>These links should be handled as follows: </p>
<ul>
<li>
<p>Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then</p>
</li>
<li>
<p>Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.
If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.</p>
</li>
<li>
<p>If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the Mini App by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned. </p>
<ul>
<li>
<p>If the client has clicked on the link in a Telegram chat, pass the chat's peer information into <code>peer</code>; otherwise pass the bot's peer information, instead.</p>
</li>
<li>
<p>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>request_write_access</code> flag is set, the bot is asking permission to send messages to the user: <strong>ask confirmation from the user</strong> with a prompt and a checkbox, and if the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
</li>
<li>
<p>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, <strong>ask confirmation from the user</strong> before opening the Mini App; the <code>request_write_access</code> checkbox should be shown in this prompt, if needed.<br>
Confirmation should <strong>always</strong> be asked, even if the <code>inactive</code> flag is not set, when opening the link from places where the full link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<p>Don't use two prompts if confirmation to open the Mini App is required <em>and</em> <code>request_write_access</code> is set, use just one prompt with an optional checkbox for <code>request_write_access</code>. </p>
</li>
<li>
<p>If the <code>startapp</code> query string parameter is present, pass it to <code>start_param</code> when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.</p>
</li>
</ul>
</li>
</ul>
<p>Finally, open the webview using the <code>url</code> contained in the returned <a href="/constructor/appWebViewResultUrl">appWebViewResultUrl</a>.</p></div>
</div>

View file

@ -181,12 +181,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"qr_login_code": "primary",
"dialog_filters_enabled": true,
"dialog_filters_tooltip": true,
"autoarchive_setting_available": false,
"autoarchive_setting_available": true,
"pending_suggestions": [
"AUTOARCHIVE_POPULAR",
"VALIDATE_PASSWORD",
"VALIDATE_PHONE_NUMBER",
"NEWCOMER_TICKS"
"NEWCOMER_TICKS",
"SETUP_PASSWORD"
],
"autologin_domains": [
"instantview.telegram.org",
@ -203,7 +204,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"diameter": 384,
"video_bitrate": 1000,
"audio_bitrate": 64,
"max_size": 12582912
"max_size": 16777216
},
"chat_read_mark_expire_period": 604800,
"chat_read_mark_size_threshold": 100,
@ -219,7 +220,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"stickers_faved_limit_default": 5,
"stickers_faved_limit_premium": 10,
"dialog_filters_limit_default": 10,
"dialog_filters_limit_premium": 20,
"dialog_filters_limit_premium": 30,
"dialog_filters_chats_limit_default": 100,
"dialog_filters_chats_limit_premium": 200,
"dialogs_pinned_limit_default": 5,
@ -242,12 +243,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"reactions_in_chat_max": 100,
"default_emoji_statuses_stickerset_id": "773947703670341676",
"premium_promo_order": [
"stories",
"more_upload",
"double_limits",
"voice_to_text",
"faster_download",
"translations",
"animated_emoji",
"more_upload",
"emoji_status",
"profile_badge",
"advanced_chat_management",
@ -255,7 +257,9 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"app_icons",
"infinite_reactions",
"animated_userpics",
"premium_stickers"
"premium_stickers",
"wallpapers",
"peer_colors"
],
"premium_bot_username": "PremiumBot",
"whitelisted_domains": [
@ -264,7 +268,8 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"telegram.org",
"t.me",
"telesco.pe",
"fragment.com"
"fragment.com",
"translations.telegram.org"
],
"topics_pinned_limit": 5,
"telegram_antispam_user_id": "5434988373",
@ -281,7 +286,46 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
"chatlists_joined_limit_premium": 20,
"chatlist_update_period": 300,
"small_queue_max_active_operations_count": 5,
"large_queue_max_active_operations_count": 2
"large_queue_max_active_operations_count": 2,
"story_viewers_expire_period": 86400,
"story_expiring_limit_default": 3,
"story_expiring_limit_premium": 100,
"story_caption_length_limit_premium": 2048,
"story_caption_length_limit_default": 200,
"stories_posting": "enabled",
"stories_stealth_past_period": 300,
"stories_stealth_future_period": 1500,
"stories_stealth_cooldown_period": 10800,
"stories_sent_weekly_limit_default": 7,
"stories_sent_weekly_limit_premium": 700,
"stories_sent_monthly_limit_default": 30,
"stories_sent_monthly_limit_premium": 3000,
"stories_venue_search_username": "foursquare",
"stories_entities": "premium",
"stories_changelog_user_id": 777000,
"authorization_autoconfirm_period": 604800,
"stories_suggested_reactions_limit_default": 1,
"stories_suggested_reactions_limit_premium": 5,
"giveaway_gifts_purchase_available": true,
"giveaway_add_peers_max": 10,
"giveaway_countries_max": 10,
"giveaway_boosts_per_premium": 4,
"giveaway_period_max": 2678400,
"boosts_channel_level_max": 100,
"boosts_per_sent_gift": 3,
"quote_length_max": 1024,
"transcribe_audio_trial_weekly_number": 2,
"transcribe_audio_trial_duration_max": 300,
"recommended_channels_limit_default": 10,
"recommended_channels_limit_premium": 100,
"channel_bg_icon_level_min": 4,
"channel_profile_bg_icon_level_min": 7,
"channel_emoji_status_level_min": 8,
"channel_wallpaper_level_min": 9,
"channel_custom_wallpaper_level_min": 10,
"saved_dialogs_pinned_limit_default": 5,
"saved_dialogs_pinned_limit_premium": 100,
"pm_read_date_expire_period": 604800
}</code></pre>
<p>Typical fields included in the resulting JSON object are: </p>
<h4><a class="anchor" href="#emojies-animated-zoom" id="emojies-animated-zoom" name="emojies-animated-zoom"><i class="anchor-icon"></i></a><code>emojies_animated_zoom</code></h4>
@ -333,14 +377,16 @@ When fetching the admin list of a supergroup using <a href="/method/channels.get
<p>A list of Telegram domains that support automatic login with no user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
<h4><a class="anchor" href="#whitelisted-domains" id="whitelisted-domains" name="whitelisted-domains"><i class="anchor-icon"></i></a><code>whitelisted_domains</code></h4>
<p>A list of Telegram domains that can always be opened without additional user confirmation, when clicking on in-app links where the URL is not fully displayed (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> entities). (array of strings)</p>
<p>Note that when opening <a href="/api/links#named-bot-web-app-links">named bot web app links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/&lt;bot_username&gt;/&lt;short_name&gt;?startapp=&lt;start_parameter&gt;</code>, where <code>t.me</code> is whitelisted). </p>
<p>Confirmation should <strong>always</strong> be asked, even if we already opened the <a href="/api/links#named-bot-web-app-links">named bot web app</a> before, if the link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<p>Note that when opening <a href="/api/links#direct-mini-app-links">direct Mini App links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/&lt;bot_username&gt;/&lt;short_name&gt;?startapp=&lt;start_parameter&gt;</code>, where <code>t.me</code> is whitelisted). </p>
<p>Confirmation should <strong>always</strong> be asked, even if we already opened the <a href="/api/links#direct-mini-app-links">direct Mini App</a> before, if the link is not visible (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> text links, inline buttons etc.). </p>
<h4><a class="anchor" href="#round-video-encoding" id="round-video-encoding" name="round-video-encoding"><i class="anchor-icon"></i></a><code>round_video_encoding</code></h4>
<p>Contains a set of recommended codec parameters for round videos. (object, as described in the example)</p>
<h4><a class="anchor" href="#chat-read-mark-size-threshold" id="chat-read-mark-size-threshold" name="chat-read-mark-size-threshold"><i class="anchor-icon"></i></a><code>chat_read_mark_size_threshold</code></h4>
<p>Per-user read receipts, fetchable using <a href="/method/messages.getMessageReadParticipants">messages.getMessageReadParticipants</a>, will be available in groups with an amount of participants less or equal to <code>chat_read_mark_size_threshold</code>. (integer)</p>
<h4><a class="anchor" href="#chat-read-mark-expire-period" id="chat-read-mark-expire-period" name="chat-read-mark-expire-period"><i class="anchor-icon"></i></a><code>chat_read_mark_expire_period</code></h4>
<p>To protect user privacy, read receipts are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (integer)</p>
<p>To protect user privacy, read receipts for chats are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (integer)</p>
<h4><a class="anchor" href="#pm-read-date-expire-period" id="pm-read-date-expire-period" name="pm-read-date-expire-period"><i class="anchor-icon"></i></a><code>pm_read_date_expire_period</code></h4>
<p>To protect user privacy, read receipts for private chats are only stored for <code>pm_read_date_expire_period</code> seconds after the message was sent. (integer)</p>
<h4><a class="anchor" href="#groupcall-video-participants-max" id="groupcall-video-participants-max" name="groupcall-video-participants-max"><i class="anchor-icon"></i></a><code>groupcall_video_participants_max</code></h4>
<p>Maximum number of participants in a group call (livestreams allow ∞ participants) (integer)</p>
<h4><a class="anchor" href="#reactions-uniq-max" id="reactions-uniq-max" name="reactions-uniq-max"><i class="anchor-icon"></i></a><code>reactions_uniq_max</code></h4>
@ -403,7 +449,7 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#caption-length-limit-default" id="caption-length-limit-default" name="caption-length-limit-default"><i class="anchor-icon"></i></a><code>caption_length_limit_default</code></h4>
<p>The maximum UTF-8 length of media captions sendable by non-<a href="/api/premium">Premium</a> users (integer)</p>
<h4><a class="anchor" href="#caption-length-limit-premium" id="caption-length-limit-premium" name="caption-length-limit-premium"><i class="anchor-icon"></i></a><code>caption_length_limit_premium</code></h4>
<p>The maximum UTF-8 length of media captions sendable by non-<a href="/api/premium">Premium</a> users (integer)</p>
<p>The maximum UTF-8 length of media captions sendable by <a href="/api/premium">Premium</a> users (integer)</p>
<h4><a class="anchor" href="#upload-max-fileparts-default" id="upload-max-fileparts-default" name="upload-max-fileparts-default"><i class="anchor-icon"></i></a><code>upload_max_fileparts_default</code></h4>
<p>The maximum number of file parts uploadable by non-<a href="/api/premium">Premium</a> users (integer, the maximum file size can be extrapolated by multiplying this value by <code>524288</code>, the biggest possible chunk size)</p>
<h4><a class="anchor" href="#upload-max-fileparts-premium" id="upload-max-fileparts-premium" name="upload-max-fileparts-premium"><i class="anchor-icon"></i></a><code>upload_max_fileparts_premium</code></h4>
@ -436,6 +482,90 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files smaller than 20MB. (integer)</p>
<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>
<p>An <a href="/api/auth#confirming-login">unconfirmed session »</a> will be autoconfirmed this many seconds after login. (integer)</p>
<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 <a href="/api/stories">stories</a> for non-<a href="/api/premium">Premium</a> users (integer).</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>
<p>The maximum number of active <a href="/api/stories">stories</a> for <a href="/api/premium">Premium</a> users (integer).</p>
<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>
<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>
<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>
<ul>
<li><code>enabled</code> - Any user can post stories.</li>
<li><code>premium</code> - Only users with a <a href="/api/premium">Premium</a> subscription can post stories.</li>
<li><code>disabled</code> - Users can't post stories.</li>
</ul>
<h4><a class="anchor" href="#stories-stealth-past-period" id="stories-stealth-past-period" name="stories-stealth-past-period"><i class="anchor-icon"></i></a><code>stories_stealth_past_period</code></h4>
<p>Enabling <a href="/api/stories#stealth-mode">stories stealth mode</a> with the <code>past</code> flag will erase views of any story opened in the past <code>stories_stealth_past_period</code> seconds. (integer)</p>
<h4><a class="anchor" href="#stories-stealth-future-period" id="stories-stealth-future-period" name="stories-stealth-future-period"><i class="anchor-icon"></i></a><code>stories_stealth_future_period</code></h4>
<p>Enabling <a href="/api/stories#stealth-mode">stories stealth mode</a> with the <code>future</code> flag will hide views of any story opened in the next <code>stories_stealth_future_period</code> seconds. (integer)</p>
<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-suggested-reactions-limit-default" id="stories-suggested-reactions-limit-default" name="stories-suggested-reactions-limit-default"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_default</code></h4>
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#stories-suggested-reactions-limit-premium" id="stories-suggested-reactions-limit-premium" name="stories-suggested-reactions-limit-premium"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_premium</code></h4>
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story 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-changelog-user-id" id="stories-changelog-user-id" name="stories-changelog-user-id"><i class="anchor-icon"></i></a><code>stories_changelog_user_id</code></h4>
<p>ID of the official Telegram user that will post stories about new Telegram features: stories posted by this user should be shown on the <a href="/api/stories#watching-stories">active or active and hidden stories bar</a> just like for contacts, even if the user was removed from the contact list. (integer, defaults to <code>777000</code>)</p>
<h4><a class="anchor" href="#stories-entities" id="stories-entities" name="stories-entities"><i class="anchor-icon"></i></a><code>stories_entities</code></h4>
<p>Whether <a href="/api/entities">styled text entities</a> and links in story text captions can be used by all users (<code>enabled</code>), only [Premium](/api/premium users) (<code>premium</code>), or no one (<code>disabled</code>). (string)</p>
<p>This field is used both when posting stories, to indicate to the user whether they can use entities, and when viewing stories, to hide entities (client-side) on stories posted by users whose <a href="/api/premium">Premium</a> subscription has expired (if <code>stories_entities == "premium"</code> and <a href="/constructor/user">user</a>.<code>premium</code> is not set, or if <code>stories_entities == "disabled"</code>). </p>
<h4><a class="anchor" href="#giveaway-gifts-purchase-available" id="giveaway-gifts-purchase-available" name="giveaway-gifts-purchase-available"><i class="anchor-icon"></i></a><code>giveaway_gifts_purchase_available</code></h4>
<p>Whether <a href="/api/giveaways">giveaways</a> can be started by the current user. (boolean)</p>
<h4><a class="anchor" href="#giveaway-add-peers-max" id="giveaway-add-peers-max" name="giveaway-add-peers-max"><i class="anchor-icon"></i></a><code>giveaway_add_peers_max</code></h4>
<p>The maximum number of users that can be specified when making a <a href="/api/giveaways">direct giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#giveaway-countries-max" id="giveaway-countries-max" name="giveaway-countries-max"><i class="anchor-icon"></i></a><code>giveaway_countries_max</code></h4>
<p>The maximum number of countries that can be specified when restricting the set of participating countries in a <a href="/api/giveaways">giveaway</a>. (itneger)</p>
<h4><a class="anchor" href="#giveaway-boosts-per-premium" id="giveaway-boosts-per-premium" name="giveaway-boosts-per-premium"><i class="anchor-icon"></i></a><code>giveaway_boosts_per_premium</code></h4>
<p>The number of <a href="/api/boost">boosts</a> that will be gained by a channel for each winner of a <a href="/api/giveaways">giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#giveaway-period-max" id="giveaway-period-max" name="giveaway-period-max"><i class="anchor-icon"></i></a><code>giveaway_period_max</code></h4>
<p>The maximum duration in seconds of a <a href="/api/giveaways">giveaway</a>. (integer)</p>
<h4><a class="anchor" href="#boosts-channel-level-max" id="boosts-channel-level-max" name="boosts-channel-level-max"><i class="anchor-icon"></i></a><code>boosts_channel_level_max</code></h4>
<p>Maximum <a href="/api/boost">boost level</a> for channels. (integer)</p>
<h4><a class="anchor" href="#boosts-per-sent-gift" id="boosts-per-sent-gift" name="boosts-per-sent-gift"><i class="anchor-icon"></i></a><code>boosts_per_sent_gift</code></h4>
<p>The number of additional <a href="/api/boost">boost slots</a> that the current user will receive when <a href="/api/premium#gifting-telegram-premium">gifting a Telegram Premium subscription</a>. </p>
<h4><a class="anchor" href="#transcribe-audio-trial-weekly-number" id="transcribe-audio-trial-weekly-number" name="transcribe-audio-trial-weekly-number"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_weekly_number</code></h4>
<p>The maximum number of <a href="/api/transcribe">speech recognition »</a> calls per week for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#transcribe-audio-trial-duration-max" id="transcribe-audio-trial-duration-max" name="transcribe-audio-trial-duration-max"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_duration_max</code></h4>
<p>The maximum allowed duration of media in seconds for <a href="/api/transcribe">speech recognition »</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-default" id="recommended-channels-limit-default" name="recommended-channels-limit-default"><i class="anchor-icon"></i></a><code>recommended_channels_limit_default</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-premium" id="recommended-channels-limit-premium" name="recommended-channels-limit-premium"><i class="anchor-icon"></i></a><code>recommended_channels_limit_premium</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#quote-length-max" id="quote-length-max" name="quote-length-max"><i class="anchor-icon"></i></a><code>quote_length_max</code></h4>
<p>Maximum UTF-8 length of <a href="/constructor/inputReplyToMessage">quoted text</a>. (integer)</p>
<h4><a class="anchor" href="#channel-bg-icon-level-min" id="channel-bg-icon-level-min" name="channel-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_bg_icon_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">message accent palette emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-profile-bg-icon-level-min" id="channel-profile-bg-icon-level-min" name="channel-profile-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_profile_bg_icon_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">profile accent palette emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-emoji-status-level-min" id="channel-emoji-status-level-min" name="channel-emoji-status-level-min"><i class="anchor-icon"></i></a><code>channel_emoji_status_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
<h4><a class="anchor" href="#channel-wallpaper-level-min" id="channel-wallpaper-level-min" name="channel-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_wallpaper_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set a <a href="/api/wallpapers#channel-wallpapers">fill channel wallpaper, see here » for more info</a>. (integer)</p>
<h4><a class="anchor" href="#channel-custom-wallpaper-level-min" id="channel-custom-wallpaper-level-min" name="channel-custom-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_custom_wallpaper_level_min</code></h4>
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill channel wallpapers, see here » for more info</a>. (integer)</p>
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-default" id="saved-dialogs-pinned-limit-default" name="saved-dialogs-pinned-limit-default"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_default</code></h4>
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-premium" id="saved-dialogs-pinned-limit-premium" name="saved-dialogs-pinned-limit-premium"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_premium</code></h4>
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for <a href="/api/premium">Premium</a> users. (integer)</p>
<h3><a class="anchor" href="#suggestions" id="suggestions" name="suggestions"><i class="anchor-icon"></i></a>Suggestions</h3>
<p>The API can return a set of useful suggestions for users of graphical clients. </p>
<h4><a class="anchor" href="#basic-suggestions" id="basic-suggestions" name="basic-suggestions"><i class="anchor-icon"></i></a>Basic suggestions</h4>
@ -460,13 +590,17 @@ A full list of these parameters can be seen in the <a href="#client-configuratio
<li><code>"VALIDATE_PASSWORD"</code> - Users should make sure they still remember their <a href="/api/srp">2-step verification password</a>.</li>
<li><code>"VALIDATE_PHONE_NUMBER"</code> - Users should check whether their <a href="/api/auth">authorization phone number</a> is correct and change the phone number if it is inaccessible.</li>
<li><code>"NEWCOMER_TICKS"</code> - Show the user a hint about the meaning of one and two ticks on sent messages.</li>
<li><code>"SETUP_PASSWORD"</code> - Show the user a hint, asking them to check whether they still remember their <a href="/api/srp">2FA password</a></li>
<li><code>"PREMIUM_ANNUAL"</code> - Suggests the user to subscribe to the Premium subscription (with annual payments)</li>
<li><code>"PREMIUM_UPGRADE"</code> - Suggests the user to upgrade their existing Premium subscription from monthly payments to annual payments</li>
<li><code>"PREMIUM_RESTORE"</code> - Suggests the user to restore a recently expired Premium subscription</li>
</ul>
</li>
</ul>
<h4><a class="anchor" href="#channel-suggestions" id="channel-suggestions" name="channel-suggestions"><i class="anchor-icon"></i></a>Channel suggestions</h4>
<pre><code><a href='/constructor/messages.chatFull'>messages.chatFull</a>#e5d7d19c full_chat:<a href='/type/ChatFull'>ChatFull</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.ChatFull'>messages.ChatFull</a>;
<a href='/constructor/channelFull'>channelFull</a>#f2355507 flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> = <a href='/type/ChatFull'>ChatFull</a>;
<a href='/constructor/channelFull'>channelFull</a>#f2bcb6f flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> stories_pinned_available:flags2.5?<a href='/constructor/true'>true</a> view_forum_as_messages:flags2.6?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> stories:flags2.4?<a href='/type/PeerStories'>PeerStories</a> wallpaper:flags2.7?<a href='/type/WallPaper'>WallPaper</a> = <a href='/type/ChatFull'>ChatFull</a>;
---functions---
@ -490,19 +624,17 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/constructor/help.noAppUpdate'>help.noAppUpdate</a>#c45a6536 = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
<a href='/constructor/updates'>updates</a>#74ae4240 updates:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Update'>Update</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; date:<a href='/type/int'>int</a> seq:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/constructor/updateServiceNotification'>updateServiceNotification</a>#ebe46819 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> inbox_date:flags.1?<a href='/type/int'>int</a> type:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> media:<a href='/type/MessageMedia'>MessageMedia</a> entities:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateServiceNotification'>updateServiceNotification</a>#ebe46819 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> invert_media:flags.2?<a href='/constructor/true'>true</a> inbox_date:flags.1?<a href='/type/int'>int</a> type:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> media:<a href='/type/MessageMedia'>MessageMedia</a> entities:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/help.inviteText'>help.inviteText</a>#18cb9f78 message:<a href='/type/string'>string</a> = <a href='/type/help.InviteText'>help.InviteText</a>;
---functions---
<a href='/method/help.getAppUpdate'>help.getAppUpdate</a>#522d5a7d source:<a href='/type/string'>string</a> = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
<a href='/method/help.getAppChangelog'>help.getAppChangelog</a>#9010ef6f prev_app_version:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/help.getInviteText'>help.getInviteText</a>#4d392343 = <a href='/type/help.InviteText'>help.InviteText</a>;</code></pre>
<ul>
<li><a href="/method/help.getAppUpdate">help.getAppUpdate</a> - Get info about an application update, can contain the updated application binary in the attached document</li>
<li><a href="/method/help.getAppChangelog">help.getAppChangelog</a> - Get a list of service messages with app-specific changelogs</li>
<li><a href="/method/help.getInviteText">help.getInviteText</a> - Returns a localized invitation message that can be sent via SMS to contacts that haven't signed up to Telegram yet</li>
</ul>
<h3><a class="anchor" href="#terms-of-service" id="terms-of-service" name="terms-of-service"><i class="anchor-icon"></i></a>Terms of service</h3>
@ -522,13 +654,13 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/method/account.deleteAccount'>account.deleteAccount</a>#a2c0cf74 flags:<a href='/type/%23'>#</a> reason:<a href='/type/string'>string</a> password:flags.0?<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>These methods can be used for managing consent to Telegram's <a href="https://telegram.org/tos">Terms Of Service</a>. </p>
<p>Typically, before a user <a href="/api/auth#sign-insign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>Typically, before a user <a href="/api/auth#sign-in-sign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>When signing up for the first time, the <a href="/constructor/help.termsOfService">help.termsOfService</a> is to be obtained from the <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a> constructor returned by the <a href="/method/auth.signIn">auth.signIn</a>. </p>
<p>After signing up, or when logging in as an existing user, apps are supposed to call <a href="/method/help.getTermsOfServiceUpdate">help.getTermsOfServiceUpdate</a> to check for any updates to the Terms of Service; this call should be repeated after <code>expires</code> seconds have elapsed.<br>
If an update to the Terms Of Service is available, clients are supposed to show a consent popup; if accepted, clients should call <a href="/method/help.acceptTermsOfService">help.acceptTermsOfService</a>, providing the <a href="/constructor/help.termsOfService">termsOfService <code>id</code> JSON object</a>; in case of denial, clients are to delete the account using <a href="/method/account.deleteAccount">account.deleteAccount</a>, providing <code>Decline ToS update</code> as deletion <code>reason</code>. </p>
<p>Example implementation: <a href="https://github.com/DrKLO/Telegram/blob/dbf81a34affcd1c24d78e1403347ea8b3a186154/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java#L3510">android (signup)</a>, <a href="https://github.com/DrKLO/Telegram/blob/ed9e38da5b3b6ca80a7cb719a000d310d07497b0/TMessagesProj/src/main/java/org/telegram/ui/Components/TermsOfServiceView.java">android (after login)</a></p>
<h3><a class="anchor" href="#telegram-support-info" id="telegram-support-info" name="telegram-support-info"><i class="anchor-icon"></i></a>Telegram support info</h3>
<pre><code><a href='/constructor/user'>user</a>#8f97c628 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> 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; = <a href='/type/User'>User</a>;
<pre><code><a href='/constructor/user'>user</a>#215c4438 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> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> = <a href='/type/User'>User</a>;
<a href='/constructor/help.support'>help.support</a>#17c6b5f6 phone_number:<a href='/type/string'>string</a> user:<a href='/type/User'>User</a> = <a href='/type/help.Support'>help.Support</a>;
<a href='/constructor/help.supportName'>help.supportName</a>#8c05f1c9 name:<a href='/type/string'>string</a> = <a href='/type/help.SupportName'>help.SupportName</a>;

View file

@ -53,7 +53,7 @@ This is implemented by using the dice constructors: </p>
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7547c966 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> top_msg_id:flags.9?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#c8a0ec74 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> hash:<a href='/type/int'>int</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;

View file

@ -47,6 +47,7 @@
<table class="table">
<tbody>
<tr>
<td> </td>
<td><strong>in_seq_no</strong></td>
<td><strong>out_seq_no</strong></td>
</tr>
@ -77,7 +78,7 @@
<li>If the received <strong>out_seq_no&gt;C+1</strong>, it most likely means that the server left out some messages due to a technical failure or due to the messages becoming obsolete. A temporary solution to this is to simply abort the secret chat. But since this may cause some existing older secret chats to be aborted, it is strongly recommended for the client to properly handle such <strong>seq_no</strong> gaps. Note that <strong>in_seq_no</strong> is not increased upon receipt of such a message; it is advanced only after all preceding gaps are filled.</li>
</ul>
<h4><a class="anchor" href="#proper-handling-of-gaps" id="proper-handling-of-gaps" name="proper-handling-of-gaps"><i class="anchor-icon"></i></a>Proper handling of gaps</h4>
<p>In order to correctly handle incoming messages after a hole has been identified (when received <strong>out_seq_no&gt;C+1</strong>), it is necessary to put received messages with the wrong <strong>seq_no</strong> into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor <a href="/constructor/decryptedMessageActionResend">decryptedMessageActionResend</a> <code>start_seq_no:<a href='/type/int'>int</a> end_seq_no:<a href='/type/int'>int</a> = <a href='/type/DecryptedMessageAction'>DecryptedMessageAction</a>;</code>. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore <em>cannot</em> be in their raw form: you can easily get the necessary <strong>start_seq_no</strong> by adding 2 to the <strong>out_seq_no</strong> of the last message before the hole and the <strong>end_seq_no</strong> by subtracting 2 from the <strong>out_seq_no</strong> of the received message with the wrong sequence number.</p>
<p>In order to correctly handle incoming messages after a hole has been identified (when received <strong>out_seq_no&gt;C+1</strong>), it is necessary to put received messages with the wrong <strong>seq_no</strong> into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor <a href="/constructor/decryptedMessageActionResend">decryptedMessageActionResend</a>. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore <em>cannot</em> be in their raw form: you can easily get the necessary <strong>start_seq_no</strong> by adding 2 to the <strong>out_seq_no</strong> of the last message before the hole and the <strong>end_seq_no</strong> by subtracting 2 from the <strong>out_seq_no</strong> of the received message with the wrong sequence number.</p>
<p>Each hole normally requires only one request to resend messages — if the remote client keeps sending out of sync messages, they should be put into the queue without sending a new request. Having received the missing messages, the local client must first interpret these messages in the right order by their <strong>seq_no</strong>. Once this is done, the client can proceed to interpret messages from the queue (again, in the right <strong>seq_no</strong> order).</p>
<p>Special cases:</p>
<ul>

View file

@ -64,6 +64,7 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<li><code>10</code> - Web push (web push, see below)</li>
<li><code>11</code> - MPNS VoIP (token for microsoft push VoIP)</li>
<li><code>12</code> - Tizen (token for tizen push)</li>
<li><code>13</code> - Huawei push</li>
</ul>
<p>For <code>10</code> web push, the token must be a JSON-encoded object with the following keys:</p>
<ul>
@ -249,6 +250,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. Channel name</td>
</tr>
<tr>
<td>CHANNEL_MESSAGE_GIVEAWAY</td>
<td>{1} posted a giveaway of {2}x {3}m Premium subscriptions</td>
<td>1. Channel name<br>2. Number of Telegram Premium subscriptions in the giveaway<br>3. Duration in months of each Telegram Premium subscription in the giveaway</td>
</tr>
<tr>
<td>CHANNEL_MESSAGE_NOTEXT</td>
<td>{1} posted a message</td>
<td>1. Channel name</td>
@ -289,6 +295,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. Channel name<br>2. Sticker emoji</td>
</tr>
<tr>
<td>CHANNEL_MESSAGE_STORY</td>
<td>{1} shared a story</td>
<td>1. Channel name</td>
</tr>
<tr>
<td>CHANNEL_MESSAGE_TEXT</td>
<td>{1}: {2}</td>
<td>1. Channel name<br>2. Message body</td>
@ -394,6 +405,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name<br>2. Group name</td>
</tr>
<tr>
<td>CHAT_MESSAGE_GIVEAWAY</td>
<td>{1} sent a giveaway of {3}x {4}m Premium subscriptions to the group {2}</td>
<td>1. User name<br>2. Group name<br>3. Number of Telegram Premium subscriptions in the giveaway<br>4. Duration in months of each Telegram Premium subscription in the giveaway</td>
</tr>
<tr>
<td>CHAT_MESSAGE_INVOICE</td>
<td>{1} sent an invoice to the group {2} for {3}</td>
<td>1. User name<br>2. Group name<br>3. Product name</td>
@ -439,6 +455,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name<br>2. Group name<br>3. Sticker emoji</td>
</tr>
<tr>
<td>CHAT_MESSAGE_STORY</td>
<td>{1} shared a story to the group</td>
<td>1. Group name</td>
</tr>
<tr>
<td>CHAT_MESSAGE_TEXT</td>
<td>{1} @ {2}: {3}</td>
<td>1. Message author<br>2. Chat name<br>3. Message body</td>
@ -494,6 +515,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name<br>2. Group name<br>3. Reaction</td>
</tr>
<tr>
<td>CHAT_REACT_GIVEAWAY</td>
<td>{1} reacted {3} in group {2} to your giveaway</td>
<td>1. User name<br>2. Group name<br>3. Reaction</td>
</tr>
<tr>
<td>CHAT_REACT_INVOICE</td>
<td>{1}: {3} to your invoice in {2}</td>
<td>1. User name<br>2. Group name<br>3. Reaction</td>
@ -654,6 +680,16 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name</td>
</tr>
<tr>
<td>MESSAGE_GIFTCODE</td>
<td>{1} sent you a Gift Code for {2} of Telegram Premium</td>
<td>1. User name<br>2. Duration of Telegram Premium subscription</td>
</tr>
<tr>
<td>MESSAGE_GIVEAWAY</td>
<td>{1} sent you a giveaway of {2}x {3}m Premium subscriptions</td>
<td>1. User name<br>2. Number of Telegram Premium subscriptions in the giveaway<br>3. Duration in months of each Telegram Premium subscription in the giveaway</td>
</tr>
<tr>
<td>MESSAGE_INVOICE</td>
<td>{1} sent you an invoice for {2}</td>
<td>1. User name<br>2. Product</td>
@ -704,6 +740,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name</td>
</tr>
<tr>
<td>MESSAGE_SAME_WALLPAPER</td>
<td>{1} set a same wallpaper for this chat</td>
<td>1. User name</td>
</tr>
<tr>
<td>MESSAGE_SCREENSHOT</td>
<td>{1} took a screenshot</td>
<td>1. User name</td>
@ -714,6 +755,16 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name<br>2. Sticker emoji</td>
</tr>
<tr>
<td>MESSAGE_STORY</td>
<td>{1} shared a story with you</td>
<td>1. User name</td>
</tr>
<tr>
<td>MESSAGE_STORY_MENTION</td>
<td>{1} mentioned you in a story</td>
<td>1. User name</td>
</tr>
<tr>
<td>MESSAGE_TEXT</td>
<td>{1}: {2}</td>
<td>1. Message author<br>2. Message body</td>
@ -734,6 +785,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name</td>
</tr>
<tr>
<td>MESSAGE_WALLPAPER</td>
<td>{1} set a new wallpaper for this chat</td>
<td>1. User name</td>
</tr>
<tr>
<td>PHONE_CALL_MISSED</td>
<td>You missed a call from {1}</td>
<td>1. User name</td>
@ -824,6 +880,16 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name<br>2. Group name</td>
</tr>
<tr>
<td>PINNED_GIVEAWAY</td>
<td>{1} pinned a giveaway</td>
<td>1. User name</td>
</tr>
<tr>
<td>PINNED_GIVEAWAY</td>
<td>{1} pinned a giveaway in the group {2}</td>
<td>1. User name<br>2. Group name</td>
</tr>
<tr>
<td>PINNED_INVOICE</td>
<td>{1} pinned an invoice</td>
<td>1. User name</td>
@ -949,6 +1015,11 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>1. User name<br>2. Reaction</td>
</tr>
<tr>
<td>REACT_GIVEAWAY</td>
<td>{1} reacted {2} to your giveaway</td>
<td>1. User name<br>2. Reaction</td>
</tr>
<tr>
<td>REACT_INVOICE</td>
<td>{1}: {2} to your invoice</td>
<td>1. User name<br>2. Reaction</td>
@ -993,6 +1064,16 @@ Simple push works by sending a simple PUT request with a <code>version=number</c
<td>{1}: {2} to your video</td>
<td>1. User name<br>2. Reaction</td>
</tr>
<tr>
<td>STORY_HIDDEN_AUTHOR</td>
<td>A new story was posted (comment: emitted when previews are hidden for this peer)</td>
<td> </td>
</tr>
<tr>
<td>STORY_NOTEXT</td>
<td>{1} posted a story</td>
<td>1. Peer name</td>
</tr>
</tbody>
</table></div>

View file

@ -63,7 +63,7 @@
<p>Bots can use <a href="/method/bots.setBotBroadcastDefaultAdminRights">bots.setBotBroadcastDefaultAdminRights</a> to indicate a suggested set of <a href="/api/rights">admin rights »</a> to use when adding the bot to a <a href="/api/channel">channel</a>, and <a href="/method/bots.setBotGroupDefaultAdminRights">bots.setBotGroupDefaultAdminRights</a> when adding the bot to a <a href="/api/channel">group</a>. </p>
<p>These suggested admin rights are contained in the <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code> paremeters of <a href="/constructor/userFull">userFull</a>, obtainable using <a href="/method/users.getFullUser">users.getFullUser</a>. </p>
<p>A client application trying to add a bot as admin should fetch the default rights and present them as editable defaults to the user: the rights can then be modified before <a href="#admin-rights">setting the bot as admin</a>.</p>
<p>Note that admin rights suggested by a <a href="/api/links#groupchannel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin. </p></div>
<p>Note that admin rights suggested by a <a href="/api/links#group-channel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin.</p></div>
</div>

View file

@ -48,7 +48,7 @@
<p>Schema: </p>
<pre><code><a href='/constructor/updateTranscribedAudio'>updateTranscribedAudio</a>#84cd5a flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/Peer'>Peer</a> msg_id:<a href='/type/int'>int</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/messages.transcribedAudio'>messages.transcribedAudio</a>#93752c52 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> = <a href='/type/messages.TranscribedAudio'>messages.TranscribedAudio</a>;
<a href='/constructor/messages.transcribedAudio'>messages.transcribedAudio</a>#cfb9d957 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> transcription_id:<a href='/type/long'>long</a> text:<a href='/type/string'>string</a> trial_remains_num:flags.1?<a href='/type/int'>int</a> trial_remains_until_date:flags.1?<a href='/type/int'>int</a> = <a href='/type/messages.TranscribedAudio'>messages.TranscribedAudio</a>;
---functions---
@ -57,7 +57,9 @@
<p>Use <a href="/method/messages.transcribeAudio">messages.transcribeAudio</a> to initiate transcription of a message.<br>
The returned <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> constructor will have the <code>pending</code> flag set if the transcription is still in progress and the transcribed text contained in <code>text</code> will be updated in future with <a href="/constructor/updateTranscribedAudio">updateTranscribedAudio</a> updates.<br>
These updates will contain the updated <code>text</code> with the same <code>transcription_id</code> returned in the first <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a>, and the <code>pending</code> flag will be set if the transcription is still in progress. </p>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p></div>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p>
<p>Users without a <a href="/api/premium">Telegram Premium</a> subscription can only transcribe <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a> messages per week, each of maximum duration equal to <a href="/api/config#transcribe-audio-trial-duration-max">transcribe_audio_trial_duration_max</a> seconds.<br>
For non-premium users, the <code>trial_remains_num</code> and <code>trial_remains_until_date</code> flags of <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> will also be set, indicating the remaining transcriptions, and the date when the <code>trial_remains_num</code> counter will be reset to the maximum value of <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a>.</p></div>
</div>

File diff suppressed because one or more lines are too long

View file

@ -2,12 +2,12 @@
<html class="">
<head>
<meta charset="utf-8">
<title>booster</title>
<title>messageUserReaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Info about a boost made by a specific user.">
<meta property="og:title" content="booster">
<meta property="description" content="Message reaction">
<meta property="og:title" content="messageUserReaction">
<meta property="og:image" content="">
<meta property="og:description" content="Info about a boost made by a specific user.">
<meta property="og:description" content="Message reaction">
<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">
@ -39,10 +39,10 @@
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/booster" >booster</a></li></ul></div>
<h1 id="dev_page_title">booster</h1>
<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/messageUserReaction" >messageUserReaction</a></li></ul></div>
<h1 id="dev_page_title">messageUserReaction</h1>
<div id="dev_page_content"><p>Info about a <a href="/api/boost">boost</a> made by a specific user.</p>
<div id="dev_page_content"><p>Message reaction</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -55,7 +55,7 @@
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 166. <a href="?layer=166">Switch »</a></code></pre></p>
<pre class="page_scheme"><code>Constructor schema is available as of layer 138. <a href="?layer=138">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
@ -68,21 +68,18 @@
<tbody>
<tr>
<td><strong>user_id</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td>
<td>ID of the user that made the boost.</td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>ID of user that reacted this way</td>
</tr>
<tr>
<td><strong>expires</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Default expiration date of the boost.</td>
<td><strong>reaction</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Reaction (UTF8 emoji)</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p> </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="#channel-boosts" id="channel-boosts" name="channel-boosts"><i class="anchor-icon"></i></a><a href="/api/boost">Channel boosts</a></h4>
<p>Telegram Premium users can grant their favorite channels additional features like the ability to post stories by giving them boosts.</p></div>
<p> </p></div>
</div>

View file

@ -2,12 +2,12 @@
<html class="">
<head>
<meta charset="utf-8">
<title>stories.canApplyBoostOk</title>
<title>messages.translateNoResult</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="We&#39;re not boosting any channel, and we can freely boost the specified channel.">
<meta property="og:title" content="stories.canApplyBoostOk">
<meta property="description" content="No translation is available">
<meta property="og:title" content="messages.translateNoResult">
<meta property="og:image" content="">
<meta property="og:description" content="We&#39;re not boosting any channel, and we can freely boost the specified channel.">
<meta property="og:description" content="No translation is available">
<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">
@ -39,10 +39,10 @@
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/stories.canApplyBoostOk" >stories.canApplyBoostOk</a></li></ul></div>
<h1 id="dev_page_title">stories.canApplyBoostOk</h1>
<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/messages.translateNoResult" >messages.translateNoResult</a></li></ul></div>
<h1 id="dev_page_title">messages.translateNoResult</h1>
<div id="dev_page_content"><p>We're not boosting any channel, and we can freely boost the specified channel.</p>
<div id="dev_page_content"><p>No translation is available</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -55,7 +55,7 @@
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 166. <a href="?layer=166">Switch »</a></code></pre></p>
<pre class="page_scheme"><code>Constructor schema is available as of layer 152. <a href="?layer=152">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<p>This constructor does not require any parameters.</p>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>

View file

@ -2,12 +2,12 @@
<html class="">
<head>
<meta charset="utf-8">
<title>stories.canApplyBoostReplace</title>
<title>messages.translateResultText</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="We&#39;re boosting another channel, but we can freely boost the specified channel.">
<meta property="og:title" content="stories.canApplyBoostReplace">
<meta property="description" content="Translated text">
<meta property="og:title" content="messages.translateResultText">
<meta property="og:image" content="">
<meta property="og:description" content="We&#39;re boosting another channel, but we can freely boost the specified channel.">
<meta property="og:description" content="Translated text">
<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">
@ -39,10 +39,10 @@
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/stories.canApplyBoostReplace" >stories.canApplyBoostReplace</a></li></ul></div>
<h1 id="dev_page_title">stories.canApplyBoostReplace</h1>
<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/messages.translateResultText" >messages.translateResultText</a></li></ul></div>
<h1 id="dev_page_title">messages.translateResultText</h1>
<div id="dev_page_content"><p>We're boosting another channel, but we can freely boost the specified channel.</p>
<div id="dev_page_content"><p>Translated text</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -55,7 +55,7 @@
</li>
</ul>
</div>
<pre class="page_scheme"><code>Constructor schema is available as of layer 166. <a href="?layer=166">Switch »</a></code></pre></p>
<pre class="page_scheme"><code>Constructor schema is available as of layer 152. <a href="?layer=152">Switch »</a></code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
@ -67,14 +67,9 @@
</thead>
<tbody>
<tr>
<td><strong>current_boost</strong></td>
<td style="text-align: center;"><a href="/type/Peer">Peer</a></td>
<td>The channel we're currently boosting.</td>
</tr>
<tr>
<td><strong>chats</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/Chat">Chat</a>&gt;</td>
<td>Channel information.</td>
<td><strong>text</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td>Translated text</td>
</tr>
</tbody>
</table>

View file

@ -1,118 +0,0 @@
<!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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</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="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -1,118 +0,0 @@
<!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=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><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="/schema" >TL-schema</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="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -1 +0,0 @@
0453746ab056c94e51cc7dc993e333727ef2144dcf8a5472c8939e2cfa4628b7

View file

@ -0,0 +1 @@
6b14ead683d77d7476f413bf7fda621c182f6b3253a07faafe46422a1fa02574

View file

@ -1,118 +0,0 @@
<!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="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,118 +0,0 @@
<!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="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,118 +0,0 @@
<!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="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -1,118 +0,0 @@
<!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="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -110,8 +110,8 @@ Client developers are required to comply with the <a href="/mtproto/security_gui
MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is deprecated and is currently being phased out. </p>
</blockquote>
<h3><a class="anchor" href="#brief-component-summary" id="brief-component-summary" name="brief-component-summary"><i class="anchor-icon"></i></a>Brief Component Summary</h3>
<h4><a class="anchor" href="#high-level-component-rpc-query-languageapi" id="high-level-component-rpc-query-languageapi" name="high-level-component-rpc-query-languageapi"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific websocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
<h4><a class="anchor" href="#high-level-component-rpc-query-language-api" id="high-level-component-rpc-query-language-api" name="high-level-component-rpc-query-language-api"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific WebSocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
<p>Several connections to a server may be open; messages may be sent in either direction through any of the connections (a response to a query is not necessarily returned through the same connection that carried the original query, although most often, that is the case; however, in no case can a message be returned through a connection belonging to a different session). When the UDP protocol is used, a response might be returned by a different IP address than the one to which the query had been sent.</p>
<p>There are several types of messages:</p>
<ul>
@ -157,8 +157,8 @@ Additionally, the following transport features can be used: </p>
Multiple transport protocols are defined:</p>
<ul>
<li><a href="/mtproto/transports#tcp">TCP</a></li>
<li><a href="/mtproto/transports#websocket">Websocket</a></li>
<li><a href="/mtproto/transports#websocket-over-https">Websocket over HTTPS</a></li>
<li><a href="/mtproto/transports#websocket">WebSocket</a></li>
<li><a href="/mtproto/transports#websocket-over-https">WebSocket over HTTPS</a></li>
<li><a href="/mtproto/transports#http">HTTP</a></li>
<li><a href="/mtproto/transports#https">HTTPS</a></li>
<li>UDP</li>
@ -167,7 +167,7 @@ Multiple transport protocols are defined:</p>
<h3><a class="anchor" href="#recap" id="recap" name="recap"><i class="anchor-icon"></i></a>Recap</h3>
<p>To recap, using the <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_architecture">ISO/OSI stack as comparison</a>: </p>
<ul>
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-languageapi">High-level RPC API</a></li>
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-language-api">High-level RPC API</a></li>
<li>Layer 6 (Presentation): <a href="/mtproto/TL">Type Language</a></li>
<li>Layer 5 (Session): <a href="https://core.telegram.org/mtproto/description#session">MTProto session</a></li>
<li>Layer 4 (Transport):<ul>

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 54 BC 00 00 FF 9A 9E 64
0010 | 14 00 00 00 F1 8E 7E BE DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 72 06 00 50 3D C5 65
0010 | 14 00 00 00 F1 8E 7E BE 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF</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>54BC0000FF9A9E64</code></td>
<td><code>D4720600503DC565</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,15 +104,15 @@
<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 64 63 C2 FF 9A 9E 64
0010 | 50 00 00 00 63 24 16 05 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 08 1D 03 06 D7 8C 29 2A
0040 | 69 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 D8 31 75 50 3D C5 65
0010 | A8 00 00 00 63 24 16 05 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 08 25 65 95 ED B7 76 67
0040 | 97 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>
<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector&lt;long&gt; = ResPQ;</code></pre>
<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector&lt;strlong&gt; = ResPQ;</code></pre>
<table class="table">
<thead>
<tr>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>016463C2FF9A9E64</code></td>
<td><code>01D83175503DC565</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>50000000</code> (80 in decimal)</td>
<td><code>A8000000</code> (168 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,23 +150,23 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</td>
<td><code>08256595EDB7766797000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2694724800268887959</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>%(Vector long)</td>
<td>%(Vector strlong)</td>
<td>68, 4</td>
<td><code>15c4b51c</code></td>
<td><em>Vector t</em> constructor number from TL schema</td>
@ -206,24 +206,24 @@
<p>Let's choose the only matching key, the one with fingerprint equal to <code>85FD64DE851D9DD0</code>.</p>
<!-- end fingerprints -->
<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>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-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 = 2090522174869285481</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2090522174869285481 = 1112973847 * 1878321023</code></p>
<pre><code>p = 1112973847
q = 1878321023</code></pre>
<pre><code>pq = 2694724800268887959</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2694724800268887959 = 1513098571 * 1780931429</code></p>
<pre><code>p = 1513098571
q = 1780931429</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 1D 03 06 D7 8C 29 2A 69 00 00 00
0010 | 04 42 56 A2 17 00 00 00 04 6F F4 E7 7F 00 00 00
0020 | DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8 3A F2 02 7D
0030 | 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7 EF 43 97 39
0040 | 0E 63 58 A8 84 41 7C 48 A8 81 CD B2 44 E1 CE 7D
0050 | 3F F7 C4 E4 4E 38 10 39 EF DC E2 57 66 F4 8C E4
<pre><code>0000 | 95 5F F5 A9 08 25 65 95 ED B7 76 67 97 00 00 00
0010 | 04 5A 30 0D 4B 00 00 00 04 6A 26 DB 65 00 00 00
0020 | 40 67 09 F6 12 FA DF BE C3 F0 28 9D 0A A6 7E EF
0030 | E1 1D BC 3B C9 7D 91 A2 61 54 F9 32 AF 01 99 43
0040 | A8 BB C8 49 51 2D AC 6C 67 B6 EF D9 15 7D 6C A7
0050 | 37 7A 17 76 30 7D 84 26 5C 6B E9 BD CF 80 2A C1
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 = 1878321023</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</td>
<td><code>08256595EDB7766797000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2694724800268887959</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>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</td>
<td><code>045A300D4B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1513098571</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>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</td>
<td><code>046A26DB65000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1780931429</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>0E6358A884417C48A881CDB244E1CE7D</code> <code>3FF7C4E44E381039EFDCE25766F48CE4</code></td>
<td><code>A8BBC849512DAC6C67B6EFD9157D6CA7</code> <code>377A1776307D84265C6BE9BDCF802AC1</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1878321023</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 = 955FF5A9081D0306D78C292A69000000044256A217000000046FF4E77F000000DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390E6358A884417C48A881CDB244E1CE7D3FF7C4E44E381039EFDCE25766F48CE402000000
random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907CBA6FFDE7C240684F1767F3ABECA72A65B6B737894D25CF280679407F569BD4F5A52BCEB645852B499E9A467DFFD015FC2AA75DE1AB51568B018CEE65999DD3</code></pre>
<pre><code>data = 955FF5A908256595EDB7766797000000045A300D4B000000046A26DB65000000406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF019943A8BBC849512DAC6C67B6EFD9157D6CA7377A1776307D84265C6BE9BDCF802AC102000000
random_padding_bytes = D944BB8347C876177FE03C2562BF4E87258EF147A7815D8853AA4B1065A5A385D0DA7E0B6100FAF55728D04DFC84E7E0D20006E07E1CB036730F5B3209CF85B2365B39DE2CBC56F40B725AD347835E5D1973567ECE8A02CF343D54F7</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 = 978CD0DA71C89E58D5DD3A369FD23C91CDF29AE8DEF7D7FADC5303F2D7D0BF676E6408C20F9888167525245E891B2884D4894406FD34D0A3739BB89D8BEFC5982F4CE7D899CAD65156931C8048627A86C3549183D914CFFBCB3B39E2B719B1F243CEFBFEEB8E5EBCD0C343772500D27BA8CEB80A46FA4EEBD88435FDF979DF40938AC43C6947D55F7C3130122D5D90BAA23C03CDBD5EEDDF9D1F0D46054856E3A3F4A86E9BE4FF61E80FA5606A9A0D1F797DE334D6DE845B71C48544A5AC2ECEFC92F0194789C66085F6DBC1D81E6674A8CDAC6D1911BAEAE1279133C162A4091E04B85732AEBEC304C17DCD5A8637413EC2CAE8B00A06A2121179D4DBAACBB7</code></pre>
<pre><code>encrypted_data = B80632B3F0D1AB28EFAE2CF974C4A2D51A77FCB6DEFD415E1EC284CAB2B5F88D5C4C5B19AFF5E940CE14CCB6A7F340EC88DF7C1F091FB6F7323B047C02DC63212D0DEBE4B3B7A0310E26DB1289CBA24112DF37506C90DEAB797623E4AFF4643D2A921891346BC176C4E1CCE14F64FA59526DD021EFFA428E8F8ACEEB96DBD4729E99BBB26DDDC744D584B732415DFFE20418953F4EAFC81DADE5C6606A1E7FAA3EDB90F36ECF405422C97C360CC31A444B1EEB6C33D62C5802165C72BBC85D1ADBCCD17988DE7F43DA0F340502744B52B196A78EF1ED1372C6EA1232603FDB9C28F7F8783F29098FFD0FE9B066C460ECBA0A2962B82398C1B32D3DCB3BC3A59E</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 9C A0 09 00 FF 9A 9E 64
0010 | 40 01 00 00 BE E4 12 D7 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 04 42 56 A2 17 00 00 00
0040 | 04 6F F4 E7 7F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 97 8C D0 DA 71 C8 9E 58 D5 DD 3A 36
0060 | 9F D2 3C 91 CD F2 9A E8 DE F7 D7 FA DC 53 03 F2
0070 | D7 D0 BF 67 6E 64 08 C2 0F 98 88 16 75 25 24 5E
0080 | 89 1B 28 84 D4 89 44 06 FD 34 D0 A3 73 9B B8 9D
0090 | 8B EF C5 98 2F 4C E7 D8 99 CA D6 51 56 93 1C 80
00A0 | 48 62 7A 86 C3 54 91 83 D9 14 CF FB CB 3B 39 E2
00B0 | B7 19 B1 F2 43 CE FB FE EB 8E 5E BC D0 C3 43 77
00C0 | 25 00 D2 7B A8 CE B8 0A 46 FA 4E EB D8 84 35 FD
00D0 | F9 79 DF 40 93 8A C4 3C 69 47 D5 5F 7C 31 30 12
00E0 | 2D 5D 90 BA A2 3C 03 CD BD 5E ED DF 9D 1F 0D 46
00F0 | 05 48 56 E3 A3 F4 A8 6E 9B E4 FF 61 E8 0F A5 60
0100 | 6A 9A 0D 1F 79 7D E3 34 D6 DE 84 5B 71 C4 85 44
0110 | A5 AC 2E CE FC 92 F0 19 47 89 C6 60 85 F6 DB C1
0120 | D8 1E 66 74 A8 CD AC 6D 19 11 BA EA E1 27 91 33
0130 | C1 62 A4 09 1E 04 B8 57 32 AE BE C3 04 C1 7D CD
0140 | 5A 86 37 41 3E C2 CA E8 B0 0A 06 A2 12 11 79 D4
0150 | DB AA CB B7</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 72 06 00 50 3D C5 65
0010 | 40 01 00 00 BE E4 12 D7 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 04 5A 30 0D 4B 00 00 00
0040 | 04 6A 26 DB 65 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 B8 06 32 B3 F0 D1 AB 28 EF AE 2C F9
0060 | 74 C4 A2 D5 1A 77 FC B6 DE FD 41 5E 1E C2 84 CA
0070 | B2 B5 F8 8D 5C 4C 5B 19 AF F5 E9 40 CE 14 CC B6
0080 | A7 F3 40 EC 88 DF 7C 1F 09 1F B6 F7 32 3B 04 7C
0090 | 02 DC 63 21 2D 0D EB E4 B3 B7 A0 31 0E 26 DB 12
00A0 | 89 CB A2 41 12 DF 37 50 6C 90 DE AB 79 76 23 E4
00B0 | AF F4 64 3D 2A 92 18 91 34 6B C1 76 C4 E1 CC E1
00C0 | 4F 64 FA 59 52 6D D0 21 EF FA 42 8E 8F 8A CE EB
00D0 | 96 DB D4 72 9E 99 BB B2 6D DD C7 44 D5 84 B7 32
00E0 | 41 5D FF E2 04 18 95 3F 4E AF C8 1D AD E5 C6 60
00F0 | 6A 1E 7F AA 3E DB 90 F3 6E CF 40 54 22 C9 7C 36
0100 | 0C C3 1A 44 4B 1E EB 6C 33 D6 2C 58 02 16 5C 72
0110 | BB C8 5D 1A DB CC D1 79 88 DE 7F 43 DA 0F 34 05
0120 | 02 74 4B 52 B1 96 A7 8E F1 ED 13 72 C6 EA 12 32
0130 | 60 3F DB 9C 28 F7 F8 78 3F 29 09 8F FD 0F E9 B0
0140 | 66 C4 60 EC BA 0A 29 62 B8 23 98 C1 B3 2D 3D CB
0150 | 3B C3 A5 9E</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>9CA00900FF9A9E64</code></td>
<td><code>D8720600503DC565</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</td>
<td><code>045A300D4B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1513098571</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>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</td>
<td><code>046A26DB65000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1780931429</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 = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100978CD0DA71C89E58D5DD3A36</code> <code>9FD23C91CDF29AE8DEF7D7FADC5303F2</code> <code>D7D0BF676E6408C20F9888167525245E</code> <code>891B2884D4894406FD34D0A3739BB89D</code> <code>8BEFC5982F4CE7D899CAD65156931C80</code> <code>48627A86C3549183D914CFFBCB3B39E2</code> <code>B719B1F243CEFBFEEB8E5EBCD0C34377</code> <code>2500D27BA8CEB80A46FA4EEBD88435FD</code> <code>F979DF40938AC43C6947D55F7C313012</code> <code>2D5D90BAA23C03CDBD5EEDDF9D1F0D46</code> <code>054856E3A3F4A86E9BE4FF61E80FA560</code> <code>6A9A0D1F797DE334D6DE845B71C48544</code> <code>A5AC2ECEFC92F0194789C66085F6DBC1</code> <code>D81E6674A8CDAC6D1911BAEAE1279133</code> <code>C162A4091E04B85732AEBEC304C17DCD</code> <code>5A8637413EC2CAE8B00A06A2121179D4</code><br> <code>DBAACBB7</code></td>
<td><code>FE000100B80632B3F0D1AB28EFAE2CF9</code> <code>74C4A2D51A77FCB6DEFD415E1EC284CA</code> <code>B2B5F88D5C4C5B19AFF5E940CE14CCB6</code> <code>A7F340EC88DF7C1F091FB6F7323B047C</code> <code>02DC63212D0DEBE4B3B7A0310E26DB12</code> <code>89CBA24112DF37506C90DEAB797623E4</code> <code>AFF4643D2A921891346BC176C4E1CCE1</code> <code>4F64FA59526DD021EFFA428E8F8ACEEB</code> <code>96DBD4729E99BBB26DDDC744D584B732</code> <code>415DFFE20418953F4EAFC81DADE5C660</code> <code>6A1E7FAA3EDB90F36ECF405422C97C36</code> <code>0CC31A444B1EEB6C33D62C5802165C72</code> <code>BBC85D1ADBCCD17988DE7F43DA0F3405</code> <code>02744B52B196A78EF1ED1372C6EA1232</code> <code>603FDB9C28F7F8783F29098FFD0FE9B0</code> <code>66C460ECBA0A2962B82398C1B32D3DCB</code><br> <code>3BC3A59E</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<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 98 C2 50 00 9B 9E 64
0010 | 78 02 00 00 5C 07 E8 D0 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 FE 50 02 00 A0 35 2C C0
0040 | 87 EA 1E 38 08 20 F7 C9 46 61 88 32 08 B6 F3 9D
0050 | 47 BA DA 5D C7 2B 94 D7 22 F6 F7 C4 19 4B D2 56
0060 | B0 75 4F BD 65 E2 C2 CA 64 28 AB 69 7A 3C D2 25
0070 | 5C 3C 28 96 7A 0B 83 3C 1B 51 C9 D5 73 F2 DE BC
0080 | B9 AE 8E BF 03 F6 C8 63 55 7D 44 02 7F 39 60 8B
0090 | 2C A0 2F C9 8F EF CD 0C 1F 31 54 95 E7 EC C8 B1
00A0 | 7A 33 47 D6 6C FD E0 35 3D E7 EB 42 1F E0 63 B0
00B0 | C2 E4 85 DC 3E F6 EB 7B AE 57 4B 21 DD DB F7 D2
00C0 | 73 BF D0 8B 0A 17 CF B9 34 0D D2 C9 C4 B6 FF F2
00D0 | 4E 02 DE 47 32 22 D0 86 9E D1 A2 2E C6 59 3F 3A
00E0 | 6E B6 55 07 2A CA B4 54 DC 17 33 A8 BA 64 A2 FA
00F0 | FC B9 67 9D 8F 1A 43 20 4C BB F3 59 60 5A FB A7
0100 | 7F 4F 4B 89 86 D8 A8 4B 35 76 83 38 09 78 BB 66
0110 | F7 15 8C 5A 89 ED 75 B1 07 99 8E 89 51 6D D9 33
0120 | DE DE 35 D2 FA 4F 53 DF 49 29 54 1B 45 26 FB 13
0130 | 49 38 1F 96 A8 57 EE FB 9D F2 65 84 FF 51 6F D0
0140 | 6B 23 67 96 0A 4E 38 6D 7D FA 06 7E 60 30 41 DB
0150 | 1A BD 27 48 28 BD 3D 5F B7 43 6D B2 B1 C2 5D 81
0160 | 05 F2 10 8A 48 AE 0B F4 19 65 24 E6 83 EC 10 CC
0170 | 3A B8 CD 58 35 8C 02 AC 41 D9 26 FF 1E CD 4A 5F
0180 | 19 36 98 6B C9 73 21 BD 4C 88 ED 7B 5F 09 4B 1E
0190 | 70 B7 2B 5E FC 1D 86 E9 82 43 05 19 52 35 F0 E0
01A0 | 66 F2 DF A0 BB D2 48 8C C8 8B B5 7A C7 89 59 59
01B0 | CB 1A FE BF B0 36 FB 92 00 E8 44 D2 60 31 A1 4A
01C0 | BB F5 18 B0 89 3A FA 4C 29 D7 B0 6C 69 0D 5A 7F
01D0 | D3 16 CC 92 08 17 D4 5E 7E FE BF EB B5 89 BA 99
01E0 | F4 10 40 93 29 6E 99 99 B0 9E A6 6A 72 67 9A DD
01F0 | BA CE C3 63 D1 50 E1 6D FB 8D 51 C4 6E 19 50 5D
0200 | C1 53 97 32 DD D3 CF F3 51 BD CE B2 8A D3 79 3C
0210 | 0D A3 08 D1 2A 31 3B D7 D2 66 BB BA 88 76 5E 20
0220 | F3 39 22 08 58 43 97 68 07 2F 26 C4 AB EC CE 48
0230 | A5 F8 99 C5 26 E5 26 6F 7A 4A 4E F2 F3 B0 8B 5F
0240 | 53 AB 6B 45 90 F9 E0 DF 8B 44 10 05 C8 0C E4 72
0250 | E2 68 31 F8 64 E0 A9 CE 06 C9 DF FE C4 E6 01 3A
0260 | 26 B8 23 A8 3B A4 64 3D 5F DD B6 DE EA F7 5D A3
0270 | 0C 87 AB FE 29 F4 71 DD 82 7B 39 9C 6E C5 9D 98
0280 | CE EE 1F D4 30 19 63 95 88 5F DB F9</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 4C 6E 1E 51 3D C5 65
0010 | C4 02 00 00 5C 07 E8 D0 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 FE 50 02 00 6A D7 DD 5D
0040 | 8B 25 26 C7 61 AB E5 0E 93 C8 2A 6F 33 1B 1E AE
0050 | 0A D0 11 89 3D A9 76 E3 77 1D 4A A4 52 09 D2 34
0060 | FE A6 56 42 98 53 86 B8 17 BF 89 80 F5 17 F6 D3
0070 | 2D BE B4 7E 34 53 45 56 F9 50 DD F9 60 DB 72 1A
0080 | 48 48 02 31 61 91 61 11 26 82 C6 04 6D 56 29 C7
0090 | 1C D1 EC 80 61 DF CD D7 04 70 3E C7 A8 AE BD CB
00A0 | D1 59 57 9F C8 88 6D 9F A5 1E 00 9A F4 9B 5A B9
00B0 | 0C 76 28 EB 81 C9 78 8A 2E B6 AC 0E 75 7A 7D EB
00C0 | E3 D9 49 F8 0A 99 0B ED B4 D2 DB AE 43 F0 03 28
00D0 | B8 2F 4D 8F C8 3A 9B 9C FE EF 46 7E 15 93 BB 45
00E0 | 79 EE 32 41 2F 16 7A 78 0C FA 51 76 50 BD 0E B5
00F0 | 1C BF B5 0E 3A FE 97 88 39 46 61 31 FC D9 56 71
0100 | 1E 63 61 4F 00 6A 55 ED 35 ED 2B 1F 83 3C 29 F4
0110 | FD 7A 84 F0 C8 F1 C1 0D FC 1A 1A AF 9A 8A 57 10
0120 | 8D EC F2 06 E3 96 84 06 F0 FB 25 E9 22 DF 15 4F
0130 | 49 7B 51 52 7E 48 34 20 2F AB 47 7A 13 7D 0A 99
0140 | D1 C3 47 19 6F BA 10 69 9F 52 EA 56 F0 1E F9 38
0150 | 29 B3 10 A5 C9 7D B9 5F D5 7E 64 41 7E 52 6E B9
0160 | 20 D2 61 15 7C 6E 38 79 1B DD 53 89 EE B7 44 E0
0170 | 75 D9 52 DB 33 A8 15 12 07 D0 AB 3C 62 9E 30 A7
0180 | 23 A5 20 5F 8F A1 83 98 93 7E D2 71 4A 4E 76 A5
0190 | F4 51 25 08 A4 BE 1B 4D 6A E4 6F D1 56 C6 F0 63
01A0 | 47 AF 5E 07 CE 49 27 91 95 13 3B 07 CC E4 BC 67
01B0 | 75 D8 8F 36 11 18 0D 23 C4 C7 09 46 61 9A D7 59
01C0 | AB 9F 18 3A 38 5C CF 9B F1 93 15 FA DB E8 A4 FD
01D0 | C7 48 AF 52 DF 93 03 45 90 9C 87 0D E4 B4 89 01
01E0 | E9 F9 0E 56 D7 4C A5 34 D8 E1 FE 3A 35 A9 2A 18
01F0 | D6 76 95 8E B8 FC 3D 82 F9 CE E3 08 DF 2A 9E 4C
0200 | CD 23 FF 89 EA 25 5B 9E ED BC 33 78 14 88 79 66
0210 | 6F FC 2E 19 A4 31 CB B5 7A E1 A0 10 FF E5 CB 39
0220 | AB F1 31 AD D9 E9 0B F9 69 A1 12 C4 35 50 9B 78
0230 | 96 0E 0B 20 03 1C 82 21 90 84 15 61 E8 39 04 46
0240 | 22 76 60 BB AC CF 3D 53 57 4B FB A3 3B F4 76 E3
0250 | BD C9 EB 68 0A A2 A1 7F D6 75 6F 65 27 25 ED 03
0260 | 13 E5 EB 0F D6 A9 C8 C9 49 EE FB E8 09 A8 93 11
0270 | BF 20 F4 00 55 CA 25 FD 16 9D C1 3E E1 4B 31 50
0280 | 92 FD E4 18 46 38 D8 49 68 2F D8 62</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,13 +464,13 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0198C250009B9E64</code></td>
<td><code>014C6E1E513DC565</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>78020000</code> (632 in decimal)</td>
<td><code>C4020000</code> (708 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200A0352CC087EA1E380820F7C9</code> <code>4661883208B6F39D47BADA5DC72B94D7</code> <code>22F6F7C4194BD256B0754FBD65E2C2CA</code> <code>6428AB697A3CD2255C3C28967A0B833C</code> <code>1B51C9D573F2DEBCB9AE8EBF03F6C863</code> <code>557D44027F39608B2CA02FC98FEFCD0C</code> <code>1F315495E7ECC8B17A3347D66CFDE035</code> <code>3DE7EB421FE063B0C2E485DC3EF6EB7B</code> <code>AE574B21DDDBF7D273BFD08B0A17CFB9</code> <code>340DD2C9C4B6FFF24E02DE473222D086</code> <code>9ED1A22EC6593F3A6EB655072ACAB454</code> <code>DC1733A8BA64A2FAFCB9679D8F1A4320</code> <code>4CBBF359605AFBA77F4F4B8986D8A84B</code> <code>357683380978BB66F7158C5A89ED75B1</code> <code>07998E89516DD933DEDE35D2FA4F53DF</code> <code>4929541B4526FB1349381F96A857EEFB</code> <code>9DF26584FF516FD06B2367960A4E386D</code> <code>7DFA067E603041DB1ABD274828BD3D5F</code> <code>B7436DB2B1C25D8105F2108A48AE0BF4</code> <code>196524E683EC10CC3AB8CD58358C02AC</code> <code>41D926FF1ECD4A5F1936986BC97321BD</code> <code>4C88ED7B5F094B1E70B72B5EFC1D86E9</code> <code>824305195235F0E066F2DFA0BBD2488C</code> <code>C88BB57AC7895959CB1AFEBFB036FB92</code> <code>00E844D26031A14ABBF518B0893AFA4C</code> <code>29D7B06C690D5A7FD316CC920817D45E</code> <code>7EFEBFEBB589BA99F4104093296E9999</code> <code>B09EA66A72679ADDBACEC363D150E16D</code> <code>FB8D51C46E19505DC1539732DDD3CFF3</code> <code>51BDCEB28AD3793C0DA308D12A313BD7</code> <code>D266BBBA88765E20F339220858439768</code> <code>072F26C4ABECCE48A5F899C526E5266F</code> <code>7A4A4EF2F3B08B5F53AB6B4590F9E0DF</code> <code>8B441005C80CE472E26831F864E0A9CE</code> <code>06C9DFFEC4E6013A26B823A83BA4643D</code> <code>5FDDB6DEEAF75DA30C87ABFE29F471DD</code> <code>827B399C6EC59D98CEEE1FD430196395</code><br> <code>885FDBF9</code></td>
<td><code>FE5002006AD7DD5D8B2526C761ABE50E</code> <code>93C82A6F331B1EAE0AD011893DA976E3</code> <code>771D4AA45209D234FEA65642985386B8</code> <code>17BF8980F517F6D32DBEB47E34534556</code> <code>F950DDF960DB721A4848023161916111</code> <code>2682C6046D5629C71CD1EC8061DFCDD7</code> <code>04703EC7A8AEBDCBD159579FC8886D9F</code> <code>A51E009AF49B5AB90C7628EB81C9788A</code> <code>2EB6AC0E757A7DEBE3D949F80A990BED</code> <code>B4D2DBAE43F00328B82F4D8FC83A9B9C</code> <code>FEEF467E1593BB4579EE32412F167A78</code> <code>0CFA517650BD0EB51CBFB50E3AFE9788</code> <code>39466131FCD956711E63614F006A55ED</code> <code>35ED2B1F833C29F4FD7A84F0C8F1C10D</code> <code>FC1A1AAF9A8A57108DECF206E3968406</code> <code>F0FB25E922DF154F497B51527E483420</code> <code>2FAB477A137D0A99D1C347196FBA1069</code> <code>9F52EA56F01EF93829B310A5C97DB95F</code> <code>D57E64417E526EB920D261157C6E3879</code> <code>1BDD5389EEB744E075D952DB33A81512</code> <code>07D0AB3C629E30A723A5205F8FA18398</code> <code>937ED2714A4E76A5F4512508A4BE1B4D</code> <code>6AE46FD156C6F06347AF5E07CE492791</code> <code>95133B07CCE4BC6775D88F3611180D23</code> <code>C4C70946619AD759AB9F183A385CCF9B</code> <code>F19315FADBE8A4FDC748AF52DF930345</code> <code>909C870DE4B48901E9F90E56D74CA534</code> <code>D8E1FE3A35A92A18D676958EB8FC3D82</code> <code>F9CEE308DF2A9E4CCD23FF89EA255B9E</code> <code>EDBC3378148879666FFC2E19A431CBB5</code> <code>7AE1A010FFE5CB39ABF131ADD9E90BF9</code> <code>69A112C435509B78960E0B20031C8221</code> <code>90841561E8390446227660BBACCF3D53</code> <code>574BFBA33BF476E3BDC9EB680AA2A17F</code> <code>D6756F652725ED0313E5EB0FD6A9C8C9</code> <code>49EEFBE809A89311BF20F40055CA25FD</code> <code>169DC13EE14B315092FDE4184638D849</code><br> <code>682FD862</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907
<!-- 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 = A0352CC087EA1E380820F7C94661883208B6F39D47BADA5DC72B94D722F6F7C4194BD256B0754FBD65E2C2CA6428AB697A3CD2255C3C28967A0B833C1B51C9D573F2DEBCB9AE8EBF03F6C863557D44027F39608B2CA02FC98FEFCD0C1F315495E7ECC8B17A3347D66CFDE0353DE7EB421FE063B0C2E485DC3EF6EB7BAE574B21DDDBF7D273BFD08B0A17CFB9340DD2C9C4B6FFF24E02DE473222D0869ED1A22EC6593F3A6EB655072ACAB454DC1733A8BA64A2FAFCB9679D8F1A43204CBBF359605AFBA77F4F4B8986D8A84B357683380978BB66F7158C5A89ED75B107998E89516DD933DEDE35D2FA4F53DF4929541B4526FB1349381F96A857EEFB9DF26584FF516FD06B2367960A4E386D7DFA067E603041DB1ABD274828BD3D5FB7436DB2B1C25D8105F2108A48AE0BF4196524E683EC10CC3AB8CD58358C02AC41D926FF1ECD4A5F1936986BC97321BD4C88ED7B5F094B1E70B72B5EFC1D86E9824305195235F0E066F2DFA0BBD2488CC88BB57AC7895959CB1AFEBFB036FB9200E844D26031A14ABBF518B0893AFA4C29D7B06C690D5A7FD316CC920817D45E7EFEBFEBB589BA99F4104093296E9999B09EA66A72679ADDBACEC363D150E16DFB8D51C46E19505DC1539732DDD3CFF351BDCEB28AD3793C0DA308D12A313BD7D266BBBA88765E20F339220858439768072F26C4ABECCE48A5F899C526E5266F7A4A4EF2F3B08B5F53AB6B4590F9E0DF8B441005C80CE472E26831F864E0A9CE06C9DFFEC4E6013A26B823A83BA4643D5FDDB6DEEAF75DA30C87ABFE29F471DD827B399C6EC59D98CEEE1FD430196395885FDBF9
tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</code></pre>
<pre><code>encrypted_answer = 6AD7DD5D8B2526C761ABE50E93C82A6F331B1EAE0AD011893DA976E3771D4AA45209D234FEA65642985386B817BF8980F517F6D32DBEB47E34534556F950DDF960DB721A48480231619161112682C6046D5629C71CD1EC8061DFCDD704703EC7A8AEBDCBD159579FC8886D9FA51E009AF49B5AB90C7628EB81C9788A2EB6AC0E757A7DEBE3D949F80A990BEDB4D2DBAE43F00328B82F4D8FC83A9B9CFEEF467E1593BB4579EE32412F167A780CFA517650BD0EB51CBFB50E3AFE978839466131FCD956711E63614F006A55ED35ED2B1F833C29F4FD7A84F0C8F1C10DFC1A1AAF9A8A57108DECF206E3968406F0FB25E922DF154F497B51527E4834202FAB477A137D0A99D1C347196FBA10699F52EA56F01EF93829B310A5C97DB95FD57E64417E526EB920D261157C6E38791BDD5389EEB744E075D952DB33A8151207D0AB3C629E30A723A5205F8FA18398937ED2714A4E76A5F4512508A4BE1B4D6AE46FD156C6F06347AF5E07CE49279195133B07CCE4BC6775D88F3611180D23C4C70946619AD759AB9F183A385CCF9BF19315FADBE8A4FDC748AF52DF930345909C870DE4B48901E9F90E56D74CA534D8E1FE3A35A92A18D676958EB8FC3D82F9CEE308DF2A9E4CCD23FF89EA255B9EEDBC3378148879666FFC2E19A431CBB57AE1A010FFE5CB39ABF131ADD9E90BF969A112C435509B78960E0B20031C822190841561E8390446227660BBACCF3D53574BFBA33BF476E3BDC9EB680AA2A17FD6756F652725ED0313E5EB0FD6A9C8C949EEFBE809A89311BF20F40055CA25FD169DC13EE14B315092FDE4184638D849682FD862
tmp_aes_key = 5EA702F743E850F5546E857F08B7D5337BBAEDF9B61248751594851BE2E8C297
tmp_aes_iv = 1CEF8E372A63D97EBFA805C0DBB018BC7C1E0931693FBCB1A1AFC0C0A8BBC849</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 46A914334DFF3DF06D9A1E5330BF60A105E40B07BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B
answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B</code></pre>
<pre><code>answer_with_hash = 60026275CC91DDEC5371C67B10331C4C1D362585BA0D89B5406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF01994303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A77200BDFF6E6C4C126A2C41DF310AB3A3BDBD698CD480749E1F3C64FB1CFC9DFC70AC6F1AA671019620A640055B2CF7D7D99CC86533645C0FA000954DE2987BAD68D7450CF134C9F0305F34C1BB285DA8233F65970A01C4BD3AFD5EA3CD5864B8F1DCB35D5E9737DF15063C54CF53048EF519A280498DDDAF23764F29FFB0C5813CAAD90C319BE8592B78C4BE815E65ADA7C62EA23754B5A2C5A86C4721872D0CC48E0F895C3EBE186E81E5F0E88A6B3F09101C409AF3410B64238FBF2A2095E3F3B7FFC7EB3A02A319B99A155647BC59958BCDFED8A1CC6EB7F13F8600E521D9D0247B0F639F2FA3B09F72987781F71C0E8AA950167DE5092380B4853E7F1513DC565C26F8049523E89D2
answer = BA0D89B5406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF01994303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A77200BDFF6E6C4C126A2C41DF310AB3A3BDBD698CD480749E1F3C64FB1CFC9DFC70AC6F1AA671019620A640055B2CF7D7D99CC86533645C0FA000954DE2987BAD68D7450CF134C9F0305F34C1BB285DA8233F65970A01C4BD3AFD5EA3CD5864B8F1DCB35D5E9737DF15063C54CF53048EF519A280498DDDAF23764F29FFB0C5813CAAD90C319BE8592B78C4BE815E65ADA7C62EA23754B5A2C5A86C4721872D0CC48E0F895C3EBE186E81E5F0E88A6B3F09101C409AF3410B64238FBF2A2095E3F3B7FFC7EB3A02A319B99A155647BC59958BCDFED8A1CC6EB7F13F8600E521D9D0247B0F639F2FA3B09F72987781F71C0E8AA950167DE5092380B4853E7F1513DC565C26F8049523E89D2</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 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | EF 43 97 39 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 40 67 09 F6 12 FA DF BE C3 F0 28 9D
0010 | 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2 61 54 F9 32
0020 | AF 01 99 43 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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
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 | 35 D6 63 91 75 B1 FF 6E 0A C4 01 89 37 0B 30 67
0140 | AF 8D 52 CE A7 08 7E 49 E0 17 07 B5 E6 11 2C B3
0150 | 33 27 26 7B D5 26 CD CD 1E 97 1B 04 88 E8 C9 35
0160 | 10 E8 60 49 B2 5F 64 01 70 B0 2B DE 60 9E 83 05
0170 | 0E 5F AB 06 54 C0 38 37 E7 83 20 18 15 2B 11 92
0180 | 8E 0F 2E 4C 33 27 DB E2 71 7E 12 3C C5 99 4E A0
0190 | A6 03 4C ED 7E AD 34 D9 9C A9 0D 89 40 B2 06 58
01A0 | 97 EB F6 17 B9 B1 66 2E 68 20 53 CD C7 5A 31 FD
01B0 | 6D 7B 27 B1 B8 FE 86 8C 81 39 75 2A 48 48 A5 49
01C0 | 3D FC 71 47 70 09 E0 65 3D 18 50 51 A7 D6 F6 C3
01D0 | A5 9C 2A 89 EC 8B 9B CD D8 7C B8 49 89 3D 70 92
01E0 | 61 D6 90 E3 84 35 65 DE B1 9B 76 B2 1F B8 A0 A2
01F0 | 8D E3 BE A1 98 69 F1 D7 33 46 90 9D 17 66 6F 94
0200 | 77 80 77 C5 99 76 11 76 24 85 36 A8 BB 94 4F 4F
0210 | 73 C3 66 BF 70 A0 4D 13 32 6D 22 79 99 E1 46 C8
0220 | 30 A4 73 FC 9B 1F 35 25 26 3F E3 0B 7D 82 C2 B7
0230 | 00 9B 9E 64</code></pre>
0130 | 0A 77 20 0B DF F6 E6 C4 C1 26 A2 C4 1D F3 10 AB
0140 | 3A 3B DB D6 98 CD 48 07 49 E1 F3 C6 4F B1 CF C9
0150 | DF C7 0A C6 F1 AA 67 10 19 62 0A 64 00 55 B2 CF
0160 | 7D 7D 99 CC 86 53 36 45 C0 FA 00 09 54 DE 29 87
0170 | BA D6 8D 74 50 CF 13 4C 9F 03 05 F3 4C 1B B2 85
0180 | DA 82 33 F6 59 70 A0 1C 4B D3 AF D5 EA 3C D5 86
0190 | 4B 8F 1D CB 35 D5 E9 73 7D F1 50 63 C5 4C F5 30
01A0 | 48 EF 51 9A 28 04 98 DD DA F2 37 64 F2 9F FB 0C
01B0 | 58 13 CA AD 90 C3 19 BE 85 92 B7 8C 4B E8 15 E6
01C0 | 5A DA 7C 62 EA 23 75 4B 5A 2C 5A 86 C4 72 18 72
01D0 | D0 CC 48 E0 F8 95 C3 EB E1 86 E8 1E 5F 0E 88 A6
01E0 | B3 F0 91 01 C4 09 AF 34 10 B6 42 38 FB F2 A2 09
01F0 | 5E 3F 3B 7F FC 7E B3 A0 2A 31 9B 99 A1 55 64 7B
0200 | C5 99 58 BC DF ED 8A 1C C6 EB 7F 13 F8 60 0E 52
0210 | 1D 9D 02 47 B0 F6 39 F2 FA 3B 09 F7 29 87 78 1F
0220 | 71 C0 E8 AA 95 01 67 DE 50 92 38 0B 48 53 E7 F1
0230 | 51 3D C5 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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010035D6639175B1FF6E0AC40189</code> <code>370B3067AF8D52CEA7087E49E01707B5</code> <code>E6112CB33327267BD526CDCD1E971B04</code> <code>88E8C93510E86049B25F640170B02BDE</code> <code>609E83050E5FAB0654C03837E7832018</code> <code>152B11928E0F2E4C3327DBE2717E123C</code> <code>C5994EA0A6034CED7EAD34D99CA90D89</code> <code>40B2065897EBF617B9B1662E682053CD</code> <code>C75A31FD6D7B27B1B8FE868C8139752A</code> <code>4848A5493DFC71477009E0653D185051</code> <code>A7D6F6C3A59C2A89EC8B9BCDD87CB849</code> <code>893D709261D690E3843565DEB19B76B2</code> <code>1FB8A0A28DE3BEA19869F1D73346909D</code> <code>17666F94778077C599761176248536A8</code> <code>BB944F4F73C366BF70A04D13326D2279</code> <code>99E146C830A473FC9B1F3525263FE30B</code><br> <code>7D82C2B7</code></td>
<td><code>FE0001000A77200BDFF6E6C4C126A2C4</code> <code>1DF310AB3A3BDBD698CD480749E1F3C6</code> <code>4FB1CFC9DFC70AC6F1AA671019620A64</code> <code>0055B2CF7D7D99CC86533645C0FA0009</code> <code>54DE2987BAD68D7450CF134C9F0305F3</code> <code>4C1BB285DA8233F65970A01C4BD3AFD5</code> <code>EA3CD5864B8F1DCB35D5E9737DF15063</code> <code>C54CF53048EF519A280498DDDAF23764</code> <code>F29FFB0C5813CAAD90C319BE8592B78C</code> <code>4BE815E65ADA7C62EA23754B5A2C5A86</code> <code>C4721872D0CC48E0F895C3EBE186E81E</code> <code>5F0E88A6B3F09101C409AF3410B64238</code> <code>FBF2A2095E3F3B7FFC7EB3A02A319B99</code> <code>A155647BC59958BCDFED8A1CC6EB7F13</code> <code>F8600E521D9D0247B0F639F2FA3B09F7</code> <code>2987781F71C0E8AA950167DE5092380B</code><br> <code>4853E7F1</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>009B9E64</code> (1688115968 in decimal)</td>
<td><code>513DC565</code> (1707425105 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<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 = F7C5CD46D4A88DED59C1B412D39FEC78BD86A6DC2BF2C5C5D8AF305204158F14B3244D42FFCF2363DC0D25DC6C48A16A3A0E63813D9E87442CA3C2CF84DF848C540531FCDBAD8290A6B25E021EB9AAEEB702F6FB31DC39C48EF615BB0CBBEDE1958D8BF5DCC205CBED3A9DFCD597115163A131DFD4939E68EB2C6F097A5632A3773D5201783A3B6CDE805794F5CBEEFD9FCB8DEAEAD1C5BCADD6366C8A907FABE99A026E59E8521085CE6130123E80B72DFD5EF3D2C0BC880F52DEEF7404638D8053D464036BF7057A77BE75EDA78D3C82221BB131FE6ECB8C43F77DF1D04935F978BA40F3F59385D6D6C2E7782BFFB040AB60F28459EB68A42A904B55E8088C</code></pre>
<pre><code>b = 1376A5A6BF7A9F874B47028F3D5CFF0689FD52F58949BB0EE9BACDBE81DD1CED07101844EB6F2AE19E61120B84799431F445785E33A18141399821479AE96786E0F4E9C5C6C9E46BF562C21C96B0F8F7438C8CABA3DFCB3DD3B886C2A37B95ED804315335C0DDFFEB3A278243D89F964278BC734D1087D6D4B554C1F78397A414F440E38BA9A4F1211B20AE835437762F81A45FDB035BB2220D939693084B39A3C7BE2481309AB9AE378EAB8BB3A15A69EBA80BEF683582E2218FA604E823EABD111553D31DBB46B9383A0D8EEF615FFF9CF266C970800AA28AC5E962D20351311A815FFA7562989CA6D6323BF2B5AF40EF3F45021B7445664852D07B80172CE</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 = 2545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1</code></pre>
<pre><code>g_b = A215D057BC6648453D68C2F418A38D9D4F4FA47E5D520AC7EBC2ADC3B00075090C10A1E9D96A5DDA127317F2DDC165C5F6C8C2854648C106D0D9DF684DAE70B0E6021658806245B494B762B1979E8BD597B5CC8E43A80F96CA47FB0765C98D40529F3D94C82113AE32C603AA24411EF8B330565A1D66EA6B89C9D4F8AFFEEA397C4B247564215D147B6AD0DF7F3FB4499E89E34304531D87448B91967B5BD53093F09386C0F78940C1DD6AA7C8667E15857453E6AAD275F94CD386468CF49108FB7C54282596A4D0314DCE9EFED4066A6E072471439AEAAA74157DB7DD53F01982982534DEE8740610BA433BF459B3DFE38674561F31991CE007BA112DDA6718</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 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | EF 43 97 39 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 25 45 CE 89 DA D1 4B DF 0F 1E 2E 34 F3 66 12 44
0040 | 74 E2 21 B5 C2 01 9C F5 24 06 12 B8 17 98 31 1E
0050 | 9E D3 32 01 DE 78 EA 34 B5 9D C0 15 1E 4C F8 20
0060 | DE EC 38 50 E1 B0 81 14 B7 59 9A 1C 99 F2 8A 85
0070 | 23 4A BC F8 DC 8B E8 AB 0C D1 01 9E C5 6A B7 BB
0080 | 2E 05 F0 7B 76 56 33 8B E2 54 AB B2 F4 5A D4 2A
0090 | 86 84 8E 60 2B 04 A6 B9 CC 92 62 78 0D 4F 87 50
00A0 | 5A 8B 17 19 1F 53 E7 2B DB 00 AB 29 0B 76 81 0E
00B0 | B1 5C 87 31 83 D7 2E C3 D2 CB 41 1C 3F 4B DC 79
00C0 | 44 E1 CA BF 55 71 B1 52 F7 FC 3C A1 DA 47 09 77
00D0 | 32 9D C4 98 54 BA 62 A8 5A E7 64 5F EC BD 81 83
00E0 | B5 A4 AA D0 6D FC 56 D4 BA 61 06 F8 1A 45 BE F3
00F0 | 2A 9E 4F 56 A2 13 FB 2A 02 7B 3A CD FD DD E6 A6
0100 | D5 7E 68 35 2C 82 F7 C0 D2 10 8F C0 10 72 59 29
0110 | CB 7C 88 EE 73 7F 7B 49 8D 86 13 4C 7C 7F 26 26
0120 | F0 35 70 67 A0 78 13 C0 D3 F2 C8 68 76 CC 1F F1</code></pre>
<pre><code>0000 | 54 B6 43 66 40 67 09 F6 12 FA DF BE C3 F0 28 9D
0010 | 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2 61 54 F9 32
0020 | AF 01 99 43 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | A2 15 D0 57 BC 66 48 45 3D 68 C2 F4 18 A3 8D 9D
0040 | 4F 4F A4 7E 5D 52 0A C7 EB C2 AD C3 B0 00 75 09
0050 | 0C 10 A1 E9 D9 6A 5D DA 12 73 17 F2 DD C1 65 C5
0060 | F6 C8 C2 85 46 48 C1 06 D0 D9 DF 68 4D AE 70 B0
0070 | E6 02 16 58 80 62 45 B4 94 B7 62 B1 97 9E 8B D5
0080 | 97 B5 CC 8E 43 A8 0F 96 CA 47 FB 07 65 C9 8D 40
0090 | 52 9F 3D 94 C8 21 13 AE 32 C6 03 AA 24 41 1E F8
00A0 | B3 30 56 5A 1D 66 EA 6B 89 C9 D4 F8 AF FE EA 39
00B0 | 7C 4B 24 75 64 21 5D 14 7B 6A D0 DF 7F 3F B4 49
00C0 | 9E 89 E3 43 04 53 1D 87 44 8B 91 96 7B 5B D5 30
00D0 | 93 F0 93 86 C0 F7 89 40 C1 DD 6A A7 C8 66 7E 15
00E0 | 85 74 53 E6 AA D2 75 F9 4C D3 86 46 8C F4 91 08
00F0 | FB 7C 54 28 25 96 A4 D0 31 4D CE 9E FE D4 06 6A
0100 | 6E 07 24 71 43 9A EA AA 74 15 7D B7 DD 53 F0 19
0110 | 82 98 25 34 DE E8 74 06 10 BA 43 3B F4 59 B3 DF
0120 | E3 86 74 56 1F 31 99 1C E0 07 BA 11 2D DA 67 18</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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001002545CE89DAD14BDF0F1E2E34</code> <code>F366124474E221B5C2019CF5240612B8</code> <code>1798311E9ED33201DE78EA34B59DC015</code> <code>1E4CF820DEEC3850E1B08114B7599A1C</code> <code>99F28A85234ABCF8DC8BE8AB0CD1019E</code> <code>C56AB7BB2E05F07B7656338BE254ABB2</code> <code>F45AD42A86848E602B04A6B9CC926278</code> <code>0D4F87505A8B17191F53E72BDB00AB29</code> <code>0B76810EB15C873183D72EC3D2CB411C</code> <code>3F4BDC7944E1CABF5571B152F7FC3CA1</code> <code>DA470977329DC49854BA62A85AE7645F</code> <code>ECBD8183B5A4AAD06DFC56D4BA6106F8</code> <code>1A45BEF32A9E4F56A213FB2A027B3ACD</code> <code>FDDDE6A6D57E68352C82F7C0D2108FC0</code> <code>10725929CB7C88EE737F7B498D86134C</code> <code>7C7F2626F0357067A07813C0D3F2C868</code><br> <code>76CC1FF1</code></td>
<td><code>FE000100A215D057BC6648453D68C2F4</code> <code>18A38D9D4F4FA47E5D520AC7EBC2ADC3</code> <code>B00075090C10A1E9D96A5DDA127317F2</code> <code>DDC165C5F6C8C2854648C106D0D9DF68</code> <code>4DAE70B0E6021658806245B494B762B1</code> <code>979E8BD597B5CC8E43A80F96CA47FB07</code> <code>65C98D40529F3D94C82113AE32C603AA</code> <code>24411EF8B330565A1D66EA6B89C9D4F8</code> <code>AFFEEA397C4B247564215D147B6AD0DF</code> <code>7F3FB4499E89E34304531D87448B9196</code> <code>7B5BD53093F09386C0F78940C1DD6AA7</code> <code>C8667E15857453E6AAD275F94CD38646</code> <code>8CF49108FB7C54282596A4D0314DCE9E</code> <code>FED4066A6E072471439AEAAA74157DB7</code> <code>DD53F01982982534DEE8740610BA433B</code> <code>F459B3DFE38674561F31991CE007BA11</code><br> <code>2DDA6718</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 = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973
<!-- 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 = 54B64366DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390000000000000000FE0001002545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1
padding = BD8A6AC82FFB68885A48E0ED
tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</code></pre>
<pre><code>data = 54B64366406709F612FADFBEC3F0289D0AA67EEFE11DBC3BC97D91A26154F932AF0199430000000000000000FE000100A215D057BC6648453D68C2F418A38D9D4F4FA47E5D520AC7EBC2ADC3B00075090C10A1E9D96A5DDA127317F2DDC165C5F6C8C2854648C106D0D9DF684DAE70B0E6021658806245B494B762B1979E8BD597B5CC8E43A80F96CA47FB0765C98D40529F3D94C82113AE32C603AA24411EF8B330565A1D66EA6B89C9D4F8AFFEEA397C4B247564215D147B6AD0DF7F3FB4499E89E34304531D87448B91967B5BD53093F09386C0F78940C1DD6AA7C8667E15857453E6AAD275F94CD386468CF49108FB7C54282596A4D0314DCE9EFED4066A6E072471439AEAAA74157DB7DD53F01982982534DEE8740610BA433BF459B3DFE38674561F31991CE007BA112DDA6718
padding = 74876952857BA6AAA495A20D
tmp_aes_key = 5EA702F743E850F5546E857F08B7D5337BBAEDF9B61248751594851BE2E8C297
tmp_aes_iv = 1CEF8E372A63D97EBFA805C0DBB018BC7C1E0931693FBCB1A1AFC0C0A8BBC849</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 = E3B5716AC2E86342AD2E8C7B75FD17C713CE5C8559659F8301258D63D9101D1DB99EA9C1909315495C8776FD7885CA40AB860F38C8BD946F90CCEC63F3ED2A5A8F06F4E45BFDD0CC4A626AF74C299623B64E8E384BB7A66C36483EA667CE513FB5C2B9C7C635206E824F6BFC45A259CE0692745EBF3FDE3DEE350903FC0E2FF821DAECDF333B23F77866A444E2AC3B1BC8CC2EA38D4C2C3FF375FF70CFAF76E35BE863D54969CF4A887C8D6223874017B4B509CF3DE096E288512FBEF295D4DE4CC3CA6EAEA779B07100D8CC9E2EF7A6B40575CCC5EC93E32E7F8E4FD7332737F3B179573B4BEC13ABD868CC06A725ECFFC29494FE6AFFD3CEF2DE94681D4A3F19DDE0CF9BB0F13974443EA04D6CE173E0655BAFC847B5D55393BE982E00903B557B61FB38F15A88CADA345BC8B7820BB1C051C0A8B13AE70A5479E87D6BCA8A7AA73C306AF0FACD6760C566014DE790</code></pre>
<pre><code>encrypted_data = 14D185E575255986C29BE3A0437D525BA22430CBA0CD755225945AD3A1ACEFB536518514F5086892E6E3FA84D1CBB644BC8F7BEBCDE74E31BA8A073F47623EBB6E7D94B3A676A4C1AFD4689C52D05F73D21C33F64FE6AEABD04273D9117CD064E467E1F8E6C887BCAE4679E0399AD35DB1302A80629618F8C8485248D89A4E3568B464FF7B608CBE24B51EEB81B65D76224B62A1669EAA48A99C122E5E8A778E13DD441DC52175160088A498F186A2B99C736FE8C5C3E274D804C629564A0F15DDABC5B449356A7990900652A7432AFB1499C7CE09246F6B29006425DF2926465B04F17C0077B6A336A50E46B675AD5607F05818F84EADEC1F4847BF311027E742F8B1E183C01810C4CE964F2A0F36E257849C144C9B0B93B4A7A9E57391DB0CCB0D757A2B7A77257C8FF55553D66B6E1D45E9D8CA88E5A47B16322FF2ED5F5ABE099E7006B2D29C829D746B704130B1</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 30 0F 00 00 9B 9E 64
0010 | 78 01 00 00 1F 5F 04 F5 DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 FE 50 01 00 E3 B5 71 6A
0040 | C2 E8 63 42 AD 2E 8C 7B 75 FD 17 C7 13 CE 5C 85
0050 | 59 65 9F 83 01 25 8D 63 D9 10 1D 1D B9 9E A9 C1
0060 | 90 93 15 49 5C 87 76 FD 78 85 CA 40 AB 86 0F 38
0070 | C8 BD 94 6F 90 CC EC 63 F3 ED 2A 5A 8F 06 F4 E4
0080 | 5B FD D0 CC 4A 62 6A F7 4C 29 96 23 B6 4E 8E 38
0090 | 4B B7 A6 6C 36 48 3E A6 67 CE 51 3F B5 C2 B9 C7
00A0 | C6 35 20 6E 82 4F 6B FC 45 A2 59 CE 06 92 74 5E
00B0 | BF 3F DE 3D EE 35 09 03 FC 0E 2F F8 21 DA EC DF
00C0 | 33 3B 23 F7 78 66 A4 44 E2 AC 3B 1B C8 CC 2E A3
00D0 | 8D 4C 2C 3F F3 75 FF 70 CF AF 76 E3 5B E8 63 D5
00E0 | 49 69 CF 4A 88 7C 8D 62 23 87 40 17 B4 B5 09 CF
00F0 | 3D E0 96 E2 88 51 2F BE F2 95 D4 DE 4C C3 CA 6E
0100 | AE A7 79 B0 71 00 D8 CC 9E 2E F7 A6 B4 05 75 CC
0110 | C5 EC 93 E3 2E 7F 8E 4F D7 33 27 37 F3 B1 79 57
0120 | 3B 4B EC 13 AB D8 68 CC 06 A7 25 EC FF C2 94 94
0130 | FE 6A FF D3 CE F2 DE 94 68 1D 4A 3F 19 DD E0 CF
0140 | 9B B0 F1 39 74 44 3E A0 4D 6C E1 73 E0 65 5B AF
0150 | C8 47 B5 D5 53 93 BE 98 2E 00 90 3B 55 7B 61 FB
0160 | 38 F1 5A 88 CA DA 34 5B C8 B7 82 0B B1 C0 51 C0
0170 | A8 B1 3A E7 0A 54 79 E8 7D 6B CA 8A 7A A7 3C 30
0180 | 6A F0 FA CD 67 60 C5 66 01 4D E7 90</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 5C 07 00 51 3D C5 65
0010 | 78 01 00 00 1F 5F 04 F5 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 FE 50 01 00 14 D1 85 E5
0040 | 75 25 59 86 C2 9B E3 A0 43 7D 52 5B A2 24 30 CB
0050 | A0 CD 75 52 25 94 5A D3 A1 AC EF B5 36 51 85 14
0060 | F5 08 68 92 E6 E3 FA 84 D1 CB B6 44 BC 8F 7B EB
0070 | CD E7 4E 31 BA 8A 07 3F 47 62 3E BB 6E 7D 94 B3
0080 | A6 76 A4 C1 AF D4 68 9C 52 D0 5F 73 D2 1C 33 F6
0090 | 4F E6 AE AB D0 42 73 D9 11 7C D0 64 E4 67 E1 F8
00A0 | E6 C8 87 BC AE 46 79 E0 39 9A D3 5D B1 30 2A 80
00B0 | 62 96 18 F8 C8 48 52 48 D8 9A 4E 35 68 B4 64 FF
00C0 | 7B 60 8C BE 24 B5 1E EB 81 B6 5D 76 22 4B 62 A1
00D0 | 66 9E AA 48 A9 9C 12 2E 5E 8A 77 8E 13 DD 44 1D
00E0 | C5 21 75 16 00 88 A4 98 F1 86 A2 B9 9C 73 6F E8
00F0 | C5 C3 E2 74 D8 04 C6 29 56 4A 0F 15 DD AB C5 B4
0100 | 49 35 6A 79 90 90 06 52 A7 43 2A FB 14 99 C7 CE
0110 | 09 24 6F 6B 29 00 64 25 DF 29 26 46 5B 04 F1 7C
0120 | 00 77 B6 A3 36 A5 0E 46 B6 75 AD 56 07 F0 58 18
0130 | F8 4E AD EC 1F 48 47 BF 31 10 27 E7 42 F8 B1 E1
0140 | 83 C0 18 10 C4 CE 96 4F 2A 0F 36 E2 57 84 9C 14
0150 | 4C 9B 0B 93 B4 A7 A9 E5 73 91 DB 0C CB 0D 75 7A
0160 | 2B 7A 77 25 7C 8F F5 55 53 D6 6B 6E 1D 45 E9 D8
0170 | CA 88 E5 A4 7B 16 32 2F F2 ED 5F 5A BE 09 9E 70
0180 | 06 B2 D2 9C 82 9D 74 6B 70 41 30 B1</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>E8300F00009B9E64</code></td>
<td><code>185C0700513DC565</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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100E3B5716AC2E86342AD2E8C7B</code> <code>75FD17C713CE5C8559659F8301258D63</code> <code>D9101D1DB99EA9C1909315495C8776FD</code> <code>7885CA40AB860F38C8BD946F90CCEC63</code> <code>F3ED2A5A8F06F4E45BFDD0CC4A626AF7</code> <code>4C299623B64E8E384BB7A66C36483EA6</code> <code>67CE513FB5C2B9C7C635206E824F6BFC</code> <code>45A259CE0692745EBF3FDE3DEE350903</code> <code>FC0E2FF821DAECDF333B23F77866A444</code> <code>E2AC3B1BC8CC2EA38D4C2C3FF375FF70</code> <code>CFAF76E35BE863D54969CF4A887C8D62</code> <code>23874017B4B509CF3DE096E288512FBE</code> <code>F295D4DE4CC3CA6EAEA779B07100D8CC</code> <code>9E2EF7A6B40575CCC5EC93E32E7F8E4F</code> <code>D7332737F3B179573B4BEC13ABD868CC</code> <code>06A725ECFFC29494FE6AFFD3CEF2DE94</code> <code>681D4A3F19DDE0CF9BB0F13974443EA0</code> <code>4D6CE173E0655BAFC847B5D55393BE98</code> <code>2E00903B557B61FB38F15A88CADA345B</code> <code>C8B7820BB1C051C0A8B13AE70A5479E8</code> <code>7D6BCA8A7AA73C306AF0FACD6760C566</code><br> <code>014DE790</code></td>
<td><code>FE50010014D185E575255986C29BE3A0</code> <code>437D525BA22430CBA0CD755225945AD3</code> <code>A1ACEFB536518514F5086892E6E3FA84</code> <code>D1CBB644BC8F7BEBCDE74E31BA8A073F</code> <code>47623EBB6E7D94B3A676A4C1AFD4689C</code> <code>52D05F73D21C33F64FE6AEABD04273D9</code> <code>117CD064E467E1F8E6C887BCAE4679E0</code> <code>399AD35DB1302A80629618F8C8485248</code> <code>D89A4E3568B464FF7B608CBE24B51EEB</code> <code>81B65D76224B62A1669EAA48A99C122E</code> <code>5E8A778E13DD441DC52175160088A498</code> <code>F186A2B99C736FE8C5C3E274D804C629</code> <code>564A0F15DDABC5B449356A7990900652</code> <code>A7432AFB1499C7CE09246F6B29006425</code> <code>DF2926465B04F17C0077B6A336A50E46</code> <code>B675AD5607F05818F84EADEC1F4847BF</code> <code>311027E742F8B1E183C01810C4CE964F</code> <code>2A0F36E257849C144C9B0B93B4A7A9E5</code> <code>7391DB0CCB0D757A2B7A77257C8FF555</code> <code>53D66B6E1D45E9D8CA88E5A47B16322F</code> <code>F2ED5F5ABE099E7006B2D29C829D746B</code><br> <code>704130B1</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 = 48892B997A14A133B6D5B234A7F9B19DCE70CB192B9238372639DD6230B1BCC8D31BBBCCFA7F00BBEF38303BAE50FFF3DC814333123CE6E5980EF4493A74F38AD6B05B6737E296ADF4C97C69C95C5EC840BC22694F4CBFC14598B28F83B5CD79FE881F6AB9615226DF63078688371B3CDD2F6E97B35D17E6710E29469E1476B596C1DE136F05D585290776B306D6946B1C33374A459ECB0E9BFBC5A43D145A6B37C276E94C840EA0950B0B2523744CD538817DBA33CD6C84175AEA8561EBA117D2589EFB30A304B0F7AF29FF141E6B3F6F9FA5CEFF31DF1166937EA07D850427B6D779BBAB5B062526D435206EA25158EABC659DE3DC5E4ABF0D93B87B35E5E7</code></pre>
<pre><code>auth_key = ACA2547BAA3B4B3E6AD9129ADEE796042FC4ACAAABA40DCE7A1196640595829E2BA85C5E68E5D2B7B713B28720CCD0E65DA3B80CD8A9282BDE895755B924F4CBBCED119DEE057D3066D7095C25771A53D9AD6EC3464EE0E7FE1A4D9851F17B6CC7D6E636E0BDEA7D66153CF37005835A528E65673C1F5ADAA27465964BA89AA6FD045108B25B1DC9AB2D979864858C9EACBFA4A399CDBF2154D2CC6743C5CAA40683343D80A36C7F1289DC5AC5EE585DEA1E1CD296444EA6CD8F6C3564B2D355B310A3C02608EEA5EC36D38E941BF811489AB7A24C069E44FF54714CB4A45EEE2F310FDDC0A1B08BD3DFF8801E27C8508EFD7AD51EF3C13EF1D9A02EE4601741</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 84 8C 9F 00 9B 9E 64
0010 | 34 00 00 00 34 F7 CB 3B DA 60 3B 0B 6C 74 D6 0E
0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | 66 BA 31 F7 EF 43 97 39 B0 91 C6 77 C6 99 6C 09
0040 | FF 59 F2 F9 AB 28 16 78</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 00 BE 91 51 3D C5 65
0010 | 74 00 00 00 34 F7 CB 3B 40 67 09 F6 12 FA DF BE
0020 | C3 F0 28 9D 0A A6 7E EF E1 1D BC 3B C9 7D 91 A2
0030 | 61 54 F9 32 AF 01 99 43 11 42 87 13 52 16 5E 59
0040 | E1 12 40 36 B4 8B 97 D3</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>01848C9F009B9E64</code></td>
<td><code>0100BE91513DC565</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>34000000</code> (52 in decimal)</td>
<td><code>74000000</code> (116 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>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td><code>406709F612FADFBEC3F0289D0AA67EEF</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td><code>E11DBC3BC97D91A26154F932AF019943</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>B091C677C6996C09FF59F2F9AB281678</code></td>
<td><code>1142871352165E59E1124036B48B97D3</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

@ -2,12 +2,12 @@
<html class="">
<head>
<meta charset="utf-8">
<title>MessageInteractionCounters</title>
<title>MessageUserReaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Message interaction counters">
<meta property="og:title" content="MessageInteractionCounters">
<meta property="description" content="Message reaction">
<meta property="og:title" content="MessageUserReaction">
<meta property="og:image" content="">
<meta property="og:description" content="Message interaction counters">
<meta property="og:description" content="Message reaction">
<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">
@ -39,10 +39,10 @@
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/type/MessageInteractionCounters" >MessageInteractionCounters</a></li></ul></div>
<h1 id="dev_page_title">MessageInteractionCounters</h1>
<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/MessageUserReaction" >MessageUserReaction</a></li></ul></div>
<h1 id="dev_page_title">MessageUserReaction</h1>
<div id="dev_page_content"><p>Message interaction counters</p>
<div id="dev_page_content"><p>Message reaction</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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long