Telegram Bot API
🌐 Türkçe

answerShippingQuery

Kategori: Ödemeler · Bot API 10.3 · Resmi dokümantasyon

Teslimat sorgusunu yanıtlar.

Dönüş değeri: Başarılı olduğunda True döndürür.

Parametreler

ParametreTürZorunluAçıklama
shipping_query_idStringEvetTeslimat sorgusu ID'si
okBooleanEvetTeslimat mümkünse true
shipping_optionsArray of ShippingOptionİsteğe bağlıJSON ShippingOption dizisi (ok=true ise)
error_messageStringİsteğe bağlıHata mesajı (ok=false ise)

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

Örnek istek

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

Adım adım rehber: Telegram bot nasıl yapılır? BotFather ile adım adım bot oluşturma