Telegram Bot API
🌐 한국어

upgradeGift

카테고리: 결제 · Bot API 10.3 · 공식 문서

일반 선물을 고유 선물로 업그레이드합니다.

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

매개변수

매개변수타입필수설명
business_connection_idString예비즈니스 연결 ID
owned_gift_idString예보유 선물 ID
keep_original_detailsBoolean선택원래 선물 텍스트, 발신자, 수신자 유지
star_countInteger선택비즈니스 계정 잔액에서 업그레이드 비용으로 지불할 Stars (선불이면 0)

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

요청 예제

curl

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

Python

import requests

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

JavaScript

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

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