Telegram Bot API

Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.

post/sendGift

Request

  • Base URL: https://api.telegram.org/bot<bot_token>
  • URL: https://api.telegram.org/bot<bot_token>/sendGift
  • Auth: none declared

Request body

user_idinteger

Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.

gift_idstring required

Identifier of the gift; limited gifts can't be sent to channel chats

pay_for_upgradeboolean

Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver

textstring

Text that will be shown along with the gift; 0-128 characters

text_parse_modestring

Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.

Response

Telegram API response

oktrue required
resulttrue required

Changes

    • info

      added the new optional request property /////// (media type: application/json)

    • info

      added the new optional request property /////// (media type: application/x-www-form-urlencoded)