> For the complete documentation index, see [llms.txt](https://tgtaps.gitbook.io/tgtaps-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tgtaps.gitbook.io/tgtaps-docs/integrations/how-to-display-ui-fields-from-your-api.md).

# How to display UI fields from your API?

To get the string value for custom UI field, we make POST request to your server. Such requests will go to your API from [app.tgtaps.com](http://app.tgtaps.com/) 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.

&#x20;

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. CORs should allow hosts [~~ap~~p.tgtaps.com](http://app.tgtaps.com/) and \*.tgtaps.com;
3. 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? <a href="#how-to-add-custom-api-ui-field-on-ui" id="how-to-add-custom-api-ui-field-on-ui"></a>

1. Insert property name you want to access:

<figure><img src="/files/7gDNFZ1GT9dorCZ12Y20" alt=""><figcaption></figcaption></figure>

2. Insert your API URL:

<figure><img src="/files/DKWr55QdlZzGBuiVACjT" alt=""><figcaption></figcaption></figure>

3. Access property in UI:

<figure><img src="/files/4uw8bAS7vJfjnzcCiFAT" alt=""><figcaption></figcaption></figure>

***

Something unclear in docs or you know how to improve article? [Message us in community!](https://docs.tgtaps.com/tgtaps-docs/readme/community)\
We will answer you and then promise to improve the article within 3 days.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tgtaps.gitbook.io/tgtaps-docs/integrations/how-to-display-ui-fields-from-your-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
