# API tiêu chí kịch bản

#### API : Ưu tiên nhân viên quản lý khách hàng

OMICall hỗ trợ gọi API chủ động sang bên đối tác CRM, CMS, ERP ... đế lấy thông tin người phụ trách khách hàng theo số điện thoại , khi doanh nghiệp không muốn lưu trữ KH ở OMI

Đối tác cần chuẩn bị API theo yêu cầu sau

1. API dạng GET
2. Chứng thực bằng dạng KEY Header (X-API-KEY). Key do OMICall cung cấp
3. Response là dạng Text với format : 101:102:104 (Trong đó các giá trị là số máy lẻ (extension) của nhân viên
4. Trường hợp không có người phụ trách : Trả về empty, hệ thống sẽ tự chuyển vào kịch bản tiếp theo
5. Timeout request chỉ cho phép là 2s&#x20;

## API lấy người phụ trách theo số điện thoại

<mark style="color:blue;">`GET`</mark> `https://demo.crm.com.vn/get_owner_contact_by_phone?phoneNumber=&sipNumber=`

#### Query Parameters

| Name                                          | Type   | Description               |
| --------------------------------------------- | ------ | ------------------------- |
| phoneNumber<mark style="color:red;">\*</mark> | String | Số điện thoại KH gọi vào  |
| sipNumber                                     | String | Số hotline khách hàng gọi |

#### Headers

| Name                                        | Type   | Description             |
| ------------------------------------------- | ------ | ----------------------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String | API KEY do OMI cung cấp |

{% tabs %}
{% tab title="200: OK " %}
101:102:100
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.omicall.com/omicall-api/api-tieu-chi-kich-ban.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
