Use this method to get data for high score tables

POST /getGameHighScores

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. On success, returns an Array of GameHighScore objects.

This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.

Body Required

  • user_id integer Required

    Target user id

  • chat_id integer

    Required if inline_message_id is not specified. Unique identifier for the target chat

  • message_id integer

    Required if inline_message_id is not specified. Identifier of the sent message

  • inline_message_id string

    Required if chat_id and message_id are not specified. Identifier of the inline message

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 array[object] Required

      This object represents one row of the high scores table for a game.

      Hide result attributes Show result attributes array[object]
      • position integer Required

        Position in high score table for the game

      • user object Required

        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.

      • score integer Required

        Score

POST /getGameHighScores
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getGameHighScores \
 -H "Content-Type: application/json" \
 -d '{"user_id":42,"chat_id":42,"message_id":42,"inline_message_id":"string"}'
Request example
{
  "user_id": 42,
  "chat_id": 42,
  "message_id": 42,
  "inline_message_id": "string"
}
Request examples
{
  "user_id": 42,
  "chat_id": 42,
  "message_id": 42,
  "inline_message_id": "string"
}
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": [
    {
      "position": 42,
      "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
      },
      "score": 42
    }
  ]
}
Response examples (200)
{
  "ok": true,
  "result": [
    {
      "position": 42,
      "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
      },
      "score": 42
    }
  ]
}