v3

latestOpenAPI 3.1.02026-08-01264769.0 KB
Bot

Get a chat

Returns current information about a private conversation or chat, including its latest message when available. Supply exactly one of user_id or chat_id.

get/bot{token}/getChat

Path parameters

tokenstring required

Required bot token included in the URL path.

Query parameters

user_idstring

A positive decimal Inline user identifier

Example:123456789

Target a private conversation with this user. Supply exactly one of user_id or chat_id.

chat_idstring

A positive decimal Inline chat identifier

Example:123456789

Target this chat. Supply exactly one of chat_id or user_id.

Headers

authorizationstring

Optional bot token using the Bearer scheme. When supplied, it takes precedence over the token in the URL.

Response

Successful getChat response.

oktrue required

Always true for a successful request.

Example response

{
  "ok": true,
  "result": {
    "chat": {
      "chat_id": 73142,
      "title": "Product",
      "space_id": 912,
      "is_public": false,
      "last_message_id": 1807,
      "last_message": {
        "message_id": 1807,
        "from_id": 391204,
        "from": {
          "id": 391204,
          "is_bot": false,
          "username": "maya",
          "first_name": "Maya",
          "last_name": "Chen"
        },
        "date": 1784332800,
        "text": "Can you deploy the latest build?"
      },
      "emoji": "🚀"
    }
  }
}