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 »Optional
platformstringShort name of the application; 0-64 English letters, digits, and underscoresYes
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_idintThis field must contain the topic ID only when replying to messages in forum topics different from the “General” topic (i.e. reply_to_msg_id is set and reply_to_msg_id != topicID and topicID != 1).
If the replied-to message is deleted before the method finishes execution, the value in this field will be used to send the message to the correct topic, instead of the “General” topic.
Optional
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();

$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, );