Skip to main content

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

NameTypeRequiredDescription
WriteAllowedboolSet 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.
CompactboolIf 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.
FullscreenboolIf 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.
PeerInputPeerClassyesIf 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.
AppInputBotAppClassyesThe app obtained by invoking messages.getBotApp as specified in the direct Mini App deep link docs.
StartParamstringIf the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param.
ThemeParamsDataJSONTheme parameters »
PlatformstringyesShort name of the application; 0-64 English letters, digits, and underscores

Returns

*WebViewResultURL

Possible errors

CodeTypeDescription
400BOT_APP_BOT_INVALIDThe bot_id passed in the inputBotAppShortName constructor is invalid.
400BOT_APP_INVALIDThe specified bot app is invalid.
400BOT_APP_SHORTNAME_INVALIDThe specified bot app short name is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400THEME_PARAMS_INVALIDThe specified theme_params field is invalid.

References