Skip to content
Markdown

Task type ​

INFO

Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.

POST /task-type/get-by-id ​

Get a task type by its _id.

Нужное разрешение: tasks · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/task-type/get-by-id' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/task-type/get-by-id', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "64b7f4d9e2b3b6a0b7c5d80a"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/task-type/get-by-id",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "64b7f4d9e2b3b6a0b7c5d80a",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/task-type/get-by-id');
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);

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a"
}

Ответ

ПолеТипОписание
_idstring
namestring
colorstring
is_defaultboolean
is_deletedboolean
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "Follow-up call",
    "color": "#FF9800",
    "is_default": false,
    "is_deleted": false,
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /task-type/paging ​

Paginated list of task types.

Нужное разрешение: tasks · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/task-type/paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/task-type/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()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/task-type/paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/task-type/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);

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
searchstringНетSearch by name.
json
{
  "page": 1,
  "limit": 20,
  "search": "string"
}

Ответ

ПолеТипОписание
listobject[]
list[]._idstring
list[].namestring
list[].colorstring
list[].is_defaultboolean
list[].is_deletedboolean
list[].created_atstring (date-time)
list[].updated_atstring (date-time)
totalnumber
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "list": [
      {
        "_id": "string",
        "name": "Follow-up call",
        "color": "#FF9800",
        "is_default": false,
        "is_deleted": false,
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z"
      }
    ],
    "total": 42
  },
  "time": "2025-05-01T12:00:00Z"
}

Эта страница сгенерирована из спецификации OpenAPI.

Bito 2.0 Integration API