Botality API documentaiton to add analytics to telegram bot


Endpoint
URL: https://botality.cc/api/v1/messages
Method: POST
Content-Type: application/json


Description

This endpoint allows clients to send a message to the Botality telegram bot analytics service. The message data must be provided in the request body.


Request Body Parameters

token (string, required):
A unique token used to authenticate the request.

data (object, required):
An object containing the message details.

message_id (integer, required):
A unique identifier for the message.

from (object, required):
An object containing details about the sender of the message.

id (integer, required):
A unique identifier for the sender.

is_bot (boolean, required):
A flag indicating whether the sender is a bot.
true if the sender is a bot.
false if the sender is a human user.

username
(string, optional):
The username of the sender, if available.

date
(integer, required):
A Unix timestamp indicating when the message was sent.

text
(string, required):
The content of the message.


Example Request

POST /api/v1/messages
Host: botality.cc
Content-Type: application/json

{
  "token": "your_bot_token",
  "data": {
    "message_id": 123456,
    "from": {
      "id": 78910,
      "is_bot": false,
      "username": "user123"
    },
    "date": 1692612310,
    "text": "Hello, world!"
  }
}


Response

200 OK
The message was successfully processed by the server.
{
  "status": "ok"
}