I dont get the Result i expected when i want to get my Telegram Chatbot id

13 Views Asked by At

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
1

There are 1 best solutions below

0
0stone0 On

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>