### GET /v1/shoppublic/category/all Source: https://bott.readme.io/reference/40e0b5f168e5c1ead0b053611ae33017 Retrieves the store showcase text. Requires a bot_id in the request body. ```APIDOC ## POST /v1/shoppublic/category/all ### Description Retrieves the store showcase text. Requires a bot_id in the request body. ### Method POST ### Endpoint https://api.bot-t.com/v1/shoppublic/category/all ### Parameters #### Request Body - **bot_id** (integer) - Required - The ID of the bot. ### Request Example ```json { "bot_id": 12345 } ``` ### Response #### Success Response (200) - **message** (string) - Description of the store showcase text or an error message. #### Response Example ```json { "message": "Welcome to our store!" } ``` ``` -------------------------------- ### Create Digital Product Order (cURL) Source: https://bott.readme.io/reference/%D1%86%D0%B8%D1%84%D1%80%D0%BE%D0%B2%D0%BE%D0%B9-%D0%B7%D0%B0%D0%BA%D0%B0%D0%B7 Example of how to create a digital product order using cURL. This request requires the API endpoint URL and specifies the content type as JSON. ```shell curl --request POST \ --url https://api.bot-t.com/v1/shopdigital/order-public/create \ --header 'content-type: application/json' ``` -------------------------------- ### GET /websites/bott_readme_io_reference/users Source: https://bott.readme.io/reference/202f1c705c47b6a9d1609e9e368b08bd Retrieves a list of bot users. Supports filtering by various user attributes. ```APIDOC ## GET /websites/bott_readme_io_reference/users ### Description Retrieves a list of bot users. Supports filtering by various user attributes. ### Method GET ### Endpoint /websites/bott_readme_io_reference/users ### Parameters #### Query Parameters - **id** (integer) - Optional - Filter by user ID. - **ref_id** (integer) - Optional - Filter by referral ID. - **created_time_start** (datetime) - Optional - Filter users created after this timestamp. - **created_time_end** (datetime) - Optional - Filter users created before this timestamp. - **updated_time_start** (datetime) - Optional - Filter users updated after this timestamp. - **updated_time_end** (datetime) - Optional - Filter users updated before this timestamp. - **min_balance** (number) - Optional - Filter users with a minimum balance. - **max_balance** (number) - Optional - Filter users with a maximum balance. - **user_id** (integer) - Optional - Filter by a specific user ID. - **type** (string) - Optional - Filter by user type. - **telegram_id** (integer) - Optional - Filter by Telegram user ID. ### Response #### Success Response (200) - **users** (array) - A list of user objects. - **id** (integer) - The user's unique identifier. - **ref_id** (integer) - The referral ID of the user. - **created_time** (datetime) - The timestamp when the user was created. - **updated_time** (datetime) - The timestamp when the user was last updated. - **balance** (number) - The user's current balance. - **user_id** (integer) - The user's internal ID. - **type** (string) - The type of the user. - **telegram_id** (integer) - The user's Telegram ID. #### Response Example ```json { "users": [ { "id": 1, "ref_id": 101, "created_time": "2023-10-27T10:00:00Z", "updated_time": "2023-10-27T12:00:00Z", "balance": 100.50, "user_id": 12345, "type": "premium", "telegram_id": 987654321 } ] } ``` ``` -------------------------------- ### Retrieve Bot User List (Node.js) Source: https://bott.readme.io/reference/%D0%B1%D0%BE%D1%82 Example of how to retrieve a list of bot users using Node.js. This snippet demonstrates making a POST request to the API endpoint with appropriate headers. ```javascript const url = 'https://api.bot-t.com/v1/bot/user/index'; const options = { method: 'POST', headers: { 'accept': 'application/json', 'content-type': 'application/json' } }; fetch(url, options) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Signature Verification (Client-Side) Source: https://bott.readme.io/reference/%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B This section explains how to verify the signature on your side when a client transitions, ensuring the integrity of payment requests. ```APIDOC ## Signature Verification (Client-Side) ### Description Verifies the signature provided in a client transition link to ensure data integrity. ### Method Not Applicable (Client-side calculation) ### Endpoint Not Applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ### Signature Calculation Formula `sign = md5(id . ':' . sum . ':' . currency . ':' . token)` Where: - `id`: `MODEL_ID` (numeric, second part of `order_id`) - `sum`: Amount in cents/kopecks - `currency`: Currency code (e.g., RUB, USD) - `token`: Bot token from BotFather settings **Note:** The bot token should be kept secret on your server. ``` -------------------------------- ### Retrieve Bot User List (Ruby) Source: https://bott.readme.io/reference/%D0%B1%D0%BE%D1%82 Example of how to retrieve a list of bot users using Ruby's Net::HTTP library. This demonstrates making a POST request to the API endpoint with JSON content type. ```ruby require 'net/http' require 'uri' uri = URI.parse('https://api.bot-t.com/v1/bot/user/index') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request['accept'] = 'application/json' request['content-type'] = 'application/json' response = http.request(request) puts response.body ``` -------------------------------- ### Retrieve Bot User List (cURL) Source: https://bott.readme.io/reference/%D0%B1%D0%BE%D1%82 Example of how to retrieve a list of bot users using a cURL request. This demonstrates the POST method, URL, and required headers for the API call. ```shell curl --request POST \ --url https://api.bot-t.com/v1/bot/user/index \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Verify Payment Signature (Client-Side) Source: https://bott.readme.io/reference/%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B This snippet demonstrates how to verify the payment signature on your side when a client transitions. It uses the MD5 hash of the order details (ID, sum, currency) and the bot's token. Ensure the bot token is kept secret on your server. ```php ``` -------------------------------- ### Retrieve Bot User List (Python) Source: https://bott.readme.io/reference/%D0%B1%D0%BE%D1%82 Example of how to retrieve a list of bot users using Python's requests library. This shows how to send a POST request with JSON headers to the specified API endpoint. ```python import requests url = 'https://api.bot-t.com/v1/bot/user/index' headers = { 'accept': 'application/json', 'content-type': 'application/json' } response = requests.post(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code} - {response.text}") ``` -------------------------------- ### POST /v1/shop/category/add-base Source: https://bott.readme.io/reference/35ee30731f2d6d6f290ba6a00906d800 Adds product data to a category. Requires authentication via bot token or secret key. ```APIDOC ## POST /v1/shop/category/add-base ### Description Adds product data to a category. Requires authentication via bot token or secret key. ### Method POST ### Endpoint https://api.bot-t.com/v1/shop/category/add-base ### Parameters #### Query Parameters - **secretKey** (string) - Optional - Секретный ключ бота для авторизации. Его можно найти на странице обновления токена бота. - **botToken** (string) - Required - Токен бота (Bot API token) для авторизации запроса #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **id** (integer) - Required - The ID of the product. - **data** (string) - Required - The product data. - **name** (string) - Required - The name of the product. ### Request Example ```json { "bot_id": 12345, "id": 67890, "data": "Product details here", "name": "Example Product" } ``` ### Response #### Success Response (200) - **message** (string) - Description of the success or error message. #### Response Example ```json { "message": "Product added successfully." } ``` ``` -------------------------------- ### Generate Webhook Signature (PHP) Source: https://bott.readme.io/reference/%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B This PHP example shows how to generate the signature required for webhook notifications to BOT-T. It uses the full order ID, sum, currency, and either the bot token or a secret key. The generated signature is sent in the POST request body. ```php $order_id = 'u-12345-67'; // Full order_id $sum = 10050; $currency = 'RUB'; $token = 'YOUR_BOT_TOKEN'; // or bot's secret key $sign = md5($order_id . ':' . $sum . ':' . $currency . ':' . $token); ``` -------------------------------- ### Get Order Details (OpenAPI Definition) Source: https://bott.readme.io/reference/fb702bbfab30f8460b0077dd9abdb8cd This OpenAPI definition describes the 'Get Order' endpoint for digital orders. It specifies the request parameters (bot_id, user_id, secret_user_key, order_id) and the expected response structure for successful retrieval of order data or error messages. ```json { "openapi": "3.0.0", "info": { "title": "API for BOT-T", "description": "REST API v1. Для авторизации используйте токен бота (Bot API token) или секретный ключ (его можно найти на странице обновления токена бота). Передавайте bot_id в теле запроса (POST) где необходимо.", "version": "0.1" }, "servers": [ { "url": "https://api.bot-t.com", "description": "API сервер" } ], "paths": { "/v1/shopdigital/order-public/get": { "post": { "tags": [ "Цифровой заказ" ], "summary": "Получить заказ", "description": "Принимает bot_id, user_id, secret_user_key, order_id. Возвращает данные заказа.", "operationId": "fb702bbfab30f8460b0077dd9abdb8cd", "requestBody": { "content": { "application/json": { "schema": { "properties": { "bot_id": { "type": "integer" }, "user_id": { "type": "integer" }, "secret_user_key": { "type": "string" }, "order_id": { "type": "integer" } }, "type": "object" } } } }, "responses": { "200": { "description": "Успех: данные заказа. Ошибка: message." } } } } }, "tags": [ { "name": "Цифровой заказ", "description": "Цифровой заказ" } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true }, "_id": "6985701aafa8781fd5308e94" } ``` -------------------------------- ### POST /v1/shop/template/create Source: https://bott.readme.io/reference/f9b9180ac33a4f26d055c89deb1a916a Creates a new shop template. Requires bot_id, title, and type in the request body. Authorization can be done via bot token or secret key. ```APIDOC ## POST /v1/shop/template/create ### Description Creates a new shop template. Requires bot_id, title, and type in the request body. Authorization can be done via bot token or secret key. ### Method POST ### Endpoint https://api.bot-t.com/v1/shop/template/create ### Parameters #### Query Parameters - **botToken** (string) - Required - Токен бота (Bot API token) для авторизации запроса - **secretKey** (string) - Optional - Секретный ключ бота для авторизации. Его можно найти на странице обновления токена бота. #### Request Body - **bot_id** (integer) - Required - Идентификатор бота - **title** (string) - Required - Название шаблона - **type** (integer) - Required - Тип шаблона ### Request Example ```json { "bot_id": 12345, "title": "My Awesome Template", "type": 1 } ``` ### Response #### Success Response (200) - **message** (string) - Description of the success or error message. #### Response Example ```json { "message": "Template created successfully." } ``` ``` -------------------------------- ### Activate Promo Code (OpenAPI) Source: https://bott.readme.io/reference/4ab2f050dbffb6e46d78865176fa2ec8 This OpenAPI definition describes the endpoint for activating a promo code. It requires bot_id, user_id, secret_user_key, and the promo code itself. The response indicates success with coupon data or an error message. ```json { "openapi": "3.0.0", "info": { "title": "API for BOT-T", "description": "REST API v1. Для авторизации используйте токен бота (Bot API token) или секретный ключ (его можно найти на странице обновления токена бота). Передавайте bot_id в теле запроса (POST) где необходимо.", "version": "0.1" }, "servers": [ { "url": "https://api.bot-t.com", "description": "API сервер" } ], "paths": { "/v1/shoppublic/coupon/activated": { "post": { "tags": [ "Публичный магазин" ], "summary": "Активировать промокод", "description": "Принимает bot_id, user_id, secret_user_key, code. Активирует купон по коду.", "operationId": "4ab2f050dbffb6e46d78865176fa2ec8", "requestBody": { "content": { "application/json": { "schema": { "properties": { "bot_id": { "type": "integer" }, "user_id": { "type": "integer" }, "secret_user_key": { "type": "string" }, "code": { "type": "string" } }, "type": "object" } } } }, "responses": { "200": { "description": "Успех: данные купона. Ошибка: message." } } } } }, "tags": [ { "name": "Публичный магазин", "description": "Публичный магазин" } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true }, "_id": "69878c62913110ca74b77113" } ``` -------------------------------- ### POST /v1/subscriber/check-users/start Source: https://bott.readme.io/reference/30086ceeb07ef89cd022d9fb3ae903e1 Initiates a subscriber check by creating and starting the process. Requires bot_id and resource_id. ```APIDOC ## POST /v1/subscriber/check-users/start ### Description Initiates a subscriber check by creating and starting the process. Requires bot_id and resource_id. ### Method POST ### Endpoint https://api.bot-t.com/v1/subscriber/check-users/start ### Parameters #### Query Parameters - **botToken** (string) - Required - Bot API token for request authorization. - **secretKey** (string) - Optional - Bot's secret key for authorization. Can be found on the bot token update page. #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **resource_id** (integer) - Required - The ID of the resource for which to check subscribers. ### Request Example ```json { "bot_id": 12345, "resource_id": 67890 } ``` ### Response #### Success Response (200) - **message** (string) - Indicates the success of the operation. Example: "Успех." #### Response Example ```json { "message": "Успех." } ``` ``` -------------------------------- ### POST /v1/shop/template/reset Source: https://bott.readme.io/reference/eed6dcac8111fc81eae5535ecf6813ea Resets the shop template to its default settings. Requires authentication via bot token or secret key. ```APIDOC ## POST /v1/shop/template/reset ### Description Resets the shop template to its default settings. Requires authentication via bot token or secret key. ### Method POST ### Endpoint https://api.bot-t.com/v1/shop/template/reset ### Parameters #### Query Parameters - **botToken** (string) - Required - Токен бота (Bot API token) для авторизации запроса - **secretKey** (string) - Optional - Секретный ключ бота для авторизации. Его можно найти на странице обновления токена бота. #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **id** (integer or array) - Optional - ID or array of IDs to reset. ### Request Example ```json { "bot_id": 12345, "id": [1, 2, 3] } ``` ### Response #### Success Response (200) - **message** (string) - Description of the success or error message. #### Response Example ```json { "message": "Template reset successfully." } ``` ``` -------------------------------- ### User Authentication Source: https://bott.readme.io/reference/users All methods require authentication via either a botToken or a secretKey to be passed in the GET request. ```APIDOC ## User Authentication ### Description All methods require authentication. You must provide either `botToken` or `secretKey` in the request. ### Method GET ### Parameters #### Query Parameters - **botToken** (string) - Required - The token of the bot. - **secretKey** (string) - Required - The secret key for authentication. ``` -------------------------------- ### Authentication Methods Source: https://bott.readme.io/reference/index Explains the two methods for authenticating API requests: using a bot's secret key or a bot's token, both passed as query parameters. ```APIDOC ## Authentication Methods ### 1. Bot Secret Key (secretKey) - **Method:** Passed in query parameter: `?secretKey=` - **Usage:** If provided, only this key is checked; `token` is not required. - **Validation:** The key must match the bot's secret key in the system. It changes when the token is updated. - **Error:** Invalid key returns `secretKey is not valid`. ### 2. Bot Token (token) - **Method:** Passed in query parameter: `?token=` - **Usage:** Used if `secretKey` is not provided. - **Validation:** The token must match the bot's token in the system. - **Errors:** `token not found` if absent; `token is not valid` if incorrect. **Summary:** Either pass `secretKey` in the query (token is not needed) or pass `token` in the query for non-public methods. ``` -------------------------------- ### POST /payment/custom-link Source: https://bott.readme.io/reference/%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B This endpoint is used by your server to notify BOT-T about a successful payment made by a client. ```APIDOC ## POST /payment/custom-link ### Description Sends a POST request to the BOT-T API to confirm a successful client payment. Your server should always verify the signature before processing. ### Method POST ### Endpoint `https://api.bot-t.com/payment/custom-link` (Or your custom API domain: `https:///api/payment/custom-link`) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **order_id** (string) - Required - The full order number in the format `TYPE-MODEL_ID-ITEM_ID`. - **sum** (int) - Required - The payment amount in the smallest currency units (e.g., kopecks, cents). - **currency** (string) - Required - The currency code (e.g., RUB, USD). - **sign** (string) - Required - The signature calculated for the webhook. ### Request Example ```bash curl -X POST "https://api.bot-t.com/payment/custom-link" \ -d "order_id=u-12345-67" \ -d "sum=10050" \ -d "currency=RUB" \ -d "sign=XXXXXXXXXXXX" ``` ### Signature Calculation for Webhook `sign = md5(order_id . ':' . sum . ':' . currency . ':' . token)` Where `token` can be either the bot token or a configured secret bot key. The platform checks both. **Example (PHP):** ```php $order_id = 'u-12345-67'; // full order_id $sum = 10050; $currency = 'RUB'; $token = 'YOUR_BOT_TOKEN'; // or your secret bot key $sign = md5($order_id . ':' . $sum . ':' . $currency . ':' . $token); ``` ### Response #### Success Response (200) - **status** (string) - Indicates success, e.g., `"ok"`. #### Response Example ```json { "status": "ok" } ``` #### Error Response (400) - **error** (string) - An error code or message. - **description** (string) - A detailed explanation of the error. #### Response Example ```json { "error": "invalid_signature", "description": "Signature verification failed." } ``` ``` -------------------------------- ### POST /v1/shop/template/method Source: https://bott.readme.io/reference/11902d1723899f1ef6f5f67d5d141af3 Retrieves template action buttons for the shop. Requires bot authentication using either a Bot API token or a secret key. ```APIDOC ## POST /v1/shop/template/method ### Description Retrieves template action buttons for the shop. Requires bot authentication using either a Bot API token or a secret key. The `bot_id` must be provided in the request body. ### Method POST ### Endpoint https://api.bot-t.com/v1/shop/template/method ### Parameters #### Query Parameters - **botToken** (string) - Required - Bot API token for request authorization. - **secretKey** (string) - Optional - Bot secret key for authorization. Can be found on the bot token update page. #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **id** (integer) - Required - The ID of the template. ### Request Example ```json { "bot_id": 12345, "id": 67890 } ``` ### Response #### Success Response (200) - **message** (string) - Description of the success response, typically containing buttons. #### Response Example ```json { "message": "Success: buttons. Error: message." } ``` ``` -------------------------------- ### Get Category by ID Source: https://bott.readme.io/reference/99f175212e3bef200a13e3d3b3d2c85b Retrieves category information by its ID. This endpoint requires the bot ID and the category ID in the request body. ```APIDOC ## POST /v1/shoppublic/category/get ### Description Retrieves category information by its ID. This endpoint requires the bot ID and the category ID in the request body. ### Method POST ### Endpoint https://api.bot-t.com/v1/shoppublic/category/get ### Parameters #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **category_id** (integer) - Required - The ID of the category to retrieve. ### Request Example ```json { "bot_id": 12345, "category_id": 67890 } ``` ### Response #### Success Response (200) - **message** (string) - Description of the category or an error message. #### Response Example ```json { "message": "Category details or error message" } ``` ``` -------------------------------- ### POST /v1/shop/category/add-product Source: https://bott.readme.io/reference/73b1ecbbff0ee6cb2a9abef989901826 Adds products to a specified category within the shop. Requires authentication via bot token or secret key. ```APIDOC ## POST /v1/shop/category/add-product ### Description Adds products to a specified category. Authentication is required using either a bot token or a secret key. ### Method POST ### Endpoint /v1/shop/category/add-product ### Parameters #### Query Parameters - **botToken** (string) - Required - Bot API token for request authorization. - **secretKey** (string) - Optional - Bot's secret key for authorization. Can be found on the bot token update page. #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **id** (integer) - Required - The ID of the category to which products will be added. - **products** (array of strings) - Required - A list of product IDs to add. - **is_send_love** (boolean) - Optional - Flag to indicate if a 'love' action should be sent. ### Request Example ```json { "bot_id": 12345, "id": 67890, "products": ["product_1", "product_2"], "is_send_love": true } ``` ### Response #### Success Response (200) - **message** (string) - Description of the success or error message. #### Response Example ```json { "message": "Products added successfully to category." } ``` ``` -------------------------------- ### CUSTOM Payment Integration Source: https://bott.readme.io/reference/%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B Integrate a custom payment method where the client enters details in the bot, which are then sent to your server for processing. ```APIDOC ## POST /payment-handler ### Description Handles payment data entered by the client in the BOT-T interface. Your server validates the payment and responds to BOT-T to confirm or cancel the transaction. ### Method POST ### Endpoint Your specified HTTPS URL (e.g., `https://your-site.com/payment-handler.php`) ### Parameters #### Request Body - **code** (string) - Required - Data entered by the client (e.g., card number, payment code). - **id** (string) - Required - Full order ID in the format `TYPE-MODEL_ID-ITEM_ID`. - **bot_id** (string) - Required - Unique identifier for the bot. - **currency** (string) - Required - Currency code (e.g., RUB, USD). Must be verified. ### Response #### Success Response (200) - **id** (string) - Required - Unique transaction ID from your system. Use `"-1"` to retry after 3 seconds. - **sum** (integer) - Required - Actual payment amount in the smallest currency unit (e.g., kopecks, cents). - **status** (boolean) - Required - `true` to confirm payment, `false` to cancel the order. ### Request Example ```json { "code": "1234567890123456", "id": "c-54321-99", "bot_id": "bot123", "currency": "RUB" } ``` ### Response Example (Success) ```json { "id": "tx-98765", "sum": 10050, "status": true } ``` ### Response Example (Failure) ```json { "id": "tx-98765", "sum": 0, "status": false } ``` ### Response Example (Retry) ```json { "id": "-1", "sum": 0, "status": false } ``` ``` -------------------------------- ### Fetch All Users (PHP) Source: https://bott.readme.io/reference/users This snippet demonstrates how to retrieve all users for a bot by paginating through the 'index' endpoint. It uses cURL to make POST requests with specified limits and offsets, merging the results until no more users are returned. Authentication requires botToken and secretKey. ```php $baseUrl = 'https://your-api.com/v1/bot/user'; $botId = 1; $limit = 500; $allUsers = []; $offset = 0; do { $payload = [ 'bot_id' => $botId, 'botToken' => 'YOUR_BOT_TOKEN', 'secretKey' => 'YOUR_SECRET_KEY', 'limit' => $limit, 'offset' => $offset, ]; $ch = curl_init($baseUrl . '/index'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_RETURNTRANSFER => true, ]); $response = curl_exec($ch); curl_close($ch); $json = json_decode($response, true); if (empty($json['result'])) { throw new RuntimeException($json['message'] ?? 'API error'); } $chunk = $json['data'] ?? []; $allUsers = array_merge($allUsers, $chunk); $offset += $limit; } while (count($chunk) === $limit); // $allUsers — массив всех пользователей ``` -------------------------------- ### CUSTOM_LINK Payment Integration Source: https://bott.readme.io/reference/%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B Integrate a payment method using a link to your website. After payment, your server sends a webhook notification to BOT-T to confirm the transaction. ```APIDOC ## POST /webhook ### Description Receives payment confirmation from your server after a client completes payment via a generated link. BOT-T then marks the order as paid. ### Method POST ### Endpoint BOT-T API endpoint for webhook notifications (refer to BOT-T documentation for the specific URL). ### Parameters #### Request Body - **id** (string) - Required - Transaction ID from your payment system. - **order_id** (string) - Required - Full order ID in the format `TYPE-MODEL_ID-ITEM_ID`. - **sum** (integer) - Required - Actual payment amount in the smallest currency unit. - **currency** (string) - Required - Currency code (e.g., RUB, USD). - **sign** (string) - Required - Signature for verifying the authenticity of the request. ### Response #### Success Response (200) BOT-T acknowledges receipt of the webhook. A successful response typically involves an HTTP status code like 200 OK. ### Request Example (Webhook from your server to BOT-T) ```json { "id": "your_tx_id_123", "order_id": "c-54321-99", "sum": 10050, "currency": "RUB", "sign": "generated_signature" } ``` ``` -------------------------------- ### POST /v1/shopdigital/order-public/create Source: https://bott.readme.io/reference/%D1%86%D0%B8%D1%84%D1%80%D0%BE%D0%B2%D0%BE%D0%B9-%D0%B7%D0%B0%D0%BA%D0%B0%D0%B7 Creates an order for a digital product. It accepts bot ID, category ID, count, user ID, and a secret user key. If possible, it deducts the balance. ```APIDOC ## POST /v1/shopdigital/order-public/create ### Description Creates an order for a digital product. It accepts bot ID, category ID, count, user ID, and a secret user key. If possible, it deducts the balance. ### Method POST ### Endpoint https://api.bot-t.com/v1/shopdigital/order-public/create ### Parameters #### Request Body - **bot_id** (integer) - Required - The ID of the bot. - **category_id** (integer) - Required - The ID of the product category. - **count** (integer) - Required - The quantity of the product to order. - **user_id** (integer) - Required - The Telegram ID of the user. - **secret_user_key** (string) - Required - The secret key of the user. ### Request Example ```json { "bot_id": 123, "category_id": 456, "count": 2, "user_id": 789012, "secret_user_key": "your_secret_key" } ``` ### Response #### Success Response (200) - **message** (string) - Description of the order status or success message. #### Response Example ```json { "message": "Order created successfully." } ``` ``` -------------------------------- ### Get Subscriber Count (OpenAPI) Source: https://bott.readme.io/reference/846490a37b3d600d33966770b0ab3de9 Defines the OpenAPI 3.0.0 specification for the BOT-T API, specifically the endpoint to retrieve the subscriber count. It details the request parameters (bot_id, resource_id) and expected responses. ```json { "openapi": "3.0.0", "info": { "title": "API for BOT-T", "description": "REST API v1. Для авторизации используйте токен бота (Bot API token) или секретный ключ (его можно найти на странице обновления токена бота). Передавайте bot_id в теле запроса (POST) где необходимо.", "version": "0.1" }, "servers": [ { "url": "https://api.bot-t.com", "description": "API сервер" } ], "paths": { "/v1/subscriber/users/count": { "post": { "tags": [ "Подписчики" ], "summary": "Количество подписчиков", "description": "Принимает bot_id, resource_id. Возвращает количество подписчиков с учётом условий.", "operationId": "846490a37b3d600d33966770b0ab3de9", "parameters": [ { "$ref": "#/components/parameters/botToken" }, { "$ref": "#/components/parameters/secretKey" } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "bot_id": { "type": "integer" }, "resource_id": { "type": "integer" } }, "type": "object" } } } }, "responses": { "200": { "description": "Успех: число. Ошибка: message." } } } } }, "components": { "parameters": { "secretKey": { "name": "secretKey", "in": "query", "description": "Секретный ключ бота для авторизации. Его можно найти на странице обновления токена бота.", "required": false, "schema": { "type": "string" } }, "botToken": { "name": "botToken", "in": "query", "description": "Токен бота (Bot API token) для авторизации запроса", "required": true, "schema": { "type": "string", "example": "123123123231:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } } }, "tags": [ { "name": "Подписчики", "description": "Подписчики" } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true }, "_id": "69878d760ebd8084e96a4abb" } ``` -------------------------------- ### Get Category by ID (OpenAPI Definition) Source: https://bott.readme.io/reference/99f175212e3bef200a13e3d3b3d2c85b This OpenAPI 3.0 definition describes the endpoint for retrieving a category by its ID. It specifies the request method (POST), required parameters (bot_id, category_id), and expected responses. ```json { "openapi": "3.0.0", "info": { "title": "API for BOT-T", "description": "REST API v1. Для авторизации используйте токен бота (Bot API token) или секретный ключ (его можно найти на странице обновления токена бота). Передавайте bot_id в теле запроса (POST) где необходимо.", "version": "0.1" }, "servers": [ { "url": "https://api.bot-t.com", "description": "API сервер" } ], "paths": { "/v1/shoppublic/category/get": { "post": { "tags": [ "Публичный магазин" ], "summary": "Получить категорию по ID", "operationId": "99f175212e3bef200a13e3d3b3d2c85b", "requestBody": { "content": { "application/json": { "schema": { "properties": { "bot_id": { "type": "integer" }, "category_id": { "type": "integer" } }, "type": "object" } } } }, "responses": { "200": { "description": "Успех: данные категории. Ошибка: message." } } } } }, "tags": [ { "name": "Публичный магазин", "description": "Публичный магазин" } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true }, "_id": "69878c62913110ca74b77113" } ``` -------------------------------- ### Retrieve Bot User List (PHP) Source: https://bott.readme.io/reference/%D0%B1%D0%BE%D1%82 Example of how to retrieve a list of bot users using PHP. This snippet utilizes cURL to send a POST request to the API, including necessary headers. ```php ``` -------------------------------- ### POST /v1/shop/template/mass-method Source: https://bott.readme.io/reference/628bf9090eb69cf053bd536be036acb3 Performs mass actions on shop templates. Requires authentication via bot token or secret key. ```APIDOC ## POST /v1/shop/template/mass-method ### Description Performs mass actions on shop templates. Requires authentication via bot token or secret key. ### Method POST ### Endpoint https://api.bot-t.com/v1/shop/template/mass-method ### Parameters #### Query Parameters - **botToken** (string) - Required - Токен бота (Bot API token) для авторизации запроса - **secretKey** (string) - Optional - Секретный ключ бота для авторизации. Его можно найти на странице обновления токена бота. #### Request Body - **bot_id** (integer) - Required - The ID of the bot. ### Request Example ```json { "bot_id": 12345 } ``` ### Response #### Success Response (200) - **message** (string) - Description of the success message or error. #### Response Example ```json { "message": "Operation successful" } ``` ``` -------------------------------- ### Create Shop Template OpenAPI Definition Source: https://bott.readme.io/reference/f9b9180ac33a4f26d055c89deb1a916a This OpenAPI 3.0 definition describes the endpoint for creating a shop template. It specifies the request method (POST), parameters (botToken, secretKey), and the request body schema including bot_id, title, and type. Authentication is handled via bot token or secret key. ```json { "openapi": "3.0.0", "info": { "title": "API for BOT-T", "description": "REST API v1. Для авторизации используйте токен бота (Bot API token) или секретный ключ (его можно найти на странице обновления токена бота). Передавайте bot_id в теле запроса (POST) где необходимо.", "version": "0.1" }, "servers": [ { "url": "https://api.bot-t.com", "description": "API сервер" } ], "paths": { "/v1/shop/template/create": { "post": { "tags": [ "Магазин" ], "summary": "Создать шаблон", "operationId": "f9b9180ac33a4f26d055c89deb1a916a", "parameters": [ { "$ref": "#/components/parameters/botToken" }, { "$ref": "#/components/parameters/secretKey" } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "bot_id": { "type": "integer" }, "title": { "type": "string" }, "type": { "type": "integer" } }, "type": "object" } } } }, "responses": { "200": { "description": "Успех. Ошибка: message." } } } } }, "components": { "parameters": { "secretKey": { "name": "secretKey", "in": "query", "description": "Секретный ключ бота для авторизации. Его можно найти на странице обновления токена бота.", "required": false, "schema": { "type": "string" } }, "botToken": { "name": "botToken", "in": "query", "description": "Токен бота (Bot API token) для авторизации запроса", "required": true, "schema": { "type": "string", "example": "123123123231:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } } }, "tags": [ { "name": "Магазин", "description": "Магазин" } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true }, "_id": "69856df160ee5c1ff61c2425" } ``` -------------------------------- ### Check Telegram Auth Hash (PHP) Source: https://bott.readme.io/reference/%D0%BC%D0%BE%D0%B4%D1%83%D0%BB%D1%8C-%D0%B2%D0%B5%D0%B1 Example PHP code to check Telegram authorization hash. This snippet demonstrates making a POST request with the required form data to the API. ```php $botId, 'userData' => $userData ]); $options = [ 'http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => $data ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { // Handle error return null; } return json_decode($result, true); } // Example usage: // $userData = 'query=...&hash=...'; // $result = checkTelegramHash(123, $userData); // print_r($result); ?> ``` -------------------------------- ### Check Telegram Auth Hash (Node.js) Source: https://bott.readme.io/reference/%D0%BC%D0%BE%D0%B4%D1%83%D0%BB%D1%8C-%D0%B2%D0%B5%D0%B1 Example Node.js code to check Telegram authorization hash. This snippet demonstrates how to make a POST request with the necessary form data to the API. ```javascript const axios = require('axios'); const checkTelegramHash = async (botId, userData) => { try { const response = await axios.post('https://api.bot-t.com/v1/module/bot/check-hash', `bot_id=${botId}&userData=${userData}`, { headers: { 'content-type': 'application/x-www-form-urlencoded' } } ); return response.data; } catch (error) { console.error('Error checking Telegram hash:', error); throw error; } }; // Example usage: // checkTelegramHash(123, 'query=...&hash=...').then(data => console.log(data)); ```