getBusinessAccountGifts

Raw MD
Returns the gifts received and owned by a managed business account

Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.

Parameters

ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
exclude_unsavedBooleanOptionalPass True to exclude gifts that aren't saved to the account's profile page
exclude_savedBooleanOptionalPass True to exclude gifts that are saved to the account's profile page
exclude_unlimitedBooleanOptionalPass True to exclude gifts that can be purchased an unlimited number of times
exclude_limited_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
exclude_limited_non_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
exclude_uniqueBooleanOptionalPass True to exclude unique gifts
exclude_from_blockchainBooleanOptionalPass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
sort_by_priceBooleanOptionalPass True to sort results by gift price instead of send date. Sorting is applied before pagination.
offsetStringOptionalOffset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
limitIntegerOptionalThe maximum number of gifts to be returned; 1-100. Defaults to 100.

Example

PHP — Call getBusinessAccountGifts on Botlify Cloud
<?php
// ── Botlify Cloud .env — auto-injected, never hardcode secrets ──
$BOT_TOKEN     = getenv('BOT_TOKEN');     // Telegram bot token from @BotFather
$ADMIN_CHAT_ID = getenv('ADMIN_CHAT_ID'); // Your numeric admin Telegram user ID
$BOT_USERNAME  = getenv('BOT_USERNAME');  // Bot username without @

$resp = bot('getBusinessAccountGifts', [
    'business_connection_id' => $userId,
]);

if ($resp['ok'] ?? false) {
    $result = $resp['result']; // handle the response
}
Botlify Cloud Runtime
Credentials are auto-injected in .env — always load them with getenv(): BOT_TOKEN, ADMIN_CHAT_ID, BOT_USERNAME. Main database: database.db (SQLite, WAL mode). Runtime errors: error.log. Quick test: send to $ADMIN_CHAT_ID. Full details: Runtime Reference.