Skip to content
Markdown

Employee ​

INFO

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

POST /employee/create ​

This method allows adding employee into the account.

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/employee/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "full_name": "string",
    "phone_number": "string",
    "accesses": [
      {
        "organization_id": "67b486d242ed76693cd2cc59",
        "positions": [],
        "role_id": "string"
      }
    ]
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "full_name": "string",
        "phone_number": "string",
        "accesses": [
            {
                "organization_id": "67b486d242ed76693cd2cc59",
                "positions": [],
                "role_id": "string",
            },
        ],
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
full_namestringДа
innstringНет
phone_numberstringДа
jshirstringНет
addressstringНет
passport_numberstringНет
passport_issued_datestringНет
passport_issued_bystringНет
acceptance_datestringНет
work_ratenumberНетПо умолчанию: 0
testing_end_timestringНет
contract_end_timestringНетПо умолчанию: false
holidaysnumberНетПо умолчанию: 0
commentstringНет
pincodestringНетRequired unless is_free is true.
passwordstringНетRequired unless is_free is true.
is_freebooleanНетПо умолчанию: false
accessesobject[]Да
accesses[].organization_idstringДа
accesses[].positionsobject[]Нет
accesses[].positions[].position_idstringДа
accesses[].positions[].section_idstringДа
accesses[].role_idstringНет
person_idstringНетperson id of employee
genderstringНетДопустимые значения: male, female
imagestringНетimage path of employee that uploaded to the server
last_namestringНет
middle_namestringНет
birth_datestringНетdate of birth of employee
legal_person_idstringНетid of legal person
telegram_linkstringНетlink of telegram account
emailstringНетemail of employee
is_supplierbooleanНетis supplier or not. По умолчанию: false
is_customerbooleanНетis customer or not. По умолчанию: false
statusstringНетstatus of employee. Допустимые значения: active, inactive
short_namestringНетshort name of employee
codestringНетcode of employee
postal_codestringНетpostal code of employee
owner_idstringНетid of owner
manager_idstringНетid of manager
delivery_addressobjectНетdelivery address of employee
delivery_address.latnumberНетПо умолчанию: 0
delivery_address.longnumberНетПо умолчанию: 0
delivery_address.human_addressobjectНет
delivery_address.human_address.addressstringНет
delivery_address.human_address.citystringНет
delivery_address.human_address.statestringНет
delivery_address.human_address.zipstringНет
delivery_address.bearingnumberНет
web_sitestringНет
json
{
  "full_name": "string",
  "inn": "string",
  "phone_number": "string",
  "jshir": "string",
  "address": "string",
  "passport_number": "string",
  "passport_issued_date": "string",
  "passport_issued_by": "string",
  "acceptance_date": "string",
  "work_rate": 0,
  "testing_end_time": "string",
  "contract_end_time": false,
  "holidays": 0,
  "comment": "string",
  "pincode": "string",
  "password": "string",
  "is_free": false,
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ],
  "person_id": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "email": "string",
  "is_supplier": false,
  "is_customer": false,
  "status": "active",
  "short_name": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "67b486d242ed76693cd2cc59",
  "manager_id": "67b486d242ed76693cd2cc59",
  "delivery_address": {
    "lat": 0,
    "long": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "bearing": 0
  },
  "web_site": "string"
}

Ответ

ПолеТипОписание
_idstringid of employee
full_namestring
innstring
phone_numberstring
jshirstring
passport_numberstring
passport_issued_datestring
passport_issued_bystring
acceptance_datestring
work_ratenumberПо умолчанию: 0
testing_end_timestring
contract_end_timestringПо умолчанию: false
holidaysnumberПо умолчанию: 0
commentstring
is_freebooleanПо умолчанию: false
addressstringaddress of employee
genderstringДопустимые значения: male, female
imagestringimage path of employee that uploaded to the server
last_namestring
middle_namestring
birth_datestringdate of birth of employee
legal_person_idstringid of legal person
telegram_linkstringlink of telegram account
emailstringemail of employee
is_supplierbooleanis supplier or not. По умолчанию: false
statusstringstatus of employee. Допустимые значения: active, inactive
short_namestringshort name of employee
web-sitestringweb-site of employee
codestringcode of employee
postal_codestringpostal code of employee
delivery_addressobjectdelivery address of employee
delivery_address.latnumberПо умолчанию: 0
delivery_address.longnumberПо умолчанию: 0
delivery_address.human_addressobject
delivery_address.human_address.addressstring
delivery_address.human_address.citystring
delivery_address.human_address.statestring
delivery_address.human_address.zipstring
numberstringnumber of employee
balance_actionstringaction of balance
is_bossbooleanis boss or not. По умолчанию: false
employment_typestring
salaryobject
salary.is_activeboolean
salary.employee_idstring
salary.organization_idstring
salary.typestringДопустимые значения: fixed, task_by
salary.amountnumberПо умолчанию: 0
salary.currency_idstringid of currency
salary.unitstringДопустимые значения: hour, day
salary_currency_idstringid of currency
boss_idstringid of boss
balanceobject
balance.organization_idstring
balance.payment_method_idstring
balance.currency_idstring
balance.amountnumberПо умолчанию: 0
balance_currency_idstringid of currency
balance_listobject[]
balance_list[]._idstring
balance_list[].amountnumberПо умолчанию: 0
balance_list[].organization_idstring
balance_list[].payment_method_idstring
balance_list[].currency_idstring
positionsobject[]
positions[].organization_idstring
positions[].sectionobject
positions[].section._idstring
positions[].section.is_deletedboolean
positions[].section.completely_deletedboolean
positions[].section.namestring
positions[].positionobject
positions[].position._idstring
positions[].position.is_deletedboolean
positions[].position.completely_deletedboolean
positions[].position.namestring
positions[].roleobject
positions[].role._idstring
positions[].role.is_deletedboolean
positions[].role.completely_deletedboolean
positions[].role.namestring
positions[].role.webboolean
positions[].role.mobileboolean
positions[].role_idstring
is_deletedbooleanПо умолчанию: false
completely_deletedbooleanПо умолчанию: false
created_atstringdate of creation
updated_atstringdate of update
personobject
person._idstringid of person
person.namestringname of person
person.full_namestringlast name of person
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "67b486d242ed76693cd2cc59",
    "full_name": "string",
    "inn": "string",
    "phone_number": "string",
    "jshir": "string",
    "passport_number": "string",
    "passport_issued_date": "string",
    "passport_issued_by": "string",
    "acceptance_date": "string",
    "work_rate": 0,
    "testing_end_time": "string",
    "contract_end_time": false,
    "holidays": 0,
    "comment": "string",
    "is_free": false,
    "address": "string",
    "gender": "male",
    "image": "string",
    "last_name": "string",
    "middle_name": "string",
    "birth_date": "string",
    "legal_person_id": "string",
    "telegram_link": "string",
    "email": "string",
    "is_supplier": false,
    "status": "active",
    "short_name": "string",
    "web-site": "string",
    "code": "string",
    "postal_code": "string",
    "delivery_address": {
      "lat": 0,
      "long": 0,
      "human_address": {
        "address": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      }
    },
    "number": "string",
    "balance_action": "string",
    "is_boss": false,
    "employment_type": "string",
    "salary": {
      "is_active": false,
      "employee_id": "string",
      "organization_id": "string",
      "type": "fixed",
      "amount": 0,
      "currency_id": "string",
      "unit": "hour"
    },
    "salary_currency_id": "string",
    "boss_id": "string",
    "balance": {
      "organization_id": "string",
      "payment_method_id": "string",
      "currency_id": "string",
      "amount": 0
    },
    "balance_currency_id": "string",
    "balance_list": [
      {
        "_id": "string",
        "amount": 0,
        "organization_id": "string",
        "payment_method_id": "string",
        "currency_id": "string"
      }
    ],
    "positions": [
      {
        "organization_id": "string",
        "section": {
          "_id": null,
          "is_deleted": null,
          "completely_deleted": null,
          "name": null
        },
        "position": {
          "_id": null,
          "is_deleted": null,
          "completely_deleted": null,
          "name": null
        },
        "role": {
          "_id": null,
          "is_deleted": null,
          "completely_deleted": null,
          "name": null,
          "web": null,
          "mobile": null
        },
        "role_id": "string"
      }
    ],
    "is_deleted": false,
    "completely_deleted": false,
    "created_at": "string",
    "updated_at": "string",
    "person": {
      "_id": "string",
      "name": "string",
      "full_name": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /employee/update ​

This method allows updating employee in the account.

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

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

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/employee/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "67b486d242ed76693cd2cc59",
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "67b486d242ed76693cd2cc59",
    "full_name": "string",
    "phone_number": "string",
    "accesses": [
      {
        "organization_id": "67b486d242ed76693cd2cc59",
        "positions": [],
        "role_id": "string"
      }
    ]
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "67b486d242ed76693cd2cc59",
        "full_name": "string",
        "phone_number": "string",
        "accesses": [
            {
                "organization_id": "67b486d242ed76693cd2cc59",
                "positions": [],
                "role_id": "string",
            },
        ],
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "_id": "67b486d242ed76693cd2cc59",
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
full_namestringДа
innstringНет
phone_numberstringДа
jshirstringНет
addressstringНет
passport_numberstringНет
passport_issued_datestringНет
passport_issued_bystringНет
acceptance_datestringНет
work_ratenumberНетПо умолчанию: 0
testing_end_timestringНет
contract_end_timestringНетПо умолчанию: false
holidaysnumberНетПо умолчанию: 0
commentstringНет
is_freebooleanНетПо умолчанию: false
accessesobject[]Да
accesses[].organization_idstringДа
accesses[].positionsobject[]Нет
accesses[].positions[].position_idstringДа
accesses[].positions[].section_idstringДа
accesses[].role_idstringНет
person_idstringНетperson id of employee
genderstringНетДопустимые значения: male, female
imagestringНетimage path of employee that uploaded to the server
last_namestringНет
middle_namestringНет
birth_datestringНетdate of birth of employee
legal_person_idstringНетid of legal person
telegram_linkstringНетlink of telegram account
emailstringНетemail of employee
statusstringНетstatus of employee. Допустимые значения: active, inactive
short_namestringНетshort name of employee
codestringНетcode of employee
postal_codestringНетpostal code of employee
owner_idstringНетid of owner
manager_idstringНетid of manager
delivery_addressobjectНетdelivery address of employee
delivery_address.latnumberНетПо умолчанию: 0
delivery_address.longnumberНетПо умолчанию: 0
delivery_address.human_addressobjectНет
delivery_address.human_address.addressstringНет
delivery_address.human_address.citystringНет
delivery_address.human_address.statestringНет
delivery_address.human_address.zipstringНет
delivery_address.bearingnumberНет
web_sitestringНет
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "full_name": "string",
  "inn": "string",
  "phone_number": "string",
  "jshir": "string",
  "address": "string",
  "passport_number": "string",
  "passport_issued_date": "string",
  "passport_issued_by": "string",
  "acceptance_date": "string",
  "work_rate": 0,
  "testing_end_time": "string",
  "contract_end_time": false,
  "holidays": 0,
  "comment": "string",
  "is_free": false,
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ],
  "person_id": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "email": "string",
  "status": "active",
  "short_name": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "67b486d242ed76693cd2cc59",
  "manager_id": "67b486d242ed76693cd2cc59",
  "delivery_address": {
    "lat": 0,
    "long": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "bearing": 0
  },
  "web_site": "string"
}

Ответ

Структура ответа совпадает с POST /employee/create.

DELETE /employee/delete/{id} ​

Delete a employee

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

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

bash
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/employee/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/delete/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/employee/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);

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

Тело запроса не требуется.

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

GET /employee/get-by-id/{id} ​

Get employee using its _id

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

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

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/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/employee/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/employee/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);

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

Тело запроса не требуется.

Ответ

Структура ответа совпадает с POST /employee/create.

GET /employee/get-deleted ​

Get deleted employee ids

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

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

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/get-deleted?deleted_at=DELETED_AT', {
  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/employee/get-deleted?deleted_at=DELETED_AT",
    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/employee/get-deleted?deleted_at=DELETED_AT');
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);

Параметры запроса

ПараметрТипОбязательноОписание
deleted_atstringДа

Тело запроса

Тело запроса не требуется.

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}

POST /employee/get-paging ​

Get employees by paging

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-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/employee/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()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/get-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/employee/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);

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
organization_idstringНет
position_idstringНет
section_idstringНет
searchstringНет
organization_idsstring[]НетOrganization ObjectIds.
access_field_namestringНет
balance_typestringНетДопустимые значения: debt, credit, not_zero, zero
statusstringНетДопустимые значения: active, inactive, all
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "67b486d242ed76693cd2cc59",
  "position_id": "67b486d242ed76693cd2cc59",
  "section_id": "67b486d242ed76693cd2cc59",
  "search": "string",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "access_field_name": "string",
  "balance_type": "debt",
  "status": "active"
}

Ответ

data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.

ПолеТипОписание
_idstringid of employee
full_namestringfull name of employee
numberstringnumber of employee
phone_numberstringphone number of employee
balance_listobject[]
balance_list[]._idstring
balance_list[].amountnumberПо умолчанию: 0
balance_list[].organization_idstring
balance_list[].payment_method_idstring
balance_list[].currency_idstring
person_idstringid of person
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "67b486d242ed76693cd2cc59",
        "full_name": "string",
        "number": "string",
        "phone_number": "string",
        "balance_list": [
          {
            "_id": "string",
            "amount": 0,
            "organization_id": "string",
            "payment_method_id": "string",
            "currency_id": "string"
          }
        ],
        "person_id": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /employee/get-by-phone-number ​

Fetch a single employee by phone number. The number is normalised before lookup, so it may be sent with or without a leading +. Returns 400 when no employee carries that number.

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

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

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

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-phone-number",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "phone_number": "998901234567",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "phone_number": "998901234567"
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
phone_numberstringДаEmployee phone number in international format (required).
json
{
  "phone_number": "998901234567"
}

Ответ

Структура ответа совпадает с POST /employee/create.


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

Bito 2.0 Integration API