I'm trying to send 3 files to a chat, bt I'm not even able to send a single file. I tried this code
import requests
url = "https://api.telegram.org/botxxxxxxxxxxxxxxx/sendDocument"
payload = {
"chat_id": "xxxxx",
"document": "/students10.txt",
"caption": "Total students in 10",
}
headers = {
"accept": "application/json",
"User-Agent": "Telegram Bot SDK - (https://github.com/irazasyed/telegram-bot-sdk)",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
but it gives response as
{"ok":false,"error_code":400,"description":"Bad Request: wrong HTTP URL specified"}
I kind of need to send three files students10,students11,students12 but I don't know what to do and along with files a caption as Total students in 10: len of file students10 Total students in 11: len of file students11 Total students in 12: len of file students12