getUpdates
Güncellemeleri alır. 'Başlat' düğmesini long polling için kullanın.
Dönüş değeri: Başarılı olduğunda Array of Update döndürür.
Parametreler
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
offset | Integer | İsteğe bağlı | Sonraki istek için ofset |
limit | Integer | İsteğe bağlı | Maks. sayı (1-100) |
timeout | Integer | İsteğe bağlı | Zaman aşımı (saniye) |
allowed_updates | Array of String | İsteğe bağlı | Türlerin JSON dizisi |
Örnek istek
curl
curl -s "https://api.telegram.org/bot$TOKEN/getUpdates"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/getUpdates", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getUpdates`);
console.log(await res.json());
Adım adım rehber: Telegram chat ID nasıl bulunur: kullanıcı, grup, kanal ve konu için adım adım
İlgili metotlar
getWebhookInfoWebhook bilgilerini döndürür.setWebhookWebhook ayarlar.deleteWebhookWebhook'u siler.