### Example API Request URL Source: https://core.telegram.org/bots/api This is an example of a GET request URL to the Telegram Bot API for the getMe method. Replace '' with your actual bot token. ```http https://api.telegram.org/bot/METHOD_NAME ``` ```http https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe ``` -------------------------------- ### BusinessIntro Source: https://core.telegram.org/bots/api Contains information about the start page settings of a Telegram Business account. ```APIDOC ## BusinessIntro ### Description Contains information about the start page settings of a Telegram Business account. ### Fields - **title** (String) - Optional. Title text of the business intro. - **message** (String) - Optional. Message text of the business intro. - **sticker** (Sticker) - Optional. Sticker of the business intro. ``` -------------------------------- ### Markdown Code Block Example Source: https://core.telegram.org/bots/api Demonstrates a pre-formatted fixed-width code block using Markdown syntax. For specific languages, use fenced code blocks with the language identifier. ```markdown ```python pre-formatted fixed-width code block written in the Python programming language ``` ``` -------------------------------- ### MarkdownV2 Formatting Example Source: https://core.telegram.org/bots/api Demonstrates various text formatting options available in MarkdownV2, including bold, italic, underline, strikethrough, spoiler, nested entities, inline URLs, and user mentions. Note the specific escaping rules for characters. ```MarkdownV2 *bold \*text* _italic \*text_ __underline__ ~strikethrough~ ||spoiler|| *bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold* [inline URL](http://www.example.com/) [inline mention of a user](tg://user?id=123456789) ![ ``` -------------------------------- ### getFile Source: https://core.telegram.org/bots/api Retrieves basic information about a file and prepares it for downloading. Bots can download files up to 20MB. A File object is returned on success. ```APIDOC ## getFile ### Description Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link `https://api.telegram.org/file/bot/`, where `` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. ### Method POST (assumed, common for methods with parameters) ### Endpoint /getFile ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **file_id** (String) - Required - File identifier to get information about ### Request Example ```json { "file_id": "AgADAgADz6cxG0q4o04d3j_f0w" } ``` ### Response #### Success Response (200) A File object containing information about the file. #### Response Example ```json { "file_id": "file_id_from_response", "file_unique_id": "file_unique_id_from_response", "file_size": 12345, "file_path": "path/to/your/file.jpg" } ``` **Note:** This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received. ``` -------------------------------- ### InputStoryContentVideo Source: https://core.telegram.org/bots/api Describes a video to post as a story. ```APIDOC ## InputStoryContentVideo ### Description Describes a video to post as a story. ### Fields - **type** (String) - Required - Type of the content, must be "video" - **video** (String) - Required - The video to post as a story. The video must be of the size 1080x1920 and must not exceed 10 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the video was uploaded using multipart/form-data under . More information on Sending Files » ``` -------------------------------- ### Get Managed Bot Token Source: https://core.telegram.org/bots/api Retrieves the token of a managed bot. Returns the token as a String on success. ```APIDOC ## Get Managed Bot Token ### Description Use this method to get the token of a managed bot. Returns the token as _String_ on success. ### Parameters #### Path Parameters - **user_id** (Integer) - Yes - User identifier of the managed bot whose token will be returned ``` -------------------------------- ### Get Business Connection Source: https://core.telegram.org/bots/api Retrieves information about the connection of the bot with a business account. Returns a BusinessConnection object on success. ```APIDOC ## Get Business Connection ### Description Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success. ### Parameters #### Path Parameters - **business_connection_id** (String) - Yes - Unique identifier of the business connection ``` -------------------------------- ### __getMe Source: https://core.telegram.org/bots/api A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. ```APIDOC ## __getMe ### Description A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. ### Method GET or POST ### Endpoint /getMe ### Parameters None ### Response #### Success Response (200) - **User object** - Basic information about the bot. ``` -------------------------------- ### getMyShortDescription Source: https://core.telegram.org/bots/api Retrieves the current bot short description for a given user language. Returns the BotShortDescription object on success. ```APIDOC ## getMyShortDescription ### Description Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. ### Method GET ### Endpoint /getMyShortDescription ### Parameters #### Query Parameters - **language_code** (String) - Optional - A two-letter ISO 639-1 language code or an empty string ``` -------------------------------- ### Get Managed Bot Access Settings Source: https://core.telegram.org/bots/api Retrieves the access settings of a managed bot. Returns a BotAccessSettings object on success. ```APIDOC ## Get Managed Bot Access Settings ### Description Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success. ### Parameters #### Path Parameters - **user_id** (Integer) - Yes - User identifier of the managed bot whose access settings will be returned ``` -------------------------------- ### getGameHighScores Source: https://core.telegram.org/bots/api Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. ```APIDOC ## POST /getGameHighScores ### Description Retrieves high score data for a game, including the specified user's score and their neighbors. Returns an array of GameHighScore objects. ### Method POST ### Endpoint /getGameHighScores ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **user_id** (Integer) - Yes - Target user id. - **chat_id** (Integer) - Optional - Required if _inline_message_id_ is not specified. Unique identifier for the target chat. - **message_id** (Integer) - Optional - Required if _inline_message_id_ is not specified. Identifier of the sent message. - **inline_message_id** (String) - Optional - Required if _chat_id_ and _message_id_ are not specified. Identifier of the inline message. ### Request Example ```json { "user_id": 123456789, "chat_id": 987654321, "message_id": 101 } ``` ### Response #### Success Response (200) - **game_high_scores** (Array of GameHighScore) - An array containing GameHighScore objects. #### Response Example ```json { "ok": true, "result": [ { "user": { "id": 123456789, "is_bot": false, "first_name": "John", "last_name": "Doe" }, "score": 100, "position": 1 }, { "user": { "id": 987654321, "is_bot": false, "first_name": "Jane", "last_name": "Smith" }, "score": 90, "position": 2 } ] } ``` ``` -------------------------------- ### WebAppInfo Source: https://core.telegram.org/bots/api Describes a Web App, providing the URL to be opened. ```APIDOC ## WebAppInfo ### Description Describes a Web App, providing the URL to be opened. ### Fields - **url** (String) - An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps. ``` -------------------------------- ### getChatMember Source: https://core.telegram.org/bots/api Fetches information about a specific member within a chat. This method is particularly useful for bots acting as administrators to get details about other users. ```APIDOC ## getChatMember ### Description Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success. ### Method GET (assumed) ### Endpoint /getChatMember ### Parameters #### Query Parameters - **chat_id** (Integer or String) - Yes - Unique identifier for the target chat or username of the target supergroup or channel in the format `@username` - **user_id** (Integer) - Yes - Unique identifier of the target user ``` -------------------------------- ### __InputStoryContentVideo Source: https://core.telegram.org/bots/api Describes a video to post as a story. This includes details about the video file itself and optional parameters for duration, cover frame, and animation status. ```APIDOC ## __InputStoryContentVideo ### Description Describes a video to post as a story. ### Fields - **type** (String) - Required - Type of the content, must be _video_ - **video** (String) - Required - The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://" if the video was uploaded using multipart/form-data under . More information on Sending Files » - **duration** (Float) - Optional - Precise duration of the video in seconds; 0-60 - **cover_frame_timestamp** (Float) - Optional - Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0. - **is_animation** (Boolean) - Optional - Pass _True_ if the video has no sound ``` -------------------------------- ### Get User Chat Boosts Source: https://core.telegram.org/bots/api Retrieves the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object. ```APIDOC ## Get User Chat Boosts ### Description Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object. ### Parameters #### Path Parameters - **chat_id** (Integer or String) - Yes - Unique identifier for the chat or username of the channel in the format `@username` - **user_id** (Integer) - Yes - Unique identifier of the target user ``` -------------------------------- ### Using a Local Bot API Server Source: https://core.telegram.org/bots/api The Bot API server source code is available for local deployment. Running it locally allows for features like unlimited file downloads, larger file uploads (up to 2000 MB), using local file paths, HTTP URLs for webhooks, and setting higher webhook connection limits. ```APIDOC ## Using a Local Bot API Server The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of `https://api.telegram.org`. If you switch to a local Bot API server, your bot will be able to: * Download files without a size limit. * Upload files up to 2000 MB. * Upload files using their local path and the file URI scheme. * Use an HTTP URL for the webhook. * Use any local IP address for the webhook. * Use any port for the webhook. * Set _max_webhook_connections_ up to 100000. * Receive the absolute local path as a value of the _file_path_ field without the need to download the file after a getFile request. ``` -------------------------------- ### Video Object Source: https://core.telegram.org/bots/api Represents a video file, including its identifiers, dimensions, duration, thumbnail, cover, start timestamp, available qualities, filename, MIME type, and file size. ```APIDOC ## Video Object ### Description This object represents a video file. ### Fields - **file_id** (String) - Identifier for this file, which can be used to download or reuse the file. - **file_unique_id** (String) - Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. - **width** (Integer) - Video width as defined by the sender. - **height** (Integer) - Video height as defined by the sender. - **duration** (Integer) - Duration of the video in seconds as defined by the sender. - **thumbnail** (PhotoSize) - Optional. Video thumbnail. - **cover** (Array of PhotoSize) - Optional. Available sizes of the cover of the video in the message. - **start_timestamp** (Integer) - Optional. Timestamp in seconds from which the video will play in the message. - **qualities** (Array of VideoQuality) - Optional. List of available qualities of the video. - **file_name** (String) - Optional. Original filename as defined by the sender. - **mime_type** (String) - Optional. MIME type of the file as defined by the sender. - **file_size** (Integer) - Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. ``` -------------------------------- ### LinkPreviewOptions Source: https://core.telegram.org/bots/api Describes the options used for link preview generation. Allows disabling previews, specifying a URL, and controlling media size and position. ```APIDOC ## LinkPreviewOptions ### Description Describes the options used for link preview generation. Allows disabling previews, specifying a URL, and controlling media size and position. ### Fields - **is_disabled** (Boolean) - Optional. True, if the link preview is disabled. - **url** (String) - Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used. - **prefer_small_media** (Boolean) - Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview. - **prefer_large_media** (Boolean) - Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview. - **show_above_text** (Boolean) - Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text. ``` -------------------------------- ### Getting Updates Source: https://core.telegram.org/bots/api There are two methods for receiving updates: the `getUpdates` method and webhooks. Incoming updates are stored for up to 24 hours. Regardless of the method, updates are received as JSON-serialized Update objects. ```APIDOC ## Getting updates There are two mutually exclusive ways of receiving updates for your bot - the getUpdates method on one hand and webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours. Regardless of which option you choose, you will receive JSON-serialized Update objects as a result. ``` -------------------------------- ### File Source: https://core.telegram.org/bots/api This object represents a file ready to be downloaded. It includes identifiers, size, and path for downloading. ```APIDOC ## File ### Description This object represents a file ready to be downloaded. The file can be downloaded via the link `https://api.telegram.org/file/bot/`. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. The maximum file size to download is 20 MB. ### Fields - **file_id** (String) - Identifier for this file, which can be used to download or reuse the file. - **file_unique_id** (String) - Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. - **file_size** (Integer) - Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. - **file_path** (String) - Optional. File path. Use `https://api.telegram.org/file/bot/` to get the file. ``` -------------------------------- ### PreparedKeyboardButton Source: https://core.telegram.org/bots/api Describes a keyboard button to be used by a user of a Mini App. It contains a unique identifier. ```APIDOC ## PreparedKeyboardButton ### Description Describes a keyboard button to be used by a user of a Mini App. ### Fields - **id** (String) - Unique identifier of the keyboard button. ``` -------------------------------- ### Making Requests When Getting Updates (Webhooks) Source: https://core.telegram.org/bots/api When using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use application/json, application/x-www-form-urlencoded, or multipart/form-data for passing parameters. The method to be invoked is specified in the _method_ parameter. The success or result of such a request cannot be determined. ```APIDOC ## Making requests when getting updates If you're using **webhooks**, you can perform a request to the Bot API while sending an answer to the webhook. Use either _application/json_ or _application/x-www-form-urlencoded_ or _multipart/form-data_ response content type for passing parameters. Specify the method to be invoked in the _method_ parameter of the request. It's not possible to know that such a request was successful or get its result. ``` -------------------------------- ### Making Requests to the Telegram Bot API Source: https://core.telegram.org/bots/api All interactions with the Telegram Bot API are made over HTTPS. Requests are structured as `https://api.telegram.org/bot/METHOD_NAME`. Both GET and POST HTTP methods are supported for passing parameters via URL query string, application/x-www-form-urlencoded, application/json, or multipart/form-data. ```APIDOC ## Making Requests All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: `https://api.telegram.org/bot/METHOD_NAME`. Example: ``` https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe ``` ### HTTP Methods We support **GET** and **POST** HTTP methods. ### Parameter Passing We support four ways of passing parameters in Bot API requests: * URL query string * application/x-www-form-urlencoded * application/json (except for uploading files) * multipart/form-data (use to upload files) ### Response Structure The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals _True_ , the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error. ### General Notes * All methods in the Bot API are case-insensitive. * All queries must be made using UTF-8. ``` -------------------------------- ### MenuButtonCommands Source: https://core.telegram.org/bots/api Represents a menu button, which opens the bot's list of commands. ```APIDOC ## MenuButtonCommands ### Description Represents a menu button, which opens the bot's list of commands. ### Fields - **type** (String) - Type of the button, must be _commands_ ``` -------------------------------- ### BotCommand Source: https://core.telegram.org/bots/api Represents a bot command, including its text and description. ```APIDOC ## BotCommand ### Description This object represents a bot command. ### Fields - **command** (String) - Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. - **description** (String) - Description of the command; 1-256 characters. ``` -------------------------------- ### getMyDescription Source: https://core.telegram.org/bots/api Retrieves the current bot description for a given user language. Returns the BotDescription object on success. ```APIDOC ## getMyDescription ### Description Use this method to get the current bot description for the given user language. Returns BotDescription on success. ### Method GET ### Endpoint /getMyDescription ### Parameters #### Query Parameters - **language_code** (String) - Optional - A two-letter ISO 639-1 language code or an empty string ``` -------------------------------- ### MenuButtonWebApp Source: https://core.telegram.org/bots/api Represents a menu button, which launches a Web App. ```APIDOC ## MenuButtonWebApp ### Description Represents a menu button, which launches a Web App. ### Fields - **type** (String) - Type of the button, must be _web_app_ - **text** (String) - Text on the button - **web_app** (WebAppInfo) - Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a `t.me` link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. ``` -------------------------------- ### savePreparedKeyboardButton Source: https://core.telegram.org/bots/api Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object. ```APIDOC ## savePreparedKeyboardButton ### Description Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object. ### Parameters #### Path Parameters - **user_id** (Integer) - Yes - Unique identifier of the target user that can use the button #### Request Body - **button** (KeyboardButton) - Yes - A JSON-serialized object describing the button to be saved. The button must be of the type _request_users_ , _request_chat_ , or _request_managed_bot_. ``` -------------------------------- ### Set My Commands Source: https://core.telegram.org/bots/api Changes the list of the bot's commands. See this manual for more details about bot commands. Returns _True_ on success. ```APIDOC ## Set My Commands ### Description Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns _True_ on success. ### Parameters #### Path Parameters - **commands** (Array of BotCommand) - Yes - A JSON-serialized list of the bot's commands ``` -------------------------------- ### BotShortDescription Source: https://core.telegram.org/bots/api This object represents the bot's short description. ```APIDOC ## BotShortDescription ### Description This object represents the bot's short description. ### Fields - **short_description** (String) - The bot's short description ``` -------------------------------- ### InputMediaAudio Source: https://core.telegram.org/bots/api Represents an audio file to be treated as music to be sent. Includes options for media, thumbnail, caption, and audio metadata. ```APIDOC ## InputMediaAudio ### Description Represents an audio file to be treated as music to be sent. ### Fields - **type** (String) - Type of the media, must be _audio_. - **media** (String) - File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » - **thumbnail** (String) - _Optional_. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » - **caption** (String) - _Optional_. Caption of the audio to be sent, 0-1024 characters after entities parsing. - **parse_mode** (String) - _Optional_. Mode for parsing entities in the audio caption. See formatting options for more details. - **caption_entities** (Array of MessageEntity) - _Optional_. List of special entities that appear in the caption, which can be specified instead of _parse_mode_. - **duration** (Integer) - _Optional_. Duration of the audio in seconds. - **performer** (String) - _Optional_. Performer of the audio. - **title** (String) - _Optional_. Title of the audio. ``` -------------------------------- ### savePreparedKeyboardButton Source: https://core.telegram.org/bots/api Saves a prepared keyboard button for requesting users, chats, or managed bots from Mini Apps. ```APIDOC ## savePreparedKeyboardButton ### Description This method allows bots to save a prepared keyboard button. This button can be used to request users, chats, and managed bots from Mini Apps. ### Method POST ### Endpoint /savePreparedKeyboardButton ### Parameters #### Query Parameters - **chat_id** (ChatId) - Required - Unique identifier for the target chat or username of the target channel (in the format "@channelusername"). ### Request Body - **prepared_keyboard_button** (PreparedKeyboardButton) - Required - The prepared keyboard button object. ### Request Example { "prepared_keyboard_button": { "type": "request_user", "user_id": 123456789 } } ### Response #### Success Response (200) - **ok** (boolean) - True if the prepared keyboard button was successfully saved. #### Response Example { "ok": true } ``` -------------------------------- ### InputMediaDocument Source: https://core.telegram.org/bots/api Represents a general file to be sent as a document. ```APIDOC ## InputMediaDocument ### Description Represents a general file to be sent. ### Fields - **type** (String) - Required - Type of the media, must be _document_ - **media** (String) - Required - File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » - **thumbnail** (String) - Optional - Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » - **caption** (String) - Optional - Caption of the document to be sent, 0-1024 characters after entities parsing - **parse_mode** (String) - Optional - Mode for parsing entities in the document caption. See formatting options for more details. - **caption_entities** (Array of MessageEntity) - Optional - List of special entities that appear in the caption, which can be specified instead of _parse_mode_ - **disable_content_type_detection** (Boolean) - Optional - Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always _True_ , if the document is sent as part of an album. ``` -------------------------------- ### BusinessConnection Source: https://core.telegram.org/bots/api Describes the connection of the bot with a business account, including connection ID, user details, establishment date, bot rights, and status. ```APIDOC ## BusinessConnection ### Description Describes the connection of the bot with a business account. ### Fields - **id** (String) - Unique identifier of the business connection - **user** (User) - Business account user that created the business connection - **user_chat_id** (Integer) - Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. - **date** (Integer) - Date the connection was established in Unix time - **rights** (BusinessBotRights) - Optional. Rights of the business bot - **is_enabled** (Boolean) - True, if the connection is active ``` -------------------------------- ### BackgroundTypeWallpaper Source: https://core.telegram.org/bots/api The background is a wallpaper in the JPEG format. ```APIDOC ## BackgroundTypeWallpaper The background is a wallpaper in the JPEG format. ### Field * **type** (String) - Type of the background, always “wallpaper” * **document** (Document) - Document with the wallpaper * **dark_theme_dimming** (Integer) - Dimming of the background in dark themes, as a percentage; 0-100 * **is_blurred** (True) - Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 * **is_moving** (True) - Optional. True, if the background moves slightly when the device is tilted ``` -------------------------------- ### SuggestedPostParameters Source: https://core.telegram.org/bots/api Contains parameters of a post that is being suggested by the bot, including price and send date. ```APIDOC ## SuggestedPostParameters ### Description Contains parameters of a post that is being suggested by the bot, including price and send date. ### Fields - **price** (SuggestedPostPrice) - Optional. Proposed price for the post. If the field is omitted, then the post is unpaid. - **send_date** (Integer) - Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. ``` -------------------------------- ### Answer Callback Query Source: https://core.telegram.org/bots/api Sends answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification or an alert, or redirect to a game URL. ```APIDOC ## Answer Callback Query ### Description Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, _True_ is returned. > Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like `t.me/your_bot?start=XXXX` that open your bot with a parameter. ### Parameters #### Path Parameters - **callback_query_id** (String) - Yes - Unique identifier for the query to be answered - **text** (String) - Optional - Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters. - **show_alert** (Boolean) - Optional - If _True_ , an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to _false_. - **url** (String) - Optional - URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a _callback_game_ button. Otherwise, you may use links like `t.me/your_bot?start=XXXX` that open your bot with a parameter. - **cache_time** (Integer) - Optional - The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. ``` -------------------------------- ### PreCheckoutQuery Object Source: https://core.telegram.org/bots/api Holds information about an incoming pre-checkout query, detailing the query ID, user, currency, total amount, invoice payload, and optional shipping option or order info. ```APIDOC ## PreCheckoutQuery Object This object contains information about an incoming pre-checkout query. ### Fields * **id** (String) - Unique query identifier * **from** (User) - User who sent the query * **currency** (String) - Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars * **total_amount** (Integer) - Total price in the _smallest units_ of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the _exp_ parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). * **invoice_payload** (String) - Bot-specified invoice payload * **shipping_option_id** (String) - _Optional_. Identifier of the shipping option chosen by the user * **order_info** (OrderInfo) - _Optional_. Order information provided by the user ``` -------------------------------- ### getMyCommands Source: https://core.telegram.org/bots/api Retrieves the current list of bot commands for a specified scope and language. Returns an empty list if no commands are set. ```APIDOC ## getMyCommands ### Description Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned. ### Method GET ### Endpoint /getMyCommands ### Parameters #### Query Parameters - **scope** (BotCommandScope) - Optional - A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. - **language_code** (String) - Optional - A two-letter ISO 639-1 language code or an empty string ``` -------------------------------- ### answerPreCheckoutQuery Source: https://core.telegram.org/bots/api Responds to pre-checkout queries after a user has confirmed their payment and shipping details. ```APIDOC ## answerPreCheckoutQuery ### Description Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field _pre_checkout_query_. Use this method to respond to such pre-checkout queries. On success, _True_ is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. ### Method Not specified (assumed to be an SDK method or internal API call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **pre_checkout_query_id** (String) - Yes - Unique identifier for the query to be answered - **ok** (Boolean) - Yes - Specify _True_ if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use _False_ if there are any problems. ``` -------------------------------- ### createNewStickerSet Source: https://core.telegram.org/bots/api Creates a new sticker set owned by a user, allowing the bot to manage it. This method initializes a new collection of stickers. ```APIDOC ## createNewStickerSet ### Description Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns _True_ on success. ### Method POST (assumed, not specified) ### Endpoint (Not specified, typically related to the bot token) ### Parameters #### Request Body - **user_id** (Integer) - Required - User identifier of created sticker set owner - **name** (String) - Required - Short name of sticker set, to be used in `t.me/addstickers/` URLs (e.g., _animals_). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in `"_by_"`. `` is case insensitive. 1-64 characters. - **title** (String) - Required - Sticker set title, 1-64 characters - **stickers** (Array of InputSticker) - Required - A JSON-serialized list of 1-50 initial stickers to be added to the sticker set - **sticker_type** (String) - Optional - Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created. - **needs_repainting** (Boolean) - Optional - Pass _True_ if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only ``` -------------------------------- ### setMyShortDescription Source: https://core.telegram.org/bots/api Changes the bot's short description, displayed on its profile and when shared. Supports language-specific settings. ```APIDOC ## setMyShortDescription ### Description Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns _True_ on success. ### Method POST ### Endpoint /setMyShortDescription ### Parameters #### Request Body - **short_description** (String) - Optional - New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. - **language_code** (String) - Optional - A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description. ``` -------------------------------- ### ReplyKeyboardMarkup Source: https://core.telegram.org/bots/api Represents a custom keyboard with reply options. This object is used to create interactive keyboards that can be displayed to users in chats, offering predefined responses or actions. ```APIDOC ## ReplyKeyboardMarkup ### Description This object represents a custom keyboard with reply options. Not supported in channels and for messages sent on behalf of a business account. ### Fields - **keyboard** (Array of Array of KeyboardButton) - Array of button rows, each represented by an Array of KeyboardButton objects. - **is_persistent** (Boolean) - _Optional_. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to _false_. - **resize_keyboard** (Boolean) - _Optional_. Requests clients to resize the keyboard vertically for optimal fit. Defaults to _false_. - **one_time_keyboard** (Boolean) - _Optional_. Requests clients to hide the keyboard as soon as it's been used. Defaults to _false_. - **input_field_placeholder** (String) - _Optional_. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters. - **selective** (Boolean) - _Optional_. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the _text_ of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. ### Example A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. ``` -------------------------------- ### sendInvoice Source: https://core.telegram.org/bots/api Use this method to send invoices to users. It allows specifying product details, pricing, and optional information like suggested tip amounts and user data. ```APIDOC ## sendInvoice ### Description Use this method to send invoices. On success, the sent Message is returned. ### Method POST ### Endpoint /bot/sendInvoice ### Parameters #### Path Parameters - **token** (string) - Yes - Authorization token for the bot. #### Query Parameters - **chat_id** (Integer or String) - Yes - Unique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`. - **message_thread_id** (Integer) - Optional - Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only. - **direct_messages_topic_id** (Integer) - Optional - Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat. - **title** (String) - Yes - Product name, 1-32 characters. - **description** (String) - Yes - Product description, 1-255 characters. - **payload** (String) - Yes - Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. - **provider_token** (String) - Optional - Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. - **currency** (String) - Yes - Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. - **prices** (Array of LabeledPrice) - Yes - Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. - **max_tip_amount** (Integer) - Optional - The maximum accepted amount for tips in the _smallest units_ of the currency (integer, **not** float/double). For example, for a maximum tip of `US$ 1.45` pass `max_tip_amount = 145`. See the _exp_ parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. - **suggested_tip_amounts** (Array of Integer) - Optional - A JSON-serialized array of suggested amounts of tip in the _smallest units_ of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed _max_tip_amount_. - **provider_data** (String) - Optional - A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. - **photo_url** (String) - Optional - URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. - **photo_size** (Integer) - Optional - Photo size in bytes. - **photo_width** (Integer) - Optional - Photo width. - **photo_height** (Integer) - Optional - Photo height. - **need_name** (Boolean) - Optional - Pass _True_ if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. - **need_phone_number** (Boolean) - Optional - Pass _True_ if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. - **need_email** (Boolean) - Optional - Pass _True_ if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. - **need_shipping_address** (Boolean) - Optional - Pass _True_ if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. - **send_phone_number_to_provider** (Boolean) - Optional - Pass _True_ if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. - **send_email_to_provider** (Boolean) - Optional - Pass _True_ if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. - **is_flexible** (Boolean) - Optional - Pass _True_ if the final price depends on the shipping method. Ignored for payments in Telegram Stars. ### Request Example ```json { "chat_id": 123456789, "title": "Example Product", "description": "This is a sample product for testing.", "payload": "product_123", "currency": "USD", "prices": [ { "label": "Product Price", "amount": 1000 } ], "max_tip_amount": 200, "suggested_tip_amounts": [50, 100, 150] } ``` ### Response #### Success Response (200) - **result** (Message) - The sent Message object. #### Response Example ```json { "ok": true, "result": { "message_id": 100, "chat": { "id": 123456789, "first_name": "Example", "type": "private" }, "date": 1678886400, "text": "Invoice for Example Product" } } ``` ```