messages.requestAppWebView
Open a bot mini app from a direct Mini App deep link, 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.
func (c *Client) MessagesRequestAppWebView(ctx context.Context, request *MessagesRequestAppWebViewRequest) (*WebViewResultURL, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesRequestAppWebView(ctx, &tg.MessagesRequestAppWebViewRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *WebViewResultURL
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
WriteAllowed | bool | — | 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 | bool | — | 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 | bool | — | 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 | InputPeerClass | yes | 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 | InputBotAppClass | yes | The app obtained by invoking messages.getBotApp as specified in the direct Mini App deep link docs. |
StartParam | string | — | If the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param. |
ThemeParams | DataJSON | — | Theme parameters » |
Platform | string | yes | Short name of the application; 0-64 English letters, digits, and underscores |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_APP_BOT_INVALID | The bot_id passed in the inputBotAppShortName 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. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.requestAppWebView#53618bce