telegram api method · layer 229 · #269dc2c1
messages.requestWebView
Open a bot mini app, sending over user information after user confirmation.
definition
messages.requestWebView#269dc2c1 flags:# from_bot_menu:flags.4?true silent:flags.5?true compact:flags.7?true fullscreen:flags.8?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = WebViewResult;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
from_bot_menu | true | Whether the webview was opened by clicking on the bot's menu button ». |
silent | true | Whether 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). |
compact | true | If 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 attachment menu deep link is equal to compact. |
fullscreen | true | If set, requests to open the mini app in fullscreen mode (as opposed to normal or compact mode). Must be set if the mode parameter of the attachment menu deep link is equal to fullscreen. |
peer | InputPeer | Dialog where the web app is being opened, and where the resulting message will be sent (see the docs for more info »). |
bot | InputUser | Bot that owns the web app |
url | string | Web app URL |
start_param | string | If 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. |
theme_params | DataJSON | Theme parameters » |
platform | string | Short name of the application; 0-64 English letters, digits, and underscores |
reply_to | InputReplyTo | If set, indicates that 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 the specified message or story. |
send_as | InputPeer | Open the web app as the specified peer, sending the resulting the message as the specified peer. |
returns
errors (13)
| code | error | description |
|---|---|---|
| 400 | BOT_INVALID | This is not a valid bot. |
| 400 | BOT_WEBVIEW_DISABLED | A webview cannot be opened in the specified conditions: emitted for example if from_bot_menu or url are set and peer is not the chat with the bot. |
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 400 | INPUT_USER_DEACTIVATED | The specified user was deleted. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | SEND_AS_PEER_INVALID | You can't send messages as the specified peer. |
| 400 | THEME_PARAMS_INVALID | The specified theme_params field is invalid. |
| 400 | URL_INVALID | Invalid URL provided. |
| 400 | YOU_BLOCKED_USER | You blocked this user. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 403 | CHAT_WRITE_FORBIDDEN | You can't write in this chat. |
| 403 | PRIVACY_PREMIUM_REQUIRED | You need a Telegram Premium subscription to send a message to this user. |
history
present in layers 140–229 · constructor id changed 4×
| id | layers |
|---|---|
| #0fa04dff | 140–142 |
| #91b15831 | 143–144 |
| #fc87a53c | 145–147 |
| #178b480b | 148–159 |
| #269dc2c1 | 160–229 |