diff --git a/data/web/corefork.telegram.org/api/bots/webapps.html b/data/web/corefork.telegram.org/api/bots/webapps.html index 537c276b93..5bc7c027c8 100644 --- a/data/web/corefork.telegram.org/api/bots/webapps.html +++ b/data/web/corefork.telegram.org/api/bots/webapps.html @@ -46,7 +46,7 @@
Bots can offer users interactive HTML5 web apps to completely replace any website.
They support seamless authorization, integrated payments via multiple payment providers (with Google Pay and Apple Pay out of the box), delivering tailored push notifications to users, and much more.
-This article offers a client-side overview of the implementation of bot web apps using the MTProto API: see here an overview of the web-app side JS API ».
+This article offers a client-side overview of the implementation of bot web apps using the MTProto API: see here for an overview of the web-app side JS API ».
Both simple and normal web apps can send web events starting with web_app_
; see the web event documentation for the full list of events that can be sent by the web app to the client ».
slug
- Invoice identifier (string)status
- One of the following values (string):paid
– The invoice was paid successfullycancelled
– The user closed this invoice without payingfailed
– The user tried to pay, but the payment was failedpending
– The payment is still processing. The bot will receive a service message about a successful payment when the invoice is successfully paid.paid
– The invoice was paid successfully: the client completed the payment flow » and received a messageActionPaymentSent service message.cancelled
– The user closed this invoice without paying: the user aborted the payment flow », payments.sendPaymentForm was NOT invoked.failed
– The user tried to pay, but the payment failed: the user completed the payment flow » but payments.sendPaymentForm returned an RPC error.pending
– The payment is still processing. The bot will receive a service message about a successful payment when the invoice is successfully paid: the user aborted the payment flow », payments.sendPaymentForm was NOT invoked.start_parameter
should be provided to messages.requestWebView.start_param
, if present.To open them, clients should call messages.requestWebView, and then open a webview using the url
contained in the returned webViewResultUrl.
After loading the webview, until it is closed by a web_app_close event, the user client must invoke messages.prolongWebView every 60 seconds.
+After loading the webview, until it is closed by a web_app_close event, the user client must invoke messages.prolongWebView every 60 seconds: if the method call returns QUERY_ID_INVALID
, the webview must be closed.
The opened URL's fragment parameters already contain basic information about the user and a query_id
parameter, that is exposed by the bot web apps JS library: this query_id
can then be used by the bot to invoke messages.sendWebViewResultMessage, passing an InputBotInlineResult constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user.
Bot web apps can be themed according to the following theme parameters, passed as a JSON object to the theme_params
parameter of the messages.requestSimpleWebView and messages.requestWebView methods.