Telegram Bot API
🌐 Türkçe

getUpdates

Kategori: Güncellemeler · Bot API 10.3 · Resmi dokümantasyon

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

ParametreTürZorunluAçıklama
offsetIntegerİsteğe bağlıSonraki istek için ofset
limitIntegerİsteğe bağlıMaks. sayı (1-100)
timeoutIntegerİsteğe bağlıZaman aşımı (saniye)
allowed_updatesArray of Stringİsteğe bağlıTürlerin JSON dizisi

Parametre açıklamaları kısa özetlerdir; tam metin için resmi dokümantasyona bakın.

Ö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