Source
Lead/trade acquisition sources
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /source/get-all
Return all lead/customer acquisition sources for the tenant. Optionally filter by source type.
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/source/get-all' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"type": "user",
"own_only": false
}'js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/source/get-all', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"type": "user",
"own_only": false
}),
})
const { code, data } = await res.json()python
import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/source/get-all",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"type": "user",
"own_only": False,
},
)
print(res.json())php
<?php
$body = <<<'JSON'
{
"type": "user",
"own_only": false
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/source/get-all');
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);Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
type | string | Нет | Filter sources by origin category (forward-compatible — not yet applied server-side). Допустимые значения: user, system, integration, lead_form |
own_only | boolean | Нет |
json
{
"type": "user",
"own_only": false
}Ответ
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [],
"time": "2025-05-01T12:00:00Z"
}GET /source/get-by-id/{id}
Fetch a single acquisition source by its ObjectId.
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/source/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/source/get-by-id/6712f0a9c4d1e87b3a0f9911', {
method: 'GET',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()python
import os
import requests
res = requests.request(
"GET",
"https://api.bito.uz/integration-api/integration/api/v2/source/get-by-id/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/source/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 | Да | Source ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | Source ObjectId |
name | string | Display name of the source (e.g. 'Instagram', 'Walk-in', 'Referral') |
type | string | Origin category of the source. Допустимые значения: user, system, integration, lead_form |
integration_id | string | ObjectId of the linked integration, if type is 'integration' |
is_visible | boolean | Whether the source is shown in customer-facing selection lists |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp |
updated_at | string (date-time) | Last update timestamp |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"type": "user",
"integration_id": "string",
"is_visible": false,
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.