Link Search Menu Expand Document

Method: messages.requestWebView

Back to methods index

Open a bot web app, 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.


from_bot_menuBoolWhether the webview was opened by clicking on the bot’s menu button ».Optional
silentBoolWhether the inline message that will be sent by the bot on behalf of the user once the web app interaction is terminated should be sent silently (no notifications for the receivers).Optional
peerUsername, chat ID, Update, Message or InputPeerDialog where the web app is being opened, and where the resulting message will be sent (see the docs for more info »).Optional
botUsername, chat ID, Update, Message or InputUserBot that owns the web appOptional
urlstringWeb app URLOptional
start_paramstringIf the web app was opened from the attachment menu using a attachment menu deep link, start_param should contain the data from the startattach parameter.Optional
theme_paramsDataJSONTheme parameters »Optional
platformstringShort name of the application; 0-64 English letters, digits, and underscoresOptional
send_asUsername, chat ID, Update, Message or InputPeerOpen the web app as the specified peer, sending the resulting the message as the specified peer.Optional

Return type: WebViewResult

Can bots use this method: NO

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

if (!file_exists('madeline.php')) {
    copy('', 'madeline.php');
include 'madeline.php';

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

$WebViewResult = $MadelineProto->messages->requestWebView(from_bot_menu: $Bool, silent: $Bool, peer: $InputPeer, bot: $InputUser, url: 'string', start_param: 'string', theme_params: $DataJSON, platform: 'string', reply_to: $InputReplyTo, send_as: $InputPeer, );