Link Search Menu Expand Document

Method: messages.requestAppWebView

Back to methods index

Open a bot mini app from a direct Mini App deep link, sending over user information after user confirmation.

After calling this method, until the user closes the webview, messages.prolongWebView must be called every 60 seconds.

Parameters:

NameTypeDescriptionRequired
write_allowedBoolSet this flag if the bot is asking permission to send messages to the user as specified in the direct Mini App deep link docs, and the user agreed.Optional
compactBoolIf set, requests to open the mini app in compact mode (as opposed to normal or fullscreen mode). Must be set if the mode parameter of the direct Mini App deep link is equal to compact.Optional
fullscreenBoolIf set, requests to open the mini app in fullscreen mode (as opposed to compact or normal mode). Must be set if the mode parameter of the direct Mini App deep link is equal to fullscreen.Optional
peerUsername, chat ID, Update, Message or InputPeerIf the client has clicked on the link in a Telegram chat, pass the chat’s peer information; otherwise pass the bot’s peer information, instead.Optional
appInputBotAppThe app obtained by invoking messages.getBotApp as specified in the direct Mini App deep link docs.Yes
start_paramstringIf the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param.Optional
theme_paramsDataJSONTheme parameters »Optional
platformstringShort name of the application; 0-64 English letters, digits, and underscoresOptional

Return type: WebViewResult

Can userbots use this method: YES

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$WebViewResult = $MadelineProto->messages->requestAppWebView(write_allowed: $Bool, compact: $Bool, fullscreen: $Bool, peer: $InputPeer, app: $InputBotApp, start_param: 'string', theme_params: $DataJSON, platform: 'string', );