getUserGiftsПоддерживается
Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
Особенности StaticGram
profile (saved) gifts only; sort_by_price sorts within a page; exclude_from_blockchain = hosted
Параметры
Unique identifier of the user
Pass True to exclude gifts that can be purchased an unlimited number of times
Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
Pass True to exclude unique gifts
Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.
Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
The maximum number of gifts to be returned; 1-100. Defaults to 100.
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/getUserGifts" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789
}'aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)
result = await bot.get_user_gifts(user_id=123456789)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/getUserGifts`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"user_id": 123456789
}),
});
const data = await res.json();Ответ (OwnedGifts)
JSON
{
"ok": true,
"result": {
"total_count": 1,
"gifts": []
}
}