mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-24 08:16:34 +01:00
431 lines
42 KiB
HTML
431 lines
42 KiB
HTML
<!DOCTYPE html>
|
|
<html class="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Client configuration</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="description" content="The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.">
|
|
<meta property="og:title" content="Client configuration">
|
|
<meta property="og:image" content="">
|
|
<meta property="og:description" content="The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.">
|
|
<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?230" rel="stylesheet" media="screen">
|
|
<style>
|
|
</style>
|
|
</head>
|
|
<body class="preload">
|
|
<div class="dev_page_wrap">
|
|
<div class="dev_page_head navbar navbar-static-top navbar-tg">
|
|
<div class="navbar-inner">
|
|
<div class="container clearfix">
|
|
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
|
|
<ul class="nav navbar-nav">
|
|
<li><a href="//telegram.org/">Home</a></li>
|
|
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
|
|
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
|
|
<li class="active"><a href="/api">API</a></li>
|
|
<li class=""><a href="/mtproto">Protocol</a></li>
|
|
<li class=""><a href="/schema">Schema</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container clearfix">
|
|
<div class="dev_page">
|
|
<div id="dev_page_content_wrap" class=" ">
|
|
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/config" >Client configuration</a></li></ul></div>
|
|
<h1 id="dev_page_title">Client configuration</h1>
|
|
|
|
<div id="dev_page_content"><!-- scroll_nav -->
|
|
|
|
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods. </p>
|
|
<h3><a class="anchor" href="#mtproto-configuration" id="mtproto-configuration" name="mtproto-configuration"><i class="anchor-icon"></i></a>MTProto configuration</h3>
|
|
<pre><code><a href='/constructor/config'>config</a>#330b4067 flags:<a href='/type/%23'>#</a> phonecalls_enabled:flags.1?<a href='/constructor/true'>true</a> default_p2p_contacts:flags.3?<a href='/constructor/true'>true</a> preload_featured_stickers:flags.4?<a href='/constructor/true'>true</a> ignore_phone_entities:flags.5?<a href='/constructor/true'>true</a> revoke_pm_inbox:flags.6?<a href='/constructor/true'>true</a> blocked_mode:flags.8?<a href='/constructor/true'>true</a> pfs_enabled:flags.13?<a href='/constructor/true'>true</a> date:<a href='/type/int'>int</a> expires:<a href='/type/int'>int</a> test_mode:<a href='/type/Bool'>Bool</a> this_dc:<a href='/type/int'>int</a> dc_options:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DcOption'>DcOption</a>> dc_txt_domain_name:<a href='/type/string'>string</a> chat_size_max:<a href='/type/int'>int</a> megagroup_size_max:<a href='/type/int'>int</a> forwarded_count_max:<a href='/type/int'>int</a> online_update_period_ms:<a href='/type/int'>int</a> offline_blur_timeout_ms:<a href='/type/int'>int</a> offline_idle_timeout_ms:<a href='/type/int'>int</a> online_cloud_timeout_ms:<a href='/type/int'>int</a> notify_cloud_delay_ms:<a href='/type/int'>int</a> notify_default_delay_ms:<a href='/type/int'>int</a> push_chat_period_ms:<a href='/type/int'>int</a> push_chat_limit:<a href='/type/int'>int</a> saved_gifs_limit:<a href='/type/int'>int</a> edit_time_limit:<a href='/type/int'>int</a> revoke_time_limit:<a href='/type/int'>int</a> revoke_pm_time_limit:<a href='/type/int'>int</a> rating_e_decay:<a href='/type/int'>int</a> stickers_recent_limit:<a href='/type/int'>int</a> stickers_faved_limit:<a href='/type/int'>int</a> channels_read_media_period:<a href='/type/int'>int</a> tmp_sessions:flags.0?<a href='/type/int'>int</a> pinned_dialogs_count_max:<a href='/type/int'>int</a> pinned_infolder_count_max:<a href='/type/int'>int</a> call_receive_timeout_ms:<a href='/type/int'>int</a> call_ring_timeout_ms:<a href='/type/int'>int</a> call_connect_timeout_ms:<a href='/type/int'>int</a> call_packet_timeout_ms:<a href='/type/int'>int</a> me_url_prefix:<a href='/type/string'>string</a> autoupdate_url_prefix:flags.7?<a href='/type/string'>string</a> gif_search_username:flags.9?<a href='/type/string'>string</a> venue_search_username:flags.10?<a href='/type/string'>string</a> img_search_username:flags.11?<a href='/type/string'>string</a> static_maps_provider:flags.12?<a href='/type/string'>string</a> caption_length_max:<a href='/type/int'>int</a> message_length_max:<a href='/type/int'>int</a> webfile_dc_id:<a href='/type/int'>int</a> suggested_lang_code:flags.2?<a href='/type/string'>string</a> lang_pack_version:flags.2?<a href='/type/int'>int</a> base_lang_pack_version:flags.2?<a href='/type/int'>int</a> = <a href='/type/Config'>Config</a>;
|
|
<a href='/constructor/nearestDc'>nearestDc</a>#8e1a1775 country:<a href='/type/string'>string</a> this_dc:<a href='/type/int'>int</a> nearest_dc:<a href='/type/int'>int</a> = <a href='/type/NearestDc'>NearestDc</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.getConfig'>help.getConfig</a>#c4f9186b = <a href='/type/Config'>Config</a>;
|
|
<a href='/method/help.getNearestDc'>help.getNearestDc</a>#1fb33026 = <a href='/type/NearestDc'>NearestDc</a>;</code></pre>
|
|
<p>The huge <a href="/constructor/config">config</a> constructor contains lots of useful information, from chat and message size limitations, to privacy settings, online status refresh interval and timeout, VoIP configuration, default inline bot usernames for GIF, image and venue lookup, and lots of other global and user-specific information, check out the <a href="/constructor/config">constructor page</a> for more information.</p>
|
|
<h3><a class="anchor" href="#client-configuration" id="client-configuration" name="client-configuration"><i class="anchor-icon"></i></a>Client configuration</h3>
|
|
<pre><code><a href='/constructor/jsonObjectValue'>jsonObjectValue</a>#c0de1bd9 key:<a href='/type/string'>string</a> value:<a href='/type/JSONValue'>JSONValue</a> = <a href='/type/JSONObjectValue'>JSONObjectValue</a>;
|
|
|
|
<a href='/constructor/jsonNull'>jsonNull</a>#3f6d7b68 = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonBool'>jsonBool</a>#c7345e6a value:<a href='/type/Bool'>Bool</a> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonNumber'>jsonNumber</a>#2be0dfa4 value:<a href='/type/double'>double</a> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonString'>jsonString</a>#b71e767a value:<a href='/type/string'>string</a> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonArray'>jsonArray</a>#f7444763 value:<a href='/type/Vector%20t'>Vector</a><<a href='/type/JSONValue'>JSONValue</a>> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonObject'>jsonObject</a>#99c1d49d value:<a href='/type/Vector%20t'>Vector</a><<a href='/type/JSONObjectValue'>JSONObjectValue</a>> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.getAppConfig'>help.getAppConfig</a>#98914110 = <a href='/type/JSONValue'>JSONValue</a>;</code></pre>
|
|
<p>The <a href="/method/help.getAppConfig">help.getAppConfig</a> method returns a JSON object containing rapidly evolving, client-specific configuration parameters.<br>
|
|
While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specific configuration with information about server-side limitations and other MTProto-related information, <a href="/method/help.getAppConfig">help.getAppConfig</a> returns configuration parameters useful for graphical Telegram clients.</p>
|
|
<p>Typical fields included in the resulting JSON object are: </p>
|
|
<ul>
|
|
<li><code>emojies_animated_zoom</code> - <a href="/api/animated-emojis">Animated emojis</a> and <a href="/api/dice">animated dice</a> should be scaled by this factor before being shown to the user (float)</li>
|
|
<li><code>keep_alive_service</code> - Whether app clients should start a keepalive service to keep the app running and fetch updates even when the app is closed (boolean)</li>
|
|
<li><code>background_connection</code> - Whether app clients should start a background TCP connection for MTProto update fetching (boolean)</li>
|
|
<li><code>emojies_send_dice</code> - A list of supported <a href="/api/dice">animated dice</a> stickers (array of strings).</li>
|
|
<li><code>emojies_send_dice_success</code> - For <a href="/api/dice">animated dice</a> emojis other than the basic <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />, indicates the winning dice value and the final frame of the animated sticker, at which to show the fireworks <img class="emoji" src="//telegram.org/img/emoji/40/F09F8E86.png" width="20" height="20" alt="🎆" /> (object with emoji keys and object values, containing <code>value</code> and <code>frame_start</code> float values)</li>
|
|
<li><code>emojies_sounds</code> - A map of soundbites to be played when the user clicks on the specified <a href="/api/animated-emojis">animated emoji</a>; the <a href="/api/file_reference">file reference field</a> should be base64-decoded before <a href="/api/files">downloading the file</a> (map of <a href="/api/files">file IDs</a>, with emoji string keys)</li>
|
|
<li><code>gif_search_branding</code> - Specifies the name of the service providing GIF search through <a href="#mtproto-configuration">gif_search_username</a> (string)</li>
|
|
<li><code>gif_search_emojies</code> - Specifies a list of emojies that should be suggested as search term in a bar above the GIF search box (array of string emojis)</li>
|
|
<li><code>stickers_emoji_suggest_only_api</code> - Specifies that the app should not display local sticker suggestions for emojis at all and just use the result of <a href="/method/messages.getStickers">messages.getStickers</a> (bool)</li>
|
|
<li><code>stickers_emoji_cache_time</code> - Specifies the validity period of the local cache of <a href="/method/messages.getStickers">messages.getStickers</a>, also relevant when generating the <a href="/api/offsets#hash-generation">pagination hash</a> when invoking the method. (int)</li>
|
|
<li><code>qr_login_camera</code> - Whether the Settings->Devices menu should show an option to scan a <a href="/api/qr-login">QR login code</a> (boolean)</li>
|
|
<li><code>qr_login_code</code> - Whether the login screen should show a <a href="/api/qr-login">QR code login option</a>, possibly as default login method (string, "disabled", "primary" or "secondary")</li>
|
|
<li><code>dialog_filters_enabled</code> - Whether clients should show an option for managing <a href="/api/folders">dialog filters AKA folders</a> (boolean)</li>
|
|
<li><code>dialog_filters_tooltip</code> - Whether clients should actively show a tooltip, inviting the user to configure <a href="/api/folders">dialog filters AKA folders</a>; typically this happens when the chat list is long enough to start getting cluttered. (boolean)</li>
|
|
<li><code>autoarchive_setting_available</code> - Whether clients <em>can</em> invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a> with <a href="/constructor/globalPrivacySettings"><code>globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue</code></a>, to automatically archive and mute new incoming chats from non-contacts. (boolean)</li>
|
|
<li><code>pending_suggestions</code> - Contains a list of suggestions that should be actively shown as a tooltip to the user. (Array of strings, possible values shown <a href="#suggestions">in the suggestions section »</a>. </li>
|
|
<li><code>url_auth_domains</code> - A list of domains that support automatic login with manual user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</li>
|
|
<li><code>autologin_domains</code> - 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)</li>
|
|
<li><code>autologin_token</code> - Autologin token, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (string)</li>
|
|
<li><code>round_video_encoding</code> - Contains a set of recommended codec parameters for round videos. </li>
|
|
<li><code>chat_read_mark_size_threshold</code> - 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>. (int)</li>
|
|
<li><code>chat_read_mark_expire_period</code> - To protect user privacy, read receipts are only stored for <code>chat_read_mark_expire_period</code> seconds after the message was sent. (int)</li>
|
|
<li><code>groupcall_video_participants_max</code> - Maximum number of participants in a group call (livestreams allow ∞ participants) (int)</li>
|
|
<li><code>reactions_default</code> - Default emoji reaction to use in the quick reaction menu, this value can be changed using <a href="/method/messages.setDefaultReaction">messages.setDefaultReaction</a> (string)</li>
|
|
<li><code>reactions_uniq_max</code> - Maximum number of unique reaction-emojis for any given message: for example, if there are 2000 <img class="emoji" src="//telegram.org/img/emoji/40/F09F918D.png" width="20" height="20" alt="👍" /> and 1000 <img class="emoji" src="//telegram.org/img/emoji/40/F09F9881.png" width="20" height="20" alt="😁" /> reactions and reactions_uniq_max = 2, you can't add a <img class="emoji" src="//telegram.org/img/emoji/40/F09F918E.png" width="20" height="20" alt="👎" /> reaction, because that would raise the number of unique reaction-emojis to 3 > 2. (integer)</li>
|
|
</ul>
|
|
<p>Example value: </p>
|
|
<pre><code class="language-json">{
|
|
"test": 1,
|
|
"emojies_animated_zoom": 0.625,
|
|
"keep_alive_service": true,
|
|
"background_connection": true,
|
|
"emojies_send_dice": [
|
|
"\ud83c\udfb2",
|
|
"\ud83c\udfaf",
|
|
"\ud83c\udfc0",
|
|
"\u26bd",
|
|
"\u26bd\ufe0f",
|
|
"\ud83c\udfb0",
|
|
"\ud83c\udfb3"
|
|
],
|
|
"emojies_send_dice_success": {
|
|
"\ud83c\udfaf": {
|
|
"value": 6,
|
|
"frame_start": 62
|
|
},
|
|
"\ud83c\udfc0": {
|
|
"value": 5,
|
|
"frame_start": 110
|
|
},
|
|
"\u26bd": {
|
|
"value": 5,
|
|
"frame_start": 110
|
|
},
|
|
"\u26bd\ufe0f": {
|
|
"value": 5,
|
|
"frame_start": 110
|
|
},
|
|
"\ud83c\udfb0": {
|
|
"value": 64,
|
|
"frame_start": 110
|
|
},
|
|
"\ud83c\udfb3": {
|
|
"value": 6,
|
|
"frame_start": 110
|
|
}
|
|
},
|
|
"emojies_sounds": {
|
|
"\ud83c\udf83": {
|
|
"id": "4956223179606458539",
|
|
"access_hash": "-2107001400913062971",
|
|
"file_reference_base64": "AGIaeBZckszt-s71DzCHhSkfZI_l"
|
|
},
|
|
"\u26b0": {
|
|
"id": "4956223179606458540",
|
|
"access_hash": "-1498869544183595185",
|
|
"file_reference_base64": "AGIaeBZRfKxsAgnaLEDh5XIa8Gri"
|
|
},
|
|
"\ud83e\udddf\u200d\u2642": {
|
|
"id": "4960929110848176331",
|
|
"access_hash": "3986395821757915468",
|
|
"file_reference_base64": "AGIaeBZcFga_bS9BsPvVNA2zuYCI"
|
|
},
|
|
"\ud83e\udddf": {
|
|
"id": "4960929110848176332",
|
|
"access_hash": "-8929417974289765626",
|
|
"file_reference_base64": "AGIaeBbUbidUDCl4nImJXPTl2wWj"
|
|
},
|
|
"\ud83e\udddf\u200d\u2640": {
|
|
"id": "4960929110848176333",
|
|
"access_hash": "9161696144162881753",
|
|
"file_reference_base64": "AGIaeBb-ulJ2E-rSI2B8EKyAXs-8"
|
|
},
|
|
"\ud83c\udf51": {
|
|
"id": "4963180910661861548",
|
|
"access_hash": "-7431729439735063448",
|
|
"file_reference_base64": "AGIaeBa940aXpIVLThj0J2ctxYFe"
|
|
},
|
|
"\ud83c\udf8a": {
|
|
"id": "5094064004578410732",
|
|
"access_hash": "8518192996098758509",
|
|
"file_reference_base64": "AGIaeBZFqTTp5drt0JZ86DGDAu1t"
|
|
},
|
|
"\ud83c\udf84": {
|
|
"id": "5094064004578410733",
|
|
"access_hash": "-4142643820629256996",
|
|
"file_reference_base64": "AGIaeBbEqu-gV0qAUdP5lD3MxLSK"
|
|
},
|
|
"\ud83e\uddbe": {
|
|
"id": "5094064004578410734",
|
|
"access_hash": "-8934384022571962340",
|
|
"file_reference_base64": "AGIaeBZ0YCp8_Zl_cmP4nvKkkSfF"
|
|
}
|
|
},
|
|
"gif_search_branding": "tenor",
|
|
"gif_search_emojies": [
|
|
"\ud83d\udc4d",
|
|
"\ud83d\ude18",
|
|
"\ud83d\ude0d",
|
|
"\ud83d\ude21",
|
|
"\ud83e\udd73",
|
|
"\ud83d\ude02",
|
|
"\ud83d\ude2e",
|
|
"\ud83d\ude44",
|
|
"\ud83d\ude0e",
|
|
"\ud83d\udc4e"
|
|
],
|
|
"stickers_emoji_suggest_only_api": false,
|
|
"stickers_emoji_cache_time": 86400,
|
|
"groupcall_video_participants_max": 1000,
|
|
"qr_login_camera": true,
|
|
"qr_login_code": "primary",
|
|
"dialog_filters_enabled": true,
|
|
"dialog_filters_tooltip": true,
|
|
"autoarchive_setting_available": false,
|
|
"pending_suggestions": [
|
|
"AUTOARCHIVE_POPULAR",
|
|
"VALIDATE_PASSWORD",
|
|
"VALIDATE_PHONE_NUMBER",
|
|
"NEWCOMER_TICKS"
|
|
],
|
|
"autologin_token": "string",
|
|
"autologin_domains": [
|
|
"instantview.telegram.org",
|
|
"translations.telegram.org",
|
|
"contest.dev",
|
|
"contest.com",
|
|
"bugs.telegram.org",
|
|
"suggestions.telegram.org",
|
|
"themes.telegram.org",
|
|
"promote.telegram.org"
|
|
],
|
|
"round_video_encoding": {
|
|
"diameter": 384,
|
|
"video_bitrate": 1000,
|
|
"audio_bitrate": 64,
|
|
"max_size": 12582912
|
|
},
|
|
"chat_read_mark_expire_period": 604800,
|
|
"chat_read_mark_size_threshold": 100,
|
|
"reactions_default": "\ud83d\udc4d",
|
|
"reactions_uniq_max": 11
|
|
}</code></pre>
|
|
<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>
|
|
<pre><code><a href='/constructor/jsonObjectValue'>jsonObjectValue</a>#c0de1bd9 key:<a href='/type/string'>string</a> value:<a href='/type/JSONValue'>JSONValue</a> = <a href='/type/JSONObjectValue'>JSONObjectValue</a>;
|
|
|
|
<a href='/constructor/jsonNull'>jsonNull</a>#3f6d7b68 = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonBool'>jsonBool</a>#c7345e6a value:<a href='/type/Bool'>Bool</a> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonNumber'>jsonNumber</a>#2be0dfa4 value:<a href='/type/double'>double</a> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonString'>jsonString</a>#b71e767a value:<a href='/type/string'>string</a> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonArray'>jsonArray</a>#f7444763 value:<a href='/type/Vector%20t'>Vector</a><<a href='/type/JSONValue'>JSONValue</a>> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
<a href='/constructor/jsonObject'>jsonObject</a>#99c1d49d value:<a href='/type/Vector%20t'>Vector</a><<a href='/type/JSONObjectValue'>JSONObjectValue</a>> = <a href='/type/JSONValue'>JSONValue</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.getAppConfig'>help.getAppConfig</a>#98914110 = <a href='/type/JSONValue'>JSONValue</a>;</code></pre>
|
|
<p>The <a href="/method/help.getAppConfig">help.getAppConfig</a> method returns a JSON object containing rapidly evolving, client-specific configuration parameters.<br>
|
|
A full list of these parameters can be seen in the <a href="#client-configuration">Client Configuration section »</a>, but we're mostly interested in the <code>pending_suggestions</code> and <code>autoarchive_setting_available</code> fields of the returned JSON object: </p>
|
|
<ul>
|
|
<li><code>autoarchive_setting_available</code> - Whether clients <em>can</em> invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a> with <a href="/constructor/globalPrivacySettings"><code>globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue</code></a>, to automatically archive and mute new incoming chats from non-contacts. (boolean)</li>
|
|
<li><code>pending_suggestions</code> - Contains a list of suggestions that should be actively shown as a tooltip to the user. Array of strings, possible values shown below:<ul>
|
|
<li><code>"AUTOARCHIVE_POPULAR"</code> - Users <em>should</em> invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a> with <a href="/constructor/globalPrivacySettings"><code>globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue</code></a>, to automatically archive and mute new incoming chats from non-contacts.</li>
|
|
<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>
|
|
</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><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.ChatFull'>messages.ChatFull</a>;
|
|
|
|
<a href='/constructor/channelFull'>channelFull</a>#e13c3d20 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> 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><<a href='/type/BotInfo'>BotInfo</a>> 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><<a href='/type/string'>string</a>> 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><<a href='/type/long'>long</a>> default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> = <a href='/type/ChatFull'>ChatFull</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/channels.getFullChannel'>channels.getFullChannel</a>#8736a09 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.ChatFull'>messages.ChatFull</a>;</code></pre>
|
|
<p>Some <a href="/api/channel">channel/supergroup</a>-related suggestions can also be contained in the <code>pending_suggestions</code> field of the <a href="/constructor/channelFull">channelFull</a> constructor, returned by <a href="/method/channels.getFullChannel">channels.getFullChannel</a>.<br>
|
|
Here's a list of possible suggestions: </p>
|
|
<ul>
|
|
<li><code>CONVERT_GIGAGROUP</code> - The <a href="/api/channel">supergroup</a> has many participants: the admin should call <a href="/method/channels.convertToGigagroup">channels.convertToGigagroup</a> to convert it to a gigagroup.</li>
|
|
</ul>
|
|
<h4><a class="anchor" href="#dismissing-suggestions" id="dismissing-suggestions" name="dismissing-suggestions"><i class="anchor-icon"></i></a>Dismissing suggestions</h4>
|
|
<pre><code><a href='/constructor/boolFalse'>boolFalse</a>#bc799737 = <a href='/type/Bool'>Bool</a>;
|
|
<a href='/constructor/boolTrue'>boolTrue</a>#997275b5 = <a href='/type/Bool'>Bool</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.dismissSuggestion'>help.dismissSuggestion</a>#f50dbaa1 peer:<a href='/type/InputPeer'>InputPeer</a> suggestion:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
|
<p><a href="/method/help.dismissSuggestion">help.dismissSuggestion</a> can be used to dismiss a suggestion.<br>
|
|
Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</code> for <a href="#basic-suggestions">basic suggestions</a> and the <a href="/api/channel">channel/supergroup</a>'s peer for <a href="#channel-suggestions">channel suggestions</a>.</p>
|
|
<h3><a class="anchor" href="#app-specific-configuration" id="app-specific-configuration" name="app-specific-configuration"><i class="anchor-icon"></i></a>App-specific configuration</h3>
|
|
<pre><code><a href='/constructor/help.appUpdate'>help.appUpdate</a>#ccbbce30 flags:<a href='/type/%23'>#</a> can_not_skip:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> version:<a href='/type/string'>string</a> text:<a href='/type/string'>string</a> entities:<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> document:flags.1?<a href='/type/Document'>Document</a> url:flags.2?<a href='/type/string'>string</a> sticker:flags.3?<a href='/type/Document'>Document</a> = <a href='/type/help.AppUpdate'>help.AppUpdate</a>;
|
|
<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><<a href='/type/Update'>Update</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> 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><<a href='/type/MessageEntity'>MessageEntity</a>> = <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>
|
|
<pre><code><a href='/constructor/help.termsOfServiceUpdateEmpty'>help.termsOfServiceUpdateEmpty</a>#e3309f7f expires:<a href='/type/int'>int</a> = <a href='/type/help.TermsOfServiceUpdate'>help.TermsOfServiceUpdate</a>;
|
|
<a href='/constructor/help.termsOfServiceUpdate'>help.termsOfServiceUpdate</a>#28ecf961 expires:<a href='/type/int'>int</a> terms_of_service:<a href='/type/help.TermsOfService'>help.TermsOfService</a> = <a href='/type/help.TermsOfServiceUpdate'>help.TermsOfServiceUpdate</a>;
|
|
|
|
<a href='/constructor/help.termsOfService'>help.termsOfService</a>#780a0310 flags:<a href='/type/%23'>#</a> popup:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/DataJSON'>DataJSON</a> text:<a href='/type/string'>string</a> entities:<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> min_age_confirm:flags.1?<a href='/type/int'>int</a> = <a href='/type/help.TermsOfService'>help.TermsOfService</a>;
|
|
|
|
<a href='/constructor/auth.authorizationSignUpRequired'>auth.authorizationSignUpRequired</a>#44747e9a flags:<a href='/type/%23'>#</a> terms_of_service:flags.0?<a href='/type/help.TermsOfService'>help.TermsOfService</a> = <a href='/type/auth.Authorization'>auth.Authorization</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.getTermsOfServiceUpdate'>help.getTermsOfServiceUpdate</a>#2ca51fd1 = <a href='/type/help.TermsOfServiceUpdate'>help.TermsOfServiceUpdate</a>;
|
|
<a href='/method/help.acceptTermsOfService'>help.acceptTermsOfService</a>#ee72f79a id:<a href='/type/DataJSON'>DataJSON</a> = <a href='/type/Bool'>Bool</a>;
|
|
|
|
<a href='/method/auth.signIn'>auth.signIn</a>#bcd51581 phone_number:<a href='/type/string'>string</a> phone_code_hash:<a href='/type/string'>string</a> phone_code:<a href='/type/string'>string</a> = <a href='/type/auth.Authorization'>auth.Authorization</a>;
|
|
|
|
<a href='/method/account.deleteAccount'>account.deleteAccount</a>#418d4e0b reason:<a href='/type/string'>string</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>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>#3ff6ecb0 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> 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><<a href='/type/RestrictionReason'>RestrictionReason</a>> bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</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>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.getSupport'>help.getSupport</a>#9cdf08cd = <a href='/type/help.Support'>help.Support</a>;
|
|
<a href='/method/help.getSupportName'>help.getSupportName</a>#d360e72c = <a href='/type/help.SupportName'>help.SupportName</a>;</code></pre>
|
|
<p>These methods can be used for fetching info about Telegram's support user, that users can use to get support and ask questions about the app. </p>
|
|
<ul>
|
|
<li><a href="/method/help.getSupport">help.getSupport</a> - Will return the <a href="/constructor/user">user</a> object that can be used for contacting support.</li>
|
|
<li><a href="/method/help.getSupportName">help.getSupportName</a> - Will return a localized name for the support chat.</li>
|
|
</ul>
|
|
<h3><a class="anchor" href="#country-information-and-login-phone-patterns" id="country-information-and-login-phone-patterns" name="country-information-and-login-phone-patterns"><i class="anchor-icon"></i></a>Country information and login phone patterns</h3>
|
|
<pre><code><a href='/constructor/help.countryCode'>help.countryCode</a>#4203c5ef flags:<a href='/type/%23'>#</a> country_code:<a href='/type/string'>string</a> prefixes:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> patterns:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> = <a href='/type/help.CountryCode'>help.CountryCode</a>;
|
|
|
|
<a href='/constructor/help.country'>help.country</a>#c3878e23 flags:<a href='/type/%23'>#</a> hidden:flags.0?<a href='/constructor/true'>true</a> iso2:<a href='/type/string'>string</a> default_name:<a href='/type/string'>string</a> name:flags.1?<a href='/type/string'>string</a> country_codes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/help.CountryCode'>help.CountryCode</a>> = <a href='/type/help.Country'>help.Country</a>;
|
|
|
|
<a href='/constructor/help.countriesListNotModified'>help.countriesListNotModified</a>#93cc1f32 = <a href='/type/help.CountriesList'>help.CountriesList</a>;
|
|
<a href='/constructor/help.countriesList'>help.countriesList</a>#87d0759e countries:<a href='/type/Vector%20t'>Vector</a><<a href='/type/help.Country'>help.Country</a>> hash:<a href='/type/int'>int</a> = <a href='/type/help.CountriesList'>help.CountriesList</a>;
|
|
|
|
---functions---
|
|
<a href='/method/help.getCountriesList'>help.getCountriesList</a>#735787a8 lang_code:<a href='/type/string'>string</a> hash:<a href='/type/int'>int</a> = <a href='/type/help.CountriesList'>help.CountriesList</a>;</code></pre>
|
|
<p><a href="/method/help.getCountriesList">help.getCountriesList</a> can be used to fetch a list of localized names for all available countries and phone code patterns for logging in. </p>
|
|
<p>The phone code pattern should be used when showing the <a href="/api/auth">login</a> screen, or when changing phone number: for example, a pattern value of <code>XXX XXX XXX</code> with <code>country_code</code> <code>+39</code> indicates that the phone field for login should accept a spaced pattern like <code>+39 123 456 789</code>.<br>
|
|
Also, the beginning of the national part of the phone number (<code>123 456 789</code>) should match one of the <code>prefixes</code>, if any were returned. </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/blog">Blog</a></li>
|
|
<li><a href="//telegram.org/jobs">Jobs</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/dl/android">Android</a></li>
|
|
<li><a href="//telegram.org/dl/wp">Windows Phone</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="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="/js/main.js?46"></script>
|
|
<script src="/js/jquery.min.js?1"></script>
|
|
<script src="/js/bootstrap.min.js?1"></script>
|
|
|
|
<script>window.initDevPageNav&&initDevPageNav();
|
|
backToTopInit("Go up");
|
|
removePreloadInit();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|