Sending a target event/achieving a goal
Last updated
Last updated
The goal is the user's action in the bot, for example, a sale. Graspil has several “goals” already created, you can see them in your personal account in the . You can also create your own goals there.
Each goal has its own trigger — some kind of logic, upon the occurrence of which a target event (goal achievement) will be created, which you will see in the statistics.
“Goals” can be activated via the API. Below is a method that describes how to send a target event.
You can send from 1 to 100 events per request. The data is sent in json
format. It is preferable to send events at the moment they appear. HTTPS Request POST https://api.graspil.com/api/send-target
target_id
integer
yes
user_id
integer
yes
Telegram ID of the user to whom the event belongs. Before saving the data, it will be checked whether the id matches the user of your bot.
date
string ISO8601
no
The date and time when the event occurred, if left empty, the current time will be set. The time format must include milliseconds and the time zone. Example: 2024-08-03T20:00:00.123+02:00
value
float
no
Total price (floating point number)
unit
string(3)
yes, if value
is set
Example of a successful response:
In case of errors during data validation, the response will contain information about the error
The goal ID, you can find the ID in the
Currency code, maximum line length 3. Similar to c
When receiving data, the API checks only the basic parameters, the rest of the checks occur later during data processing. You can find all the errors that have occurred in the “” section