Sms template
SMS message templates
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /sms-template/create
Create a new SMS template for the tenant.
Нужное разрешение: sms_template · как работают разрешения
Пример запроса
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/sms-template/create' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"content": "string"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sms-template/create', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"content": "string"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/sms-template/create",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"content": "string",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"content": "string"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sms-template/create');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
content | string | Да | SMS message body text. System variables: {name}, {phone_number}, {balance}. A customer custom field is referenced as {{<field name>}} (e.g. {{Mijoz mamlakati}}; case, spaces and underscores are ignored) and is stored as {{cf.<custom_field_id>}}, so renaming the field does not break the template. {{cf.<custom_field_id>}} is accepted as-is. A {{...}} that names no customer custom field is rejected with error code 116002. |
{
"content": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | SMS template ObjectId |
account_id | string | Tenant identifier (immutable, injected server-side) |
content | string | SMS message body text. Customer custom-field variables are returned as {{cf.<custom_field_id>}}. |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp (ISO 8601) |
updated_at | string (date-time) | Last update timestamp (ISO 8601) |
created_by | string | ObjectId of the user who created this template |
updated_by | string | ObjectId of the user who last updated this template |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"account_id": "string",
"content": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"created_by": "string",
"updated_by": "string"
},
"time": "2025-05-01T12:00:00Z"
}GET /sms-template/get-by-id/{id}
Fetch a single SMS template by ObjectId.
Нужное разрешение: sms_template · как работают разрешения
Пример запроса
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-by-id/6712f0a9c4d1e87b3a0f9911', {
method: 'GET',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"GET",
"https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-by-id/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | SMS template ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /sms-template/create.
POST /sms-template/get-paging
Paginated list of SMS templates scoped to the tenant.
Нужное разрешение: sms_template · как работают разрешения
Пример запроса
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-paging' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"limit": 20
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-paging', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"page": 1,
"limit": 20
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-paging",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"page": 1,
"limit": 20,
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"page": 1,
"limit": 20
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sms-template/get-paging');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
{
"page": 1,
"limit": 20
}Ответ
| Поле | Тип | Описание |
|---|---|---|
total | number | |
list | object[] | |
list[]._id | string | SMS template ObjectId |
list[].account_id | string | Tenant identifier (immutable, injected server-side) |
list[].content | string | SMS message body text. Customer custom-field variables are returned as {{cf.<custom_field_id>}}. |
list[].is_deleted | boolean | Soft-delete flag |
list[].created_at | string (date-time) | Creation timestamp (ISO 8601) |
list[].updated_at | string (date-time) | Last update timestamp (ISO 8601) |
list[].created_by | string | ObjectId of the user who created this template |
list[].updated_by | string | ObjectId of the user who last updated this template |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"_id": "string",
"account_id": "string",
"content": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"created_by": "string",
"updated_by": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /sms-template/update/{id}
Update an existing SMS template by ObjectId.
Нужное разрешение: sms_template · как работают разрешения
Пример запроса
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/sms-template/update/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"content": "string"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sms-template/update/6712f0a9c4d1e87b3a0f9911', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"content": "string"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/sms-template/update/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"content": "string",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"content": "string"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sms-template/update/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | SMS template ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
content | string | Да | SMS message body text. System variables: {name}, {phone_number}, {balance}. A customer custom field is referenced as {{<field name>}} (e.g. {{Mijoz mamlakati}}; case, spaces and underscores are ignored) and is stored as {{cf.<custom_field_id>}}, so renaming the field does not break the template. {{cf.<custom_field_id>}} is accepted as-is. A {{...}} that names no customer custom field is rejected with error code 116002. |
{
"content": "string"
}Ответ
Структура ответа совпадает с POST /sms-template/create.
DELETE /sms-template/delete/{id}
Soft-delete an SMS template by ObjectId (sets is_deleted=true).
Нужное разрешение: sms_template · как работают разрешения
Пример запроса
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/sms-template/delete/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sms-template/delete/6712f0a9c4d1e87b3a0f9911', {
method: 'DELETE',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"DELETE",
"https://api.bito.uz/integration-api/integration/api/v2/sms-template/delete/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sms-template/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | SMS template ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.