Telegram Bot API
🌐 한국어

getUpdates

카테고리: 업데이트 · Bot API 10.3 · 공식 문서

업데이트를 가져옵니다. Long Polling에는 '시작' 버튼을 사용하십시오.

반환값: 성공 시 반환값: Array of Update.

매개변수

매개변수타입필수설명
offsetInteger선택다음 요청용 오프셋
limitInteger선택최대 개수 (1-100)
timeoutInteger선택타임아웃(초)
allowed_updatesArray of String선택유형 JSON 배열

매개변수 설명은 핵심만 간추린 요약입니다. 전체 설명은 공식 문서에서 확인할 수 있습니다.

요청 예제

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());

단계별 가이드: 텔레그램 chat id 확인방법: 개인, 그룹, 채널, 토픽별 chat id 찾기