skip to Main Content

I Try to get my Chatbot id from my Telegram chatbot.

Normally you should write your API Key inside this URL

https://api.telegram.org/bot<myapikey>/getUpdates

and i should receive something like this:

{
  "ok": true,
  "result": [
    {
      "update_id": 83xxxxx35,
      "message": {
        "message_id": 2643,
        "from": {...},
        "chat": {
          "id": 21xxxxx38,
          "first_name": "...",
          "last_name": "...",
          "username": "@username",
          "type": "private"
        },
        "date": 1703062972,
        "text": "/start"
      }
    }
  ]
}

but when i try to get my id, i recieve this:

{
    "ok": true,
    "result": []
}

someone know what i did maybe wrong, or how i can fix this?

Greetings!

i tried using http instead of https, i also tried to use other links, aswell for different variations of my api key

https://api.telegram.org/bot<myapikey>/getUpdates

2

Answers


  1. An empty result indicates that the Bot has no unprocessed messages.

    You’ll need to start a conversation with our new bot, send him a message, then the result array in the getUpdates call will contain that message.


    aswell for different variations of my api key

    There are no different variantions of your api key, it’s always in the format of:

    https://api.telegram.org/bot<MY-TOKEN>/<METHOD>
    
    Login or Signup to reply.
  2. After adding the bot to the group chat, you need to give the bot admin rights and then get this url to get the group chat id:

    https://api.telegram.org/bot<myapikey>/getUpdates
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search