deleteWebhook
Xóa webhook.
Giá trị trả về: Nếu thành công, trả về True.
Tham số
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
drop_pending_updates | Boolean | Tùy chọn | Bỏ qua các cập nhật đang chờ |
Ví dụ request
curl
curl -s "https://api.telegram.org/bot$TOKEN/deleteWebhook"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/deleteWebhook", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/deleteWebhook`);
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
getWebhookInfoTrả về thông tin webhook.setWebhookThiết lập webhook.getUpdatesNhận các bản cập nhật. Dùng nút 'Bắt đầu' cho long polling.