Endpoints
Here you can view information about existing endpoints and how to make requests for them. URL for requests: https://tganalytics.xyz
POST /events
This request is needed to record an event in the database
Body
The request body may contain an array rather than a single event. The main thing is that all events in the array satisfy the scheme below
Required
user_idType: number
Description: unique identifier for the user.
event_nameType: string
Description: the name of the event from the supported
session_idType: string (must be UUID)
Description: session identifier for tracking user sessions
app_nameType: string
Description: the name of the application that you specified when creating the token
Optional
is_premiumType: boolean
Description: if the user has a premium account, by default - false
is_successType: boolean
Description: indicates whether a wallet is connected or the transaction was successful, by default - false
error_messageType: string
Description: error message if the wallet connection or transaction is unsuccessful
error_codeType: number
Description: error code if the wallet connection or transaction is unsuccessful
wallet_addressType: string
Description: wallet address involved in the event
wallet_typeType: string
Description: type of the wallet
wallet_versionType: string
Description: version of the wallet software
auth_typeType: enum(0 - 'ton_addr', 1 - 'ton_proof')
Description: type of authorization used
valid_untilType: string
Description: timestamp until when a transaction offer is valid
fromType: string
Description: wallet address initiating the transaction
messagesType: { address: string; amount: string }[]
Description: list of transactions {to, amount} involved in the event
custom_dataType: object
Description: object to store custom event details as needed
client_timestampType: string
Description: the time when the event occurred on the clent
platformType: string
Description: the platform from which the MiniApp was opened
localeType: string
Description: user language code
start_paramType: string
Description: tgWebAppStartParam
url_refererType: string
Description: the URL of the web application from which the request was sent
scopeType: string
Description: event scope
Request Body Example`s:
Headers
Instead of YOUR_TOKEN, you need to specify the token received using the bot
Responses
HTTP201
Description: the event has been successfully recorded
Content:
HTTP400
Description: the event was not recorded due to server issues
Content:
HTTP400
Description: the token was entered incorrectly or in the wrong format
Content:
HTTP400
Description: the entered token is invalid (was not created through a Data Chief bot)
Content:
HTTP400
Description: the request body contains the application name that does not match the token
Content:
HTTP400
Description: the body specified in the request was not validated (for example, the type of one of the fields does not match)
Content:
HTTP403
Description: an attempt to use the API on a domain name that does not match the token
Content:
HTTP429
Description: too many requests from the client in a certain amount of time
Content:
Last updated