Telegram Bot Chat ID Empty Response (Quick Fix)
If your Telegram bot returns {“ok”:true,”result”:[]}, it means no messages have been received yet. Send a message to your bot and call the getUpdates API again to get your chat ID.
What is a Telegram Bot Chat ID?
A Telegram Bot Chat ID is a unique numeric identifier assigned to a user, group, or channel. It is required when sending messages using the Telegram Bot API, as it tells the bot exactly where to deliver the message.
This behavior is expected as per the Telegram Bot API, which only returns updates after a user interacts with the bot.
When does Telegram return {“ok”:true,”result”:[]}?
This typically happens in the following situations:
- Your bot has not received any messages yet
- You are using a newly created bot from BotFather
- You haven’t started the bot or sent a message to it
- Updates were already fetched earlier and no new messages exist
Quick Fix (Telegram Bot Chat ID Empty Response)
If getUpdates returns {“ok”:true,”result”:[]}, your bot has not received any messages yet.
- Open Telegram
- Search your bot
- Send a message (e.g. “Hi”)
- Open this URL:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
👉 You will now see your chat ID:
“chat”:{“id”:123456789}
💡 This is the most common reason developers get stuck – but the fix is instant once you know it.
Prerequisites
Before we dive into the solution, make sure you’ve taken care of these prerequisites:
- Created a Telegram Bot
You need a Telegram bot to interact with. If you haven’t created one yet, here’s how:- Start a chat with BotFather.
- Create your bot by following the steps provided by BotFather.
- Once created, you’ll get a token. Keep it handy—you’re going to need it.
- Added the Bot to Your Telegram Group (Optional)
If you’re trying to get the chat ID of a group, add your bot to that group and give it permissions to send messages.
Why We Were Seeing { "ok": true, "result": [] }
If you’re like me, the first time you tried to fetch data using the Telegram Bot API, you probably tried this:
https://api.telegram.org/bot<Your-Bot-Token>/getUpdates
But instead of the useful chat ID or a list of updates, you saw this:
{"ok":true,"result":[]}
This empty result simply means that your bot doesn’t have any messages waiting for it to respond to or, more likely, you’re not getting the right chat ID. Telegram’s API doesn’t just give you the chat ID by default—it requires you to have some interaction with the bot first.
So, How Did I Solve This?
I was stuck with the same error for a while, but eventually, the solution clicked. Here’s what I did:
1. Start a Conversation with Your Bot
This step is crucial! Without a message interaction, Telegram doesn’t know where to send the message. So, I sent a simple “Hi” to my bot. You can do this by simply opening the bot in Telegram and typing anything.
2. Use the getUpdates API Again
Once you’ve sent a message to the bot, go back and use the getUpdates API endpoint once more. You should now see a response with your chat ID!
Example URL to call:
https://api.telegram.org/bot<Your-Bot-Token>/getUpdates
The response will now look something like this:
{
"ok": true,
"result": [
{
"update_id": 123456789,
"message": {
"message_id": 1,
"from": {
"id": 987654321,
"first_name": "Your Name",
"last_name": "Your Last Name",
"username": "YourUsername",
"language_code": "en"
},
"chat": {
"id": 123456789, // <-- This is the chat ID!
"first_name": "Your Name",
"last_name": "Your Last Name",
"username": "YourUsername",
"type": "private"
},
"date": 1624048700,
"text": "Hi"
}
}
]
}
The key part here is the "chat": { "id": 123456789 }. That’s your chat ID!
3. Use the Chat ID in Your Bot
Now that you have the chat ID, you can send messages to your bot via the API:
https://api.telegram.org/bot<Your-Bot-Token>/sendMessage?chat_id=123456789&text=Your%20message%20here
If getUpdates Still Returns an Empty Result
If you’re still not seeing your chat ID, make sure:
- You haven’t sent a message after creating the bot
- You’re checking updates from the wrong bot token
- Bot privacy mode is enabled (group chats)
- Updates were already consumed by another request
Still Getting Empty Response?
Try this:
- Send /start to your bot
- Double-check bot token
- Wait 5–10 seconds before retry
- Disable privacy mode (for groups)
Final Thoughts
This process isn’t mentioned explicitly in the official Telegram documentation, which is why many of us end up feeling stuck. But by simply starting a conversation with your bot, we were able to get our chat ID and move forward with sending messages programmatically.
If you’re still encountering issues or need further assistance, feel free to leave a comment below. I hope this solution saves you the hours I spent trying to figure it out. Enjoy building your Telegram bot!
FAQs
Why does Telegram return {“ok”:true,”result”:[]}?
Because your bot hasn’t received any messages yet, so there are no updates to return.
How do I get my Telegram bot chat ID?
Send a message to your bot, then call the getUpdates API to retrieve your chat ID.
Why is my Telegram bot not returning updates?
Either no messages were sent, or updates were already consumed by another request.
Does this work for group chat IDs?
Yes, but ensure your bot is added to the group and privacy mode is disabled.
Why does getUpdates return empty even after sending a message?
If your bot has privacy mode enabled, it won’t receive messages in groups unless directly mentioned. Disable privacy mode via BotFather to fix this.
