Layer 220
MessagesRequestAppWebView
Open a bot mini app from a direct Mini App deep link, sending over user information after user confirmation.
method
Users
messages.requestAppWebView#53618bce flags:# write_allowed:flags.0?true compact:flags.7?true fullscreen:flags.8?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = WebViewResult;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| WriteAllowed | flags.0?true | Set 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. |
| Compact | flags.7?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 direct Mini App deep link is equal to compact. |
| Fullscreen | flags.8?true | If 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. |
| Peer | InputPeer | If 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. |
| App | InputBotApp | The app obtained by invoking messages. get Bot App as specified in the direct Mini App deep link docs. |
| StartParam | flags.1?string | If the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param. |
| ThemeParams | flags.2?DataJSON | Theme parameters |
| Platform | string | Short name of the application; 0-64 English letters, digits, and underscores |
Returns
WebViewResultPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_APP_BOT_INVALID | The bot_id passed in the input Bot App Short Name constructor is invalid. |
| 400 | BOT_APP_INVALID | The specified bot app is invalid. |
| 400 | BOT_APP_SHORTNAME_INVALID | The specified bot app short name is invalid. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | THEME_PARAMS_INVALID | The specified theme_params field is invalid. |
Gogram Example
// MessagesRequestAppWebView - using Params struct result, err := client.MessagesRequestAppWebView(&tg.MessagesRequestAppWebViewParams{ Peer: &tg.InputPeerUser{UserID: int64(123456789)}, App: &tg.InputBotApp{}, Platform: "...", // Optional fields: // WriteAllowed: true, // Compact: true, // Fullscreen: true, // StartParam: "...", // ... }) if err != nil { // handle error } // result is *tg.WebViewResult