API Advertisement Integration
If you wish to seamlessly integrate advertisements into your application without noticeable popups or banners, this can be achieved through API integration.
Warning
This method involves higher integration costs, so proceed with caution. Prefer using SDK integration whenever possible.
Currently, this feature is in the testing phase and is available to a limited number of users.
Prerequisites
- Decide where advertisements will be displayed. If not determined yet, refer to Ad integration examples.
- Obtain a BlockId. If you haven't, check Get blockId.
Key APIs
Get Advertisements API
This API allows you to retrieve multiple advertisement details, which you need to embed within your product.
Key parameters:
- adBlockId: The BlockId created in the management dashboard, copy it from the Platform details page, as shown in the image.
- telegramUserId: The current Telegram user ID.
Click Event Reporting API
Report an event when a user clicks on an advertisement.
Tips
If you need to configure multiple ad placements, it's recommended to assign a distinct BlockId to each location to compare the performance of ads in different spots.
Warning
Avoid reporting fake Click events
Both advertisers and publishers' data are reported to the Ton AI platform. Reporting fake Click events can lead to data discrepancies between parties and result in penalties when such behavior is detected by the system.
Integration Example
Using the API, you can embed advertisements anywhere within your product interface, such as integrating ads as part of an Earn task.