Use this method to stop a poll which was sent by the bot

POST /stopPoll

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.

Body Required

  • chat_id integer | string Required

    Any of:

    Unique identifier for the target chat or username of the target channel (in the format @channelusername)

    Unique identifier for the target chat or username of the target channel (in the format @channelusername)

  • message_id integer Required

    Identifier of the original message with the poll

  • reply_markup object

    This object represents an inline keyboard that appears right next to the message it belongs to.

    Hide reply_markup attribute Show reply_markup attribute object

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result object Required

      This object contains information about a poll.

      Hide result attributes Show result attributes object
      • id string Required

        Unique poll identifier

      • question string Required

        Poll question, 1-255 characters

      • options array[object] Required

        This object contains information about one answer option in a poll.

        Hide options attributes Show options attributes array[object]
        • text string Required

          Option text, 1-100 characters

        • voter_count integer Required

          Number of users that voted for this option

      • total_voter_count integer Required

        Total number of users that voted in the poll

      • is_closed boolean Required

        True, if the poll is closed

      • is_anonymous boolean Required

        True, if the poll is anonymous

      • type string Required

        Poll type, currently can be “regular” or “quiz”

      • allows_multiple_answers boolean Required

        True, if the poll allows multiple answers

      • correct_option_id integer

        Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.

      • explanation string

        Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters

      • explanation_entities array[object]

        This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

        Hide explanation_entities attributes Show explanation_entities attributes array[object]
        • type string Required

          Type of the entity. Can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)

          Values are mention, hashtag, cashtag, bot_command, url, email, phone_number, bold, italic, underline, strikethrough, code, pre, text_link, or text_mention.

        • offset integer Required

          Offset in UTF-16 code units to the start of the entity

        • length integer Required

          Length of the entity in UTF-16 code units

        • url string

          Optional. For “text_link” only, url that will be opened after user taps on the text

        • user object

          This object represents a Telegram user or bot.

          Hide user attributes Show user attributes object
          • id integer Required

            Unique identifier for this user or bot

          • is_bot boolean Required

            True, if this user is a bot

          • first_name string Required

            User's or bot's first name

          • last_name string

            Optional. User's or bot's last name

          • username string

            Optional. User's or bot's username

          • language_code string

            Optional. IETF language tag of the user's language

          • can_join_groups boolean

            Optional. True, if the bot can be invited to groups. Returned only in getMe.

          • can_read_all_group_messages boolean

            Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

          • supports_inline_queries boolean

            Optional. True, if the bot supports inline queries. Returned only in getMe.

        • language string

          Optional. For “pre” only, the programming language of the entity text

      • open_period integer

        Optional. Amount of time in seconds the poll will be active after creation

      • close_date integer

        Optional. Point in time (Unix timestamp) when the poll will be automatically closed

POST /stopPoll
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/stopPoll \
 -H "Content-Type: application/json" \
 -d '{"chat_id":42,"message_id":42,"reply_markup":{"":[[{}]]}}'
Request example
{
  "chat_id": 42,
  "message_id": 42,
  "reply_markup": {
    "": [
      [
        {}
      ]
    ]
  }
}
Request examples
{
  "chat_id": 42,
  "message_id": 42,
  "reply_markup": {
    "": [
      [
        {}
      ]
    ]
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "id": "string",
    "question": "string",
    "options": [
      {
        "text": "string",
        "voter_count": 42
      }
    ],
    "total_voter_count": 42,
    "is_closed": true,
    "is_anonymous": true,
    "type": "string",
    "allows_multiple_answers": true,
    "correct_option_id": 42,
    "explanation": "string",
    "explanation_entities": [
      {
        "type": "mention",
        "offset": 42,
        "length": 42,
        "url": "string",
        "user": {
          "id": 42,
          "is_bot": true,
          "first_name": "string",
          "last_name": "string",
          "username": "string",
          "language_code": "string",
          "can_join_groups": true,
          "can_read_all_group_messages": true,
          "supports_inline_queries": true
        },
        "language": "string"
      }
    ],
    "open_period": 42,
    "close_date": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "id": "string",
    "question": "string",
    "options": [
      {
        "text": "string",
        "voter_count": 42
      }
    ],
    "total_voter_count": 42,
    "is_closed": true,
    "is_anonymous": true,
    "type": "string",
    "allows_multiple_answers": true,
    "correct_option_id": 42,
    "explanation": "string",
    "explanation_entities": [
      {
        "type": "mention",
        "offset": 42,
        "length": 42,
        "url": "string",
        "user": {
          "id": 42,
          "is_bot": true,
          "first_name": "string",
          "last_name": "string",
          "username": "string",
          "language_code": "string",
          "can_join_groups": true,
          "can_read_all_group_messages": true,
          "supports_inline_queries": true
        },
        "language": "string"
      }
    ],
    "open_period": 42,
    "close_date": 42
  }
}