telegram-crawler/data/web/core.telegram.org/api/links.html
2023-03-20 11:08:32 +00:00

1226 lines
54 KiB
HTML

<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Deep links</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.">
<meta property="og:title" content="Deep links">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/links" >Deep links</a></li></ul></div>
<h1 id="dev_page_title">Deep links</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram clients must handle special <code>tg://</code> and <code>t.me</code> deep links encountered in messages, link entities and in other apps by registering OS handlers. </p>
<p>Links are generally available in two flavors: <code>t.me</code> HTTPS links and <code>tg:</code> URIs. </p>
<p><code>t.me</code> link syntax examples: </p>
<ul>
<li><code>t.me/path?query</code></li>
<li><code>http://t.me/path?query</code></li>
<li><code>https://t.me/path?query</code></li>
</ul>
<p>Where <code>t.me</code> can also be <code>telegram.me</code>, <code>telegram.dog</code>, and the domain specified in the <code>me_url_prefix</code> field of the global <a href="/constructor/config">configuration</a>, obtainable using <a href="/method/help.getConfig">help.getConfig</a>.</p>
<p><code>tg:</code> link syntax examples: </p>
<ul>
<li><code>tg:path?query</code></li>
<li><code>tg://path?query</code></li>
</ul>
<p>The <code>#fragment</code> part is always ignored. </p>
<h3><a class="anchor" href="#public-username-links" id="public-username-links" name="public-username-links"><i class="anchor-icon"></i></a>Public username links</h3>
<p>Used to link to public users, groups and channels, see <a href="/api/invites#public-usernames">here for more info on how to handle them »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;username&gt;
&lt;username&gt;.t.me</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;username&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>username</code></td>
<td style="text-align: center;">Required</td>
<td>Username to <a href="/api/invites#public-usernames">check or import »</a></td>
</tr>
</tbody>
</table>
<p>Note that <a href="#message-links">message links</a> have the same syntax, with extra parameters. </p>
<h3><a class="anchor" href="#phone-number-links" id="phone-number-links" name="phone-number-links"><i class="anchor-icon"></i></a>Phone number links</h3>
<p>Used to link to public and private users by their phone number. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/+&lt;phone_number&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?phone=&lt;phone_number&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone_number</code></td>
<td style="text-align: center;">Required</td>
<td>Phone number to resolve using <a href="/method/contacts.resolvePhone">contacts.resolvePhone</a></td>
</tr>
</tbody>
</table>
<p>Note that <a href="#message-links">chat invite links</a> have the same syntax, but <code>&lt;phone_number&gt;</code> won't be a valid phone number. </p>
<h3><a class="anchor" href="#chat-invite-links" id="chat-invite-links" name="chat-invite-links"><i class="anchor-icon"></i></a>Chat invite links</h3>
<p>Used to invite users to private groups and channels, see <a href="/api/invites#invite-links">here for more info on how to generate such links »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/+&lt;hash&gt;</code></pre>
<p><code>t.me</code> syntax (legacy):</p>
<pre><code>t.me/joinchat/&lt;hash&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://join?invite=&lt;hash&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>hash</code></td>
<td style="text-align: center;">Required</td>
<td>Invite hash to <a href="/api/invites#invite-links">check or import »</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#message-links" id="message-links" name="message-links"><i class="anchor-icon"></i></a>Message links</h3>
<p>Used to link to specific messages in public or private groups and channels. </p>
<p><code>t.me</code> syntax (public links): </p>
<pre><code>t.me/&lt;username&gt;/&lt;id&gt;?single&amp;thread=&lt;thread_id&gt;&amp;comment=&lt;message_id&gt;&amp;t=&lt;media_timestamp&gt;</code></pre>
<p><code>t.me</code> syntax (private links): </p>
<pre><code>t.me/c/&lt;channel&gt;/&lt;id&gt;?single&amp;thread=&lt;thread_id&gt;&amp;comment=&lt;message_id&gt;&amp;t=&lt;media_timestamp&gt;</code></pre>
<p><code>tg:</code> syntax (public links):</p>
<pre><code>tg://resolve?domain=&lt;username&gt;&amp;post=&lt;id&gt;&amp;single&amp;thread=&lt;thread&gt;&amp;comment=&lt;comment&gt;&amp;t=&lt;media_timestamp&gt;</code></pre>
<p><code>tg:</code> syntax (private links):</p>
<pre><code>tg://privatepost?channel=&lt;channelid&gt;&amp;post=&lt;id&gt;&amp;single&amp;thread=&lt;thread&gt;&amp;comment=&lt;comment&gt;&amp;t=&lt;media_timestamp&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>username</code></td>
<td style="text-align: center;">Required if public link</td>
<td>Dialog username.</td>
</tr>
<tr>
<td><code>channel</code></td>
<td style="text-align: center;">Required if private link</td>
<td>Channel or supergroup ID.</td>
</tr>
<tr>
<td><code>id</code></td>
<td style="text-align: center;">Required</td>
<td>Message ID.</td>
</tr>
<tr>
<td><code>single</code></td>
<td style="text-align: center;">Optional</td>
<td>For albums/grouped media, if set indicates that this is a link to a specific media in the album; otherwise, it is a link to the entire album.</td>
</tr>
<tr>
<td><code>thread</code></td>
<td style="text-align: center;">Optional</td>
<td>For <a href="/api/threads">message threads</a>, contains the thread ID.</td>
</tr>
<tr>
<td><code>comment</code></td>
<td style="text-align: center;">Optional</td>
<td>For <a href="/api/discussion">channel comments</a>, <code>username</code> will contain the channel username, <code>id</code> will contain the message ID of the channel message that started the comment section and this field will contain the message ID of the comment in the discussion group.</td>
</tr>
<tr>
<td><code>media_timestamp</code></td>
<td style="text-align: center;">Optional</td>
<td>Timestamp at which to start playing the media file present in the body or in the webpage preview of the message, in the following formats: <br>- Seconds: <code>123</code>, regex <code>^(\d+)$</code> <br>- Minutes and seconds: <code>10:23</code>, example regex <code>^(\d+):(\d{1,2})$</code> <br>- Hours, minutes and seconds: <code>1h23m10s</code>, example regex <code>^(?:(\d+)h)?(?:(\d{1,2})m)?(?:(\d{1,2})s)$</code></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#share-links" id="share-links" name="share-links"><i class="anchor-icon"></i></a>Share links</h3>
<p>Used to share a prepared message and URL into a chosen chat's text field.<br>
These links should be handled as follows:</p>
<ul>
<li>Open a dialog selection prompt</li>
<li>After selection: validate, trim and enter the URL at the beginning of the text field</li>
<li>Append a newline to the text field</li>
<li>Append and select the <code>text</code>, if present</li>
</ul>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/share?url=&lt;url&gt;
t.me/share/url?url=&lt;url&gt;&amp;text=&lt;text&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://msg_url?url=&lt;url&gt;&amp;text=&lt;text&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td style="text-align: center;">Required</td>
<td>URL to share (urlencoded)</td>
</tr>
<tr>
<td><code>text</code></td>
<td style="text-align: center;">Optional</td>
<td>Message to share</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#video-chatlivestream-links" id="video-chatlivestream-links" name="video-chatlivestream-links"><i class="anchor-icon"></i></a>Video chat/Livestream links</h3>
<p>Used to join video/voice chats in groups, and livestreams in channels.<br>
Such links are generated using <a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a>.<br>
Note that <code>voicechat</code> links are deprecated, the API will always export <code>videochat</code> links for video and voice chats in groups, clients should support parsing the old link format only for backwards compatibility. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;username&gt;?videochat
t.me/&lt;username&gt;?videochat=&lt;invite_hash&gt;
t.me/&lt;username&gt;?livestream
t.me/&lt;username&gt;?livestream=&lt;invite_hash&gt;
t.me/&lt;username&gt;?voicechat
t.me/&lt;username&gt;?voicechat=&lt;invite_hash&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;username&gt;&amp;videochat
tg://resolve?domain=&lt;username&gt;&amp;videochat=&lt;invite_hash&gt;
tg://resolve?domain=&lt;username&gt;&amp;livestream
tg://resolve?domain=&lt;username&gt;&amp;livestream=&lt;invite_hash&gt;
tg://resolve?domain=&lt;username&gt;&amp;voicechat
tg://resolve?domain=&lt;username&gt;&amp;voicechat=&lt;invite_hash&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>invite_hash</code></td>
<td style="text-align: center;">Optional</td>
<td>Invite hash exported if the <code>can_self_unmute</code> flag is set when calling <a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a>: should be passed to <a href="/method/phone.joinGroupCall">phone.joinGroupCall</a>, allows the user to speak in livestreams or muted group chats.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#stickerset-links" id="stickerset-links" name="stickerset-links"><i class="anchor-icon"></i></a>Stickerset links</h3>
<p>Used to import stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/addstickers/&lt;slug&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://addstickers?set=&lt;slug&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Stickerset short name, used when <a href="/api/stickers#installing-stickersets">installing stickers</a>.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#custom-emoji-stickerset-links" id="custom-emoji-stickerset-links" name="custom-emoji-stickerset-links"><i class="anchor-icon"></i></a>Custom emoji stickerset links</h3>
<p>Used to import <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/addemoji/&lt;slug&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://addemoji?set=&lt;slug&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Stickerset short name, used when <a href="/api/stickers#installing-stickersets">installing stickers</a>.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#proxy-links" id="proxy-links" name="proxy-links"><i class="anchor-icon"></i></a>Proxy links</h3>
<p>Used to share a proxy server that can be used to connect to Telegram. </p>
<h4><a class="anchor" href="#mtproxy-links" id="mtproxy-links" name="mtproxy-links"><i class="anchor-icon"></i></a>MTProxy links</h4>
<p>Used for <a href="/mtproto/mtproto-transports#transport-obfuscation">MTProxies »</a>.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/proxy?server=&lt;server&gt;&amp;port=&lt;port&gt;&amp;secret=&lt;secret&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://proxy?server=&lt;server&gt;&amp;port=&lt;port&gt;&amp;secret=&lt;secret&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>server</code></td>
<td style="text-align: center;">Required</td>
<td>MTProxy server IP address or host</td>
</tr>
<tr>
<td><code>port</code></td>
<td style="text-align: center;">Required</td>
<td>MTProxy server port</td>
</tr>
<tr>
<td><code>secret</code></td>
<td style="text-align: center;">Required</td>
<td>MTProxy <a href="/mtproto/mtproto-transports#transport-obfuscation">secret »</a></td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#socks5-proxy-links" id="socks5-proxy-links" name="socks5-proxy-links"><i class="anchor-icon"></i></a>Socks5 proxy links</h4>
<p>Used for socks5 proxies.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/socks?server=&lt;server&gt;&amp;port=&lt;port&gt;&amp;user=&lt;user&gt;&amp;pass=&lt;pass&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://socks?server=&lt;server&gt;&amp;port=&lt;port&gt;&amp;user=&lt;user&gt;&amp;pass=&lt;pass&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>server</code></td>
<td style="text-align: center;">Required</td>
<td>Proxy server IP address or host</td>
</tr>
<tr>
<td><code>port</code></td>
<td style="text-align: center;">Required</td>
<td>Proxy server port</td>
</tr>
<tr>
<td><code>user</code></td>
<td style="text-align: center;">Optional</td>
<td>Proxy server username</td>
</tr>
<tr>
<td><code>pass</code></td>
<td style="text-align: center;">Optional</td>
<td>Proxy server password</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#theme-links" id="theme-links" name="theme-links"><i class="anchor-icon"></i></a>Theme links</h3>
<p>Used to <a href="/api/themes#installing-themes">install themes »</a>.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/addtheme/&lt;name&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://addtheme?slug=&lt;name&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td style="text-align: center;">Required</td>
<td>Theme short name used when <a href="/api/themes#installing-themes">installing themes »</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#wallpaper-links" id="wallpaper-links" name="wallpaper-links"><i class="anchor-icon"></i></a>Wallpaper links</h3>
<p>Used to share and install chat backgrounds (wallpapers): see <a href="/api/wallpapers">here for more info on the various wallpaper and fill types »</a>. </p>
<h4><a class="anchor" href="#image-wallpapers" id="image-wallpapers" name="image-wallpapers"><i class="anchor-icon"></i></a><a href="/api/wallpapers#image-wallpapers">Image wallpapers</a></h4>
<p>Used for <a href="/api/wallpapers#image-wallpapers">image-based wallpapers »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;slug&gt;?mode=&lt;mode&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?slug=&lt;slug&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Wallpaper slug used to obtain the image file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
</tr>
<tr>
<td><code>mode</code></td>
<td style="text-align: center;">Optional</td>
<td>A combination of <code>blur</code> and <code>motion</code> (joined by <code>+</code>) to enable blurring and/or parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs »</a>.</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#solid-fill-wallpapers" id="solid-fill-wallpapers" name="solid-fill-wallpapers"><i class="anchor-icon"></i></a>Solid fill wallpapers</h4>
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;hex_color&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?color=&lt;hex_color&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>hex_color</code></td>
<td style="text-align: center;">Required</td>
<td>Fill color in hex RGB format.</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#gradient-fill-wallpapers" id="gradient-fill-wallpapers" name="gradient-fill-wallpapers"><i class="anchor-icon"></i></a>Gradient fill wallpapers</h4>
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;top_color&gt;-&lt;bottom_color&gt;?rotation=&lt;rotation&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?gradient=&lt;top_color&gt;-&lt;bottom_color&gt;&amp;rotation=&lt;rotation&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>top_color</code></td>
<td style="text-align: center;">Required</td>
<td>Top gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>bottom_color</code></td>
<td style="text-align: center;">Required</td>
<td>Bottom gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>rotation</code></td>
<td style="text-align: center;">Optional</td>
<td>Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45, default to 0 if not set.</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#freeform-gradient-fill-wallpapers" id="freeform-gradient-fill-wallpapers" name="freeform-gradient-fill-wallpapers"><i class="anchor-icon"></i></a>Freeform gradient fill wallpapers</h4>
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;
t.me/bg/&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;~&lt;hex_color4&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?gradient=&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;
tg://bg?gradient=&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;~&lt;hex_color4&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>hex_color1</code></td>
<td style="text-align: center;">Required</td>
<td>First gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>hex_color2</code></td>
<td style="text-align: center;">Required</td>
<td>Second gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>hex_color3</code></td>
<td style="text-align: center;">Required</td>
<td>Third gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>hex_color4</code></td>
<td style="text-align: center;">Optional</td>
<td>Fourth gradient color in hex RGB format.</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#solid-pattern-wallpapers" id="solid-pattern-wallpapers" name="solid-pattern-wallpapers"><i class="anchor-icon"></i></a>Solid pattern wallpapers</h4>
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;slug&gt;?intensity=&lt;intensity&gt;&amp;bg_color=&lt;bg_color&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?slug=&lt;slug&gt;&amp;intensity=&lt;intensity&gt;&amp;bg_color=&lt;bg_color&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Wallpaper slug used to obtain the pattern file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
</tr>
<tr>
<td><code>intensity</code></td>
<td style="text-align: center;">Required</td>
<td>A value ranging from -100 to 100, used to combine the pattern with the fill <a href="/api/wallpapers#pattern-wallpapers">as specified in the docs</a>.</td>
</tr>
<tr>
<td><code>bg_color</code></td>
<td style="text-align: center;">Required</td>
<td>Fill color in hex RGB format.</td>
</tr>
<tr>
<td><code>mode</code></td>
<td style="text-align: center;">Optional</td>
<td><code>motion</code> to enable parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs</a>.</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#gradient-pattern-wallpapers" id="gradient-pattern-wallpapers" name="gradient-pattern-wallpapers"><i class="anchor-icon"></i></a>Gradient pattern wallpapers</h4>
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;slug&gt;?intensity=&lt;intensity&gt;&amp;bg_color=&lt;top_color&gt;-&lt;bottom_color&gt;&amp;rotation=&lt;rotation&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?slug=&lt;slug&gt;&amp;intensity=&lt;intensity&gt;&amp;bg_color=&lt;top_color&gt;-&lt;bottom_color&gt;&amp;rotation=&lt;rotation&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Wallpaper slug used to obtain the pattern file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
</tr>
<tr>
<td><code>intensity</code></td>
<td style="text-align: center;">Required</td>
<td>A value ranging from -100 to 100, used to combine the pattern with the fill <a href="/api/wallpapers#pattern-wallpapers">as specified in the docs</a>.</td>
</tr>
<tr>
<td><code>top_color</code></td>
<td style="text-align: center;">Required</td>
<td>Top gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>bottom_color</code></td>
<td style="text-align: center;">Required</td>
<td>Bottom gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>rotation</code></td>
<td style="text-align: center;">Optional</td>
<td>Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45, default to 0 if not set.</td>
</tr>
<tr>
<td><code>mode</code></td>
<td style="text-align: center;">Optional</td>
<td><code>motion</code> to enable parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs</a>.</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#freeform-gradient-pattern-wallpapers" id="freeform-gradient-pattern-wallpapers" name="freeform-gradient-pattern-wallpapers"><i class="anchor-icon"></i></a>Freeform gradient pattern wallpapers</h4>
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/bg/&lt;slug&gt;?intensity=&lt;intensity&gt;&amp;bg_color=&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;&amp;mode=&lt;mode&gt;
t.me/bg/&lt;slug&gt;?intensity=&lt;intensity&gt;&amp;bg_color=&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;~&lt;hex_color4&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://bg?slug=&lt;slug&gt;&amp;intensity=&lt;intensity&gt;&amp;bg_color=&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;&amp;mode=&lt;mode&gt;
tg://bg?slug=&lt;slug&gt;&amp;intensity=&lt;intensity&gt;&amp;bg_color=&lt;hex_color1&gt;~&lt;hex_color2&gt;~&lt;hex_color3&gt;~&lt;hex_color4&gt;&amp;mode=&lt;mode&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Wallpaper slug used to obtain the pattern file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
</tr>
<tr>
<td><code>intensity</code></td>
<td style="text-align: center;">Required</td>
<td>A value ranging from -100 to 100, used to combine the pattern with the fill <a href="/api/wallpapers#pattern-wallpapers">as specified in the docs</a>.</td>
</tr>
<tr>
<td><code>hex_color1</code></td>
<td style="text-align: center;">Required</td>
<td>First gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>hex_color2</code></td>
<td style="text-align: center;">Required</td>
<td>Second gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>hex_color3</code></td>
<td style="text-align: center;">Required</td>
<td>Third gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>hex_color4</code></td>
<td style="text-align: center;">Optional</td>
<td>Fourth gradient color in hex RGB format.</td>
</tr>
<tr>
<td><code>mode</code></td>
<td style="text-align: center;">Optional</td>
<td><code>motion</code> to enable parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs</a>.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#bot-links" id="bot-links" name="bot-links"><i class="anchor-icon"></i></a>Bot links</h3>
<p>Used to link to bots.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;bot_username&gt;?start=&lt;parameter&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;bot_username&gt;&amp;start=&lt;parameter&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bot_username</code></td>
<td style="text-align: center;">Required</td>
<td>Bot username</td>
</tr>
<tr>
<td><code>parameter</code></td>
<td style="text-align: center;">Optional</td>
<td>Start parameter, up to 64 <a href="https://en.wikipedia.org/wiki/Base64#The_URL_applications">base64url</a> characters: if provided and the <code>bot_username</code> is indeed a bot, the text input bar should be replaced with a <code>Start</code> button (even if the user has already started the bot) that should invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code> once clicked.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#groupchannel-bot-links" id="groupchannel-bot-links" name="groupchannel-bot-links"><i class="anchor-icon"></i></a>Group/channel bot links</h3>
<p>Used to add bots to groups or channels.<br>
First of all, check that the <code>&lt;bot_username&gt;</code> indeed links to a bot.<br>
Then, for group links:</p>
<ul>
<li>If the <code>admin</code> parameter is not provided:<ul>
<li>Bring up a dialog selection of groups where the user can add members</li>
<li>Add the bot to the group</li>
<li>If a <code>parameter</code> is provided, invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code></li>
</ul>
</li>
<li>If the <code>admin</code> parameter is provided:<ul>
<li>Bring up a dialog selection of groups where the user can add/edit admins</li>
<li>If the bot is already an admin of the group, combine existing admin rights with the admin rights in <code>admin</code></li>
<li>Add the bot as admin/modify admin permissions to the new rights</li>
<li>If a <code>parameter</code> is provided, invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code></li>
</ul>
</li>
</ul>
<p>For channel links:</p>
<ul>
<li>Bring up a dialog selection of channels where the user can add/edit admins</li>
<li>If the bot is already an admin of the channel, combine existing admin rights with the admin rights in <code>admin</code></li>
<li>Add the bot as admin/modify admin permissions to the new rights</li>
</ul>
<p><code>t.me</code> syntax (groups):</p>
<pre><code>t.me/&lt;bot_username&gt;?startgroup=&lt;parameter&gt;&amp;admin=&lt;permissions&gt;
t.me/&lt;bot_username&gt;?startgroup&amp;admin=&lt;permissions&gt;</code></pre>
<p><code>tg:</code> syntax (groups):</p>
<pre><code>tg://resolve?domain=&lt;bot_username&gt;&amp;startgroup=&lt;parameter&gt;&amp;admin=&lt;permissions&gt;
tg://resolve?domain=&lt;bot_username&gt;&amp;startgroup&amp;admin=&lt;permissions&gt;</code></pre>
<p><code>t.me</code> syntax (channels):</p>
<pre><code>t.me/&lt;bot_username&gt;?startchannel&amp;admin=&lt;permissions&gt;</code></pre>
<p><code>tg:</code> syntax (channels):</p>
<pre><code>tg://resolve?domain=&lt;bot_username&gt;&amp;startchannel&amp;admin=&lt;permissions&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bot_username</code></td>
<td style="text-align: center;">Required</td>
<td>Bot username</td>
</tr>
<tr>
<td><code>parameter</code></td>
<td style="text-align: center;">Optional for group links, absent in channel links</td>
<td>Start parameter, only for group links, up to 64 <a href="https://en.wikipedia.org/wiki/Base64#The_URL_applications">base64url</a> characters: if provided and the <code>bot_username</code> is indeed a bot, <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code> should be invoked after adding the bot to the group.</td>
</tr>
<tr>
<td><code>admin</code></td>
<td style="text-align: center;">Optional for group links, required for channel links</td>
<td>A combination of the following identifiers separated by <code>+</code>, each corresponding to the appropriate flag in the <a href="/constructor/chatAdminRights">chatAdminRights »</a> constructor: <br>- <code>change_info</code> - <a href="/constructor/chatAdminRights">chatAdminRights.change_info</a> <br>- <code>post_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_messages</a> <br>- <code>edit_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_messages</a> <br>- <code>delete_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_messages</a> <br>- <code>restrict_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.ban_users</a> <br>- <code>invite_users</code> - <a href="/constructor/chatAdminRights">chatAdminRights.invite_users</a> <br>- <code>pin_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.pin_messages</a> <br>- <code>promote_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.add_admins</a> <br>- <code>manage_video_chats</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_call</a> <br>- <code>anonymous</code> - <a href="/constructor/chatAdminRights">chatAdminRights.anonymous</a> <br>- <code>manage_chat</code> - <a href="/constructor/chatAdminRights">chatAdminRights.other</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#game-links" id="game-links" name="game-links"><i class="anchor-icon"></i></a>Game links</h3>
<p>Used to share <a href="/api/bots/games">games</a>. </p>
<p>These links should be handled as follows: </p>
<ul>
<li>Check if <code>bot_username</code> is indeed a bot username, if so then</li>
<li>Bring up a dialog selection prompt</li>
<li>Send the game to the selected dialog using an <a href="/constructor/inputMediaGame">inputMediaGame</a> with an <a href="/constructor/inputGameShortName">inputGameShortName</a> as specified in the <a href="/api/bots/games#sending-a-game">game docs</a>. </li>
</ul>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;bot_username&gt;?game=&lt;short_name&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;bot_username&gt;&amp;game=&lt;short_name&gt;</code></pre>
<p>Parameters: </p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bot_username</code></td>
<td style="text-align: center;">Required</td>
<td>Username of the bot that owns the <a href="/api/bots/games">game</a></td>
</tr>
<tr>
<td><code>short_name</code></td>
<td style="text-align: center;">Required</td>
<td>Game short name</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#settings-links" id="settings-links" name="settings-links"><i class="anchor-icon"></i></a>Settings links</h3>
<h4><a class="anchor" href="#settings-link" id="settings-link" name="settings-link"><i class="anchor-icon"></i></a>Settings link</h4>
<p>Used to bring the user to the app settings. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings</code></pre>
<p>No parameters.</p>
<h4><a class="anchor" href="#change-phone-number-link" id="change-phone-number-link" name="change-phone-number-link"><i class="anchor-icon"></i></a>Change phone number link</h4>
<p>Used to bring the user to the phone number modification page, invoking <a href="/method/account.sendChangePhoneCode">account.sendChangePhoneCode</a> and <a href="/method/account.changePhone">account.changePhone</a>.</p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings/change_number</code></pre>
<p>No parameters.</p>
<h4><a class="anchor" href="#active-sessions-link" id="active-sessions-link" name="active-sessions-link"><i class="anchor-icon"></i></a>Active sessions link</h4>
<p>Used to bring the user to the active sessions page, calling <a href="/method/account.getAuthorizations">account.getAuthorizations</a>. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings/devices</code></pre>
<p>No parameters.</p>
<h4><a class="anchor" href="#folder-settings-link" id="folder-settings-link" name="folder-settings-link"><i class="anchor-icon"></i></a>Folder settings link</h4>
<p>Used to bring the user to the <a href="/api/folders">folder settings</a>. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings/folders</code></pre>
<p>No parameters.</p>
<h4><a class="anchor" href="#language-settings-link" id="language-settings-link" name="language-settings-link"><i class="anchor-icon"></i></a>Language settings link</h4>
<p>Used to bring the user to the language settings. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings/language</code></pre>
<p>No parameters.</p>
<h4><a class="anchor" href="#privacy-and-security-settings-link" id="privacy-and-security-settings-link" name="privacy-and-security-settings-link"><i class="anchor-icon"></i></a>Privacy and security settings link</h4>
<p>Used to bring the user to the privacy and security settings. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings/privacy</code></pre>
<p>No parameters.</p>
<h4><a class="anchor" href="#theme-settings-link" id="theme-settings-link" name="theme-settings-link"><i class="anchor-icon"></i></a>Theme settings link</h4>
<p>Used to bring the user to the theme settings section of the app. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://settings/theme</code></pre>
<p>No parameters.</p>
<h3><a class="anchor" href="#login-code-link" id="login-code-link" name="login-code-link"><i class="anchor-icon"></i></a>Login code link</h3>
<p>Contains the phone number verification code to use during <a href="/api/auth">user authorization »</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/login/&lt;code&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://login?code=&lt;code&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>code</code></td>
<td style="text-align: center;">Required</td>
<td>Login code.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#invoice-links" id="invoice-links" name="invoice-links"><i class="anchor-icon"></i></a>Invoice links</h3>
<p>Used to initiate <a href="/api/payments">payment of an invoice »</a>, generated using <a href="/constructor/payments.exportedInvoice">payments.exportedInvoice</a>. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/invoice/&lt;slug&gt;
t.me/$&lt;slug&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://invoice?slug=&lt;slug&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>The invoice slug to be used <a href="/api/payments">during payment »</a>.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#language-pack-links" id="language-pack-links" name="language-pack-links"><i class="anchor-icon"></i></a>Language pack links</h3>
<p>Used to import custom language packs using <a href="/method/langpack.getLangPack">langpack.getLangPack</a>.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/setlanguage/&lt;slug&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://setlanguage?lang=&lt;slug&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>slug</code></td>
<td style="text-align: center;">Required</td>
<td>Name of language pack to import using <a href="/method/langpack.getLangPack">langpack.getLangPack</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#telegram-passport-links" id="telegram-passport-links" name="telegram-passport-links"><i class="anchor-icon"></i></a>Telegram Passport links</h3>
<p>See <a href="/api/passport#uri-format">the Telegram Passport documentation for parameters and usage »</a>. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://passport?params
tg://resolve?domain=telegrampassport&amp;params</code></pre>
<h3><a class="anchor" href="#phone-confirmation-links" id="phone-confirmation-links" name="phone-confirmation-links"><i class="anchor-icon"></i></a>Phone confirmation links</h3>
<p>Different from <a href="#login-code-link">login code links</a>.<br>
These links are used to confirm ownership of the phone number, to prevent account deletion: see <a href="/api/account-deletion">the account deletion docs for more info on how to handle them »</a>.</p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/confirmphone?phone=&lt;phone&gt;&amp;hash=&lt;hash&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://confirmphone?phone=&lt;phone&gt;&amp;hash=&lt;hash&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td style="text-align: center;">Required</td>
<td>Phone number</td>
</tr>
<tr>
<td><code>hash</code></td>
<td style="text-align: center;">Required</td>
<td>Confirmation hash to handle <a href="/api/account-deletion">as described here »</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#premium-referrer-links" id="premium-referrer-links" name="premium-referrer-links"><i class="anchor-icon"></i></a>Premium referrer links</h3>
<p>Used by official apps to show the <a href="/api/premium">Telegram Premium</a> subscription page. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://premium_offer?ref=&lt;referrer&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>referrer</code></td>
<td style="text-align: center;">Optional</td>
<td>Used by official apps for analytics using <a href="/method/help.saveAppLog">help.saveAppLog</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#qr-code-login-links" id="qr-code-login-links" name="qr-code-login-links"><i class="anchor-icon"></i></a>QR code login links</h3>
<p>Used by <a href="/api/qr-login">QR code login</a>.</p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://login?token=&lt;base64encodedtoken&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>server</code></td>
<td style="text-align: center;">Required</td>
<td>Base64URL-encoded <a href="/api/qr-login">QR code login token</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#bot-attachment-menu-links" id="bot-attachment-menu-links" name="bot-attachment-menu-links"><i class="anchor-icon"></i></a>Bot attachment menu links</h3>
<p>Used to install and optionally open a <a href="/api/bots/attach">bot attachment menu »</a> in a certain chat.<br>
For all link types, clients should:</p>
<ul>
<li>Check that the associated bot username has an associated <a href="/api/bots/attach">attachment menu</a> as specified <a href="/api/bots/attach">here »</a>.</li>
<li>If not installed, ask the user to <a href="/api/bots/attach">install the attachment menu »</a>.</li>
<li>Check that the attachment menu can be opened in the chosen chat type by checking the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field.<ul>
<li>If the chosen chat is supported, open the attachment menu <a href="/api/bots/webapps#normal-web-apps">web app »</a></li>
<li>Otherwise:<ul>
<li>If the user has just installed the attachment menu @ step 2, notify the user that the attachment menu was installed successfully.</li>
<li>Otherwise, notify the user that the attachment menu webapp can't be opened in the specified chat.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4><a class="anchor" href="#open-in-current-chat" id="open-in-current-chat" name="open-in-current-chat"><i class="anchor-icon"></i></a>Open in current chat</h4>
<p>Installs and opens an attachment menu web app in the currently open chat. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;bot_username&gt;?startattach
t.me/&lt;bot_username&gt;?startattach=&lt;start_parameter&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;bot_username&gt;&amp;startattach
tg://resolve?domain=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bot_username</code></td>
<td style="text-align: center;">Required</td>
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment menu</a></td>
</tr>
<tr>
<td><code>start_parameter</code></td>
<td style="text-align: center;">Optional</td>
<td>If provided, should be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code></td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#open-in-specific-chat" id="open-in-specific-chat" name="open-in-specific-chat"><i class="anchor-icon"></i></a>Open in specific chat</h4>
<p>Installs and opens an attachment menu web app in a specific chat. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;username&gt;?attach=&lt;bot_username&gt;
t.me/&lt;username&gt;?attach=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;
t.me/+&lt;phone_number&gt;?attach=&lt;bot_username&gt;
t.me/+&lt;phone_number&gt;?attach=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;username&gt;&amp;attach=&lt;bot_username&gt;
tg://resolve?domain=&lt;username&gt;&amp;attach=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;
tg://resolve?phone=&lt;phone_number&gt;&amp;attach=&lt;bot_username&gt;
tg://resolve?phone=&lt;phone_number&gt;&amp;attach=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>username</code></td>
<td style="text-align: center;">Required for <a href="#public-username-links">username links</a></td>
<td>Username of chat where to open web app</td>
</tr>
<tr>
<td><code>phone_number</code></td>
<td style="text-align: center;">Required for <a href="#phone-number-links">phone number links</a></td>
<td>Phone number of private chat where to open web app</td>
</tr>
<tr>
<td><code>bot_username</code></td>
<td style="text-align: center;">Required</td>
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment menu</a></td>
</tr>
<tr>
<td><code>start_parameter</code></td>
<td style="text-align: center;">Optional</td>
<td>If provided, should be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code></td>
</tr>
</tbody>
</table>
<h4><a class="anchor" href="#open-in-any-chat" id="open-in-any-chat" name="open-in-any-chat"><i class="anchor-icon"></i></a>Open in any chat</h4>
<p>Installs an attachment menu, opens a dialog selection form that will open the attachment menu web app in a specific chat. </p>
<p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;bot_username&gt;?startattach&amp;choose=users+bots+groups+channels
t.me/&lt;bot_username&gt;?startattach=&lt;start_parameter&gt;&amp;choose=users+bots+groups+channels</code></pre>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;bot_username&gt;&amp;startattach&amp;choose=users+bots+groups+channels
tg://resolve?domain=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;&amp;choose=users+bots+groups+channels</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bot_username</code></td>
<td style="text-align: center;">Required</td>
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment menu</a></td>
</tr>
<tr>
<td><code>start_parameter</code></td>
<td style="text-align: center;">Optional</td>
<td>If provided, should be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code></td>
</tr>
<tr>
<td><code>choose</code></td>
<td style="text-align: center;">Optional</td>
<td>A combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code> separated by <code>+</code>: indicates the dialog types to show in the dialog selection popup: must be intersected with the dialog types contained in the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field before use.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#id-links" id="id-links" name="id-links"><i class="anchor-icon"></i></a>ID links</h3>
<p>ID links are merely an abstraction offered by the <a href="/bots/api">bot API</a> to simplify construction of <a href="/constructor/inputMessageEntityMentionName">inputMessageEntityMentionName</a> and <a href="/constructor/inputKeyboardButtonUserProfile">inputKeyboardButtonUserProfile</a> constructors, and should be ignored by normal clients. </p>
<p><code>tg:</code> syntax:</p>
<pre><code>tg://user?id=&lt;id&gt;</code></pre>
<p>Parameters:</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td style="text-align: center;">Required</td>
<td>User ID</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#unsupported-links" id="unsupported-links" name="unsupported-links"><i class="anchor-icon"></i></a>Unsupported links</h3>
<p>If a client encounters a <code>tg:</code> link type not listed on this page, <a href="/method/help.getDeepLinkInfo">help.getDeepLinkInfo</a> should be invoked with just the <code>path</code> component of the link. </p>
<p>Schema:</p>
<pre><code><a href='/constructor/help.deepLinkInfoEmpty'>help.deepLinkInfoEmpty</a>#66afa166 = <a href='/type/help.DeepLinkInfo'>help.DeepLinkInfo</a>;
<a href='/constructor/help.deepLinkInfo'>help.deepLinkInfo</a>#6a4ee832 flags:<a href='/type/%23'>#</a> update_app:flags.0?<a href='/constructor/true'>true</a> message:<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; = <a href='/type/help.DeepLinkInfo'>help.DeepLinkInfo</a>;
---functions---
<a href='/method/help.getDeepLinkInfo'>help.getDeepLinkInfo</a>#3fedc75f path:<a href='/type/string'>string</a> = <a href='/type/help.DeepLinkInfo'>help.DeepLinkInfo</a>;</code></pre>
<p>The method may return formatted text, containing for example: </p>
<ul>
<li>A description of what the link does or,</li>
<li>An explanation of why a certain link isn't supported by the app;</li>
</ul>
<p>And/or an invitation to upgrade to the latest version of the client app to be able to use the link: in this case, the result <code>update_app</code> flag will also be set, and the app should directly link to a store or attempt updating to the latest version. </p>
<p>Example links that can be used for testing: </p>
<ul>
<li><code>tg://need_update_for_some_feature?test=a</code></li>
<li><code>tg:some_unsupported_feature?test=b</code></li>
</ul>
<p>In these cases, <a href="/method/help.getDeepLinkInfo">help.getDeepLinkInfo</a> should be invoked with the following parameters:</p>
<ul>
<li><code>help.getDeepLinkInfo({path: "need_update_for_some_feature"})</code></li>
<li><code>help.getDeepLinkInfo({path: "some_unsupported_feature"})</code></li>
</ul>
<p>Note that this method should not be called for unrecognized <code>t.me</code> links, the usual HTTP link handling logic should be used, instead.</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="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>