I need to send txt File using TelegramBot API .
I already tried https://api.telegram.org/botMYT0KEN/sendDocument?chat_id=569502265&document=/Users/users/Desktop/file.txt
and have issue :
{“ok”:false,”error_code”:400,”description”:”Bad Request: wrong remote
file id specified: Wrong string length”}
3
Answers
From Telegram official documentation
https://core.telegram.org/bots/api
This is what you need from your question:
To complete Donny’s answer, I would like to add an example of sending
.txt
file as a document.Looks like you’re using OS X as an operating system, which has
curl
utility preinstalled.Open terminal and make a request like this:
You have to use the POST method instead GET. For example, I use https://github.com/php-curl-class/php-curl-class