How to display UI fields from your API?
Last updated
Last updated
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:
Requirements for your endpoint:
HTTPS-only protocol is supported, because requests will go directly from users’ Telegram Mini Apps;
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:
✅Valid response:
Insert property name you want to access:
Insert your API URL:
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.