Telegram Bot API
🌐 한국어

answerShippingQuery

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

배송 쿼리에 응답합니다.

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

매개변수

매개변수타입필수설명
shipping_query_idString예배송 쿼리 ID
okBoolean예배송 가능하면 true
shipping_optionsArray of ShippingOption선택ShippingOption JSON 배열 (ok=true인 경우)
error_messageString선택오류 메시지 (ok=false인 경우)

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

요청 예제

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/answerShippingQuery" \
  -H "Content-Type: application/json" \
  -d '{"shipping_query_id":"SHIPPING_QUERY_ID","ok":true}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/answerShippingQuery",
    json={
        "shipping_query_id": "SHIPPING_QUERY_ID",
        "ok": True
    },
    timeout=30,
)
print(resp.json())

JavaScript

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

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