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.

Parameters:

NameTypeDescriptionRequired
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 for the web appOptional
platformstringYes
reply_to_msg_idintWhether 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 in reply to this message ID.Optional
top_msg_idintOptional
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('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

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

// PHP 8+ syntax, use an array on PHP 7.
$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_msg_id: int, top_msg_id: int, send_as: InputPeer, );