<p>Each time the user opens a channel, <code>channels.getSponsoredMessages</code> must be called to receive <ahref="https://promote.telegram.org">sponsored messages</a> available for this channel. The result must be cached for <strong>5 minutes</strong>.</p>
<blockquote>
<p><ahref="https://t.me/durov/172">More about sponsored messages on Telegram</a></p>
<p>Sponsored messages must be displayed below all other posts in the channel, after the user scrolls further down, past the last message. The promoted channel or bot specified in the <code>from_id</code> or <code>chat_invite</code> mutually exclusive fields must be displayed as the author of the message. The message should also contain a button at the bottom with one of the following labels:</p>
<li><mark><strong>View Bot</strong></mark> — if a bot is being promoted. Tapping the button must open the chat with the bot. If <code>start_param</code> is specified, the app must use the <ahref="/api/links#bot-links">deep linking mechanism</a> to open the bot.</li>
<li><mark><strong>View Channel</strong></mark> — if a channel is being promoted. Tapping the button must open the channel using the <code>from_id</code> or by <ahref="/api/invites#invite-links">importing</a> the <code>chat_invite_hash</code><ahref="/api/invites#invite-links">invitation link hash »</a>.</li>
<li><mark><strong>View Post</strong></mark> — if a channel is being promoted and <code>channel_post</code> is specified. Tapping the button must open the particular channel post.</li>
<li><mark><strong>Launch App</strong></mark> — if the <code>app</code> flag is set, the specified <ahref="/api/bots/webapps">Mini App</a> should be opened when clicking on the button. </li>
<li><mark><strong>Open Website</strong></mark> — If the <code>webpage</code> flag is set, clicking on the button should open the external website specified in <code>webpage.url</code>. </li>
<li>The contents of the <code>button_text</code> field — if the <code>button_text</code> field is set.</li>
<p>If the <code>sponsor_info</code> or <code>additional_info</code> flags are set, an additional "Sponsor info" menu item must be present in the message context menu (the menu that pops up when clicking on a button), that when clicked, displays the contents of the flags. </p>
<p>Once the entire text is shown on the screen (excluding the button), <ahref="/method/channels.viewSponsoredMessage">channels.viewSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<h4><aclass="anchor"href="#clicking-on-sponsored-messages"id="clicking-on-sponsored-messages"name="clicking-on-sponsored-messages"><iclass="anchor-icon"></i></a>Clicking on sponsored messages</h4>
<p>If the user either:</p>
<ul>
<li>Clicks on a link in the sponsored message</li>
<li>Opens a sponsored chat or a sponsored website via the associated button</li>
<li>Opens the sponsored chat via the sponsored message name, the sponsored message photo, or a mention in the sponsored message</li>
</ul>
<p><ahref="/method/channels.clickSponsoredMessage">channels.clickSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<p>For the channel <ahref="https://t.me/SecretAdTestChannel">https://t.me/SecretAdTestChannel</a> the system will <strong>always</strong> return a sponsored message: promoting either a channel, a particular message in a channel, or a bot with a start parameter.</p>
<hr>
<h4><aclass="anchor"href="#sponsored-messages-in-third-party-apps"id="sponsored-messages-in-third-party-apps"name="sponsored-messages-in-third-party-apps"><iclass="anchor-icon"></i></a>Sponsored messages in third-party apps</h4>
<p>Telegram continues to grow worldwide, in part thanks to third-party apps using the Telegram API. To cover the increasing costs that come with this growth, Telegram added <ahref="https://promote.telegram.org">sponsored messages</a>– a paid <ahref="https://t.me/durov/172">privacy-friendly way</a> to promote <strong>bots and channels</strong>. </p>
<p>If their app allows its users to <strong>access content from Telegram channels</strong>, third-party developers using the Telegram API are required to support and properly display official sponsored messages in their apps by <strong>January 1, 2022</strong>. Unfortunately, Telegram cannot financially sustain third-party apps that do not display sponsored messages and they will have to be disconnected. </p>
<p>Telegram's API usage will continue to be <strong>free of charge</strong> for all developers. The <ahref="https://core.telegram.org/api/terms#3-advertising-amp-monetization">rules</a> regarding monetization in third-party apps remain the same: developers are allowed to monetize their coding efforts through advertising of their own or other legitimate means, provided that all the methods of monetization used in their apps are prominently mentioned in their app store descriptions.</p></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.