# Tạo máy nhánh

{% hint style="info" %}
**Lưu ý:**

* Đối với các API sử dụng cho Shop thì API\_KEY: [`<api_key>`](/tich-hop-api/shop/tai-khoan.md#api-key).Thông tin base\_url của [Shop](/tich-hop-api/shop/tai-khoan.md)
* Đối với các API sử dụng cho Partner thì API\_KEY: [`<shop_key>`](/tich-hop-api/partner/su-dung.md#ket-noi-lan-thu-hai-tro-di).Thông tin base\_url của [Partner](/tich-hop-api/partner/tai-khoan.md)
  {% endhint %}

{% openapi src="/files/N9gsIXHbM9SnjpzOZHTn" path="$BASE\_URL.Etelecom/CreateExtension" method="post" %}
[swagger\_partner\_v2.json](https://4211996220-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9CUTEBoYNqJaZqxNp3Eh%2Fuploads%2FPioshmLP8r8z5BiNIuvH%2Fswagger_partner_v2.json?alt=media\&token=cc33298f-4b27-4180-9cdf-89d6e1ed3935)
{% endopenapi %}

**Request:**

```json
curl --location '$BASE_URL.Etelecom/CreateExtension' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
  "extension_number": 1001,
  "hotline_id": "string",
  "user_id": "string"
}'
```

**Response Sample:**

```json
{
  "account_id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "extension_number": "string",
  "extension_password": "string",
  "hotline_id": "string",
  "id": "string",
  "state": "Z",
  "subscription_id": "string",
  "tenant_domain": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "user_id": "string"
}
```

**Cấu trúc body của request:**

| Tên trường                                                           | Kiểu dữ liệu | Mô tả                      |
| -------------------------------------------------------------------- | ------------ | -------------------------- |
| <p>hotline\_id<br><mark style="color:red;">required</mark></p>       | string       | ID hotline                 |
| <p>extension\_number<br><mark style="color:red;">required</mark></p> | int          | Số máy nhánh               |
| user\_id                                                             | string       | ID nhân viên gán máy nhánh |

**Cấu trúc thuộc tính dữ liệu trả về:**

<table><thead><tr><th>Tên trường</th><th width="221.33333333333331">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>ID máy nhánh</td></tr><tr><td>user_id</td><td>string</td><td>ID nhân viên gán máy nhánh</td></tr><tr><td>account_id</td><td>string</td><td>ID tài khoản</td></tr><tr><td>extension_number</td><td>string</td><td>Số máy nhánh</td></tr><tr><td>extension_password</td><td>string</td><td>Mật khẩu máy nhánh</td></tr><tr><td>tenant_id</td><td>string</td><td>ID của tổng đài</td></tr><tr><td>tenant_domain</td><td>string</td><td>Domain của tổng đài</td></tr><tr><td>hotline_id</td><td>string</td><td>ID của hotline</td></tr><tr><td>created_at</td><td>string</td><td>Thời gian khởi tạo máy nhánh</td></tr><tr><td>updated_at</td><td>string</td><td>Thời gian cập nhật máy nhánh</td></tr><tr><td>expires_at</td><td>string</td><td>Thời gian hết hạn máy nhánh</td></tr><tr><td>subscription_id</td><td>string&#x3C;date-time></td><td>ID đăng ký</td></tr><tr><td>state</td><td>string</td><td><p>Trạng thái</p><p><mark style="color:red;"><strong><code>Z</code></strong></mark>: Mới tạo<br><mark style="color:red;"><strong><code>P</code></strong></mark>: Còn hạn<br><mark style="color:red;"><strong><code>N</code></strong></mark>: Hết hạn</p></td></tr></tbody></table>


---

# 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://docs.etelecom.vn/tich-hop-api/tong-dai/api-tong-dai/tao-may-nhanh.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.
