Telegram Bot API
🌐 Türkçe

getUserGifts

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

Kullanıcının hediyelerini döndürür.

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

Parametreler

ParametreTürZorunluAçıklama
user_idIntegerEvetKullanıcı ID'si
exclude_unlimitedBooleanİsteğe bağlıSınırsız sayıda satın alınabilen hediyeleri hariç tut
exclude_limited_upgradableBooleanİsteğe bağlıBenzersize yükseltilebilen sınırlı hediyeleri hariç tut
exclude_limited_non_upgradableBooleanİsteğe bağlıBenzersize yükseltilemeyen sınırlı hediyeleri hariç tut
exclude_from_blockchainBooleanİsteğe bağlıTON blokzincirinden atanan hediyeleri hariç tut
exclude_uniqueBooleanİsteğe bağlıBenzersiz hediyeleri hariç tut
sort_by_priceBooleanİsteğe bağlıGönderim tarihi yerine hediye fiyatına göre sırala
offsetStringİsteğe bağlıSayfalama ofseti
limitIntegerİsteğe bağlıSayı (1-100)

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/getUserGifts" \
  -H "Content-Type: application/json" \
  -d '{"user_id":123456789}'

Python

import requests

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

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getUserGifts`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "user_id": 123456789
  }),
});
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