Telegram Bot gets "Bad Request: message text is empty"

Kryvich picture Kryvich · Feb 14, 2018 · Viewed 10.5k times · Source

When my Telegram bot sends sendMessage to Telegram server it gets the error message:

{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"}

The problem appeared this morning, before that my bot worked a whole year without errors. GetUpdates command works well as before. I use GET HTTP method to send commads:

https://api.telegram.org/bot<MyToken>/sendMessage

with UTF-8-encoded data attached:

{"chat_id":123456789,"text":"any text"}

Has anyone encountered this?

Answer

Drey picture Drey · Dec 26, 2018

If the issue still persists, try to modify your curl request. For me adding header 'Content-Type: application/json' and -d '{"chat_id":12309832,"text":"any text"}' fixed issue