Telegram Bot API
🌐 한국어

getBusinessAccountGifts

카테고리: 비즈니스 · Bot API 10.3 · 공식 문서

비즈니스 계정의 선물을 반환합니다.

반환값: 성공 시 반환값: OwnedGifts.

매개변수

매개변수타입필수설명
business_connection_idString예비즈니스 연결 ID
exclude_unsavedBoolean선택프로필 페이지에 저장되지 않은 선물 제외
exclude_savedBoolean선택프로필 페이지에 저장된 선물 제외
exclude_unlimitedBoolean선택무제한 구매 가능한 선물 제외
exclude_limited_upgradableBoolean선택고유 선물로 업그레이드 가능한 한정 선물 제외
exclude_limited_non_upgradableBoolean선택고유 선물로 업그레이드할 수 없는 한정 선물 제외
exclude_uniqueBoolean선택고유 선물 제외
exclude_from_blockchainBoolean선택TON 블록체인에서 할당된 선물 제외
sort_by_priceBoolean선택전송 날짜 대신 선물 가격순 정렬
offsetString선택페이지네이션 오프셋
limitInteger선택개수 (1-100)

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

요청 예제

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/getBusinessAccountGifts" \
  -H "Content-Type: application/json" \
  -d '{"business_connection_id":"BUSINESS_CONNECTION_ID"}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/getBusinessAccountGifts",
    json={
        "business_connection_id": "BUSINESS_CONNECTION_ID"
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getBusinessAccountGifts`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "business_connection_id": "BUSINESS_CONNECTION_ID"
  }),
});
console.log(await res.json());

단계별 가이드: 텔레그램 봇 만들기: @BotFather로 생성하고 첫 메시지 보내기