TgTaps Docs
  • TgTaps Documentation
    • Community
  • Blocks
    • Basic
      • Container
      • Block
      • Image
      • Copy button
      • HTML
      • Onboarding
    • Payments
      • Subscriptions list
    • Friends (referral system)
      • Invite friend button
      • Leaderboard
      • Claim friends bonus button
      • Friends list
    • Pages
      • Buy page button
      • Buy page card
      • Access page from date
    • Clicker game
      • Cards
      • Level reachment
      • Level progress
      • Click button
      • Energy progress
      • Farm button
    • Tasks
    • FAQ
    • TON
      • Connect TON wallet button
      • Send TON button
    • System blocks
      • Buy page dialog
    • Quizes
      • Quiz
      • Quiz completion
    • Daily bonus
  • Roulette
  • FEATURES
    • Rates
    • Navigation
    • Placeholders
    • Referrals statistics export
    • Custom value
    • Broadcast sending
    • Bot ownership transfer and token change
    • Head scripts
    • Pages
      • Paid pages
    • Levels
    • Payments
      • How to sell points?
  • Mini App Settings
    • Telegram messages
    • Referral system
    • Fonts
    • System icons
    • Analytics
  • Integrations
    • API keys
    • API methods
    • iFrame integrations
    • How to display UI fields from your API?
  • FAQ
    • How to fix "primary page is not configured"?
    • How to create gradient color or background?
    • How pages background works?
    • How to insert YouTube video in app?
    • How to add Play button to Telegram Bot?
  • Changelog
    • Changelog
Powered by GitBook
On this page
  1. Integrations

How to display UI fields from your API?

PreviousiFrame integrationsNextHow to fix "primary page is not configured"?

Last updated 1 month ago

To get the string value for custom UI field, we make POST request to your server. Such requests will go to your API from or *.tgtaps.com (any subdomain) URL.

In this request we pass the following properties:

  • User Telegram ID (userTelegramId);

  • User points amount (userPoints);

  • User friends count (userFriendsCount);

  • User levels total count (userTotalLevels);

  • User current level (userLevel);

  • TON address (friendly formatted and raw-formatted);

Additional fields will be added soon.

Example of the request:

curl -X POST https://your-domain.com/api/users/get-custom-value \
     -H "Content-Type: application/json" \
     -d '{
           "userTelegramId": 12314332, 
           "userPoints": 1000000, 
           "userFriendsCount": 5, 
           "userTotalLevels": 20, 
           "userLevel": 2,
           "tonFriendlyAddress": "dfdsFDEDddsDFsddfsd",
           "tonRawAddress": "dfdsFDEDddsDFsddfsd"
         }'

Requirements for your endpoint:

  1. HTTPS-only protocol is supported, because requests will go directly from users’ Telegram Mini Apps;

  2. Response should be raw string or number that will be processed as string. JSON responses not supported (or they will be rendered entirely in UI);

❌ Wrong data response:

{
  "data": "some_value"
}

✅Valid response:

"some_value"

How to add custom API UI field on UI?

  1. Insert property name you want to access:

  1. Insert your API URL:

  1. Access property in UI:


CORs should allow hosts and *.tgtaps.com;

Something unclear in docs or you know how to improve article? We will answer you and then promise to improve the article within 3 days.

app.tgtaps.com
app.tgtaps.com
Message us in community!