getWebhookInfo
Trả về thông tin webhook.
Giá trị trả về: Nếu thành công, trả về WebhookInfo.
Tham số
Phương thức này không có tham số — chỉ cần gọi nó với token của bot.
Ví dụ request
curl
curl -s "https://api.telegram.org/bot$TOKEN/getWebhookInfo"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/getWebhookInfo", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getWebhookInfo`);
console.log(await res.json());
Hướng dẫn từng bước: Webhook Telegram bot: cài setWebhook, bảo mật bằng secret_token và dùng với n8n
Phương thức liên quan
setWebhookThiết lập webhook.deleteWebhookXóa webhook.getUpdatesNhận các bản cập nhật. Dùng nút 'Bắt đầu' cho long polling.