# Kết nối OA

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

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

{% openapi src="<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>" path="$BASE\_URL.Zalo/ConnectOA" 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.Zalo/ConnectOA' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
  "code": "string",
  "oa_id": "int64",
  "state": "integer"
}'
```

**Response:**

```json
{
  "app_id": "string",
  "avatar": "string",
  "connection_id": "string",
  "connection_method": "unknown",
  "cover": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "current_quality": "unknown",
  "daily_quota": 0,
  "description": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "is_verified": true,
  "last_week_quality": "unknown",
  "name": "string",
  "oa_id": "string",
  "onwer_id": "string",
  "remaining_quota": 0,
  "shop_id": "string",
  "status": "Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
```

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

<table><thead><tr><th width="202.33333333333331">Tham số</th><th width="137">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>code</td><td>string</td><td>Code được trả về ở redirect_url khi thực hiện ủy quyền OA cho app</td></tr><tr><td>oa_id</td><td>int64</td><td>ID của OA</td></tr><tr><td>state</td><td>integer</td><td>State được trả về ở redirect_url khi thực hiện ủy quyền OA cho app</td></tr></tbody></table>

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

<table><thead><tr><th width="201.33333333333331">Tham số</th><th width="188">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>app_id</td><td>int64</td><td>ID của ứng dụng</td></tr><tr><td>avatar</td><td>string</td><td>Đường dẫn đến ảnh bìa của OA</td></tr><tr><td>connection_id</td><td>int64</td><td>ID kết nối</td></tr><tr><td>connection_method</td><td>string</td><td><p>Phương thức kết nối</p><p><mark style="color:red;"><strong><code>direct</code></strong></mark></p></td></tr><tr><td>description</td><td>string</td><td>Mô tả</td></tr><tr><td>is_verified</td><td>boolean</td><td><p><mark style="color:red;"><strong><code>True</code></strong></mark>: OA được verify</p><p><mark style="color:red;"><strong><code>False</code></strong></mark>: OA chưa được verify</p></td></tr><tr><td>name</td><td>string</td><td>Tên OA</td></tr><tr><td>oa_id</td><td>int64</td><td>ID của OA</td></tr><tr><td>owner_id</td><td>int64</td><td>ID của chủ shop trên hệ thống eTelecom</td></tr><tr><td>shop_id</td><td>int64</td><td>ID của shop trên hệ thống eTelecom</td></tr><tr><td>status</td><td>string</td><td>Trạng thái<br><mark style="color:red;"><strong><code>P</code></strong></mark>: Đang kết nối<br><mark style="color:red;"><strong><code>N</code></strong></mark>: Ngắt kết nối</td></tr><tr><td>current_quality</td><td>string</td><td><p>Chất lượng gửi thông báo ZNS trong 48 giờ gần nhất của OA.<br></p><ul><li><mark style="color:red;"><strong>HIGH</strong></mark> - Mức độ chất lượng tốt</li><li><mark style="color:red;"><strong>MEDIUM</strong></mark> - Mức độ chất lượng trung bình</li><li><mark style="color:red;"><strong>LOW</strong></mark> - Mức độ chất lượng kém</li><li><mark style="color:red;"><strong>UNDEFINED</strong></mark> - Mức độ chất lượng OA chưa được xác định (trường hợp OA không  gửi thông báo ZNS nào trong khung thời gian đánh giá)</li></ul></td></tr><tr><td>last_week_quality</td><td>string</td><td><p></p><p>Chất lượng gửi thông báo ZNS trong 7 ngày gần nhất của OA.</p><p>Các giá trị trả về:</p><ul><li><mark style="color:red;"><strong>HIGH</strong></mark> - Mức độ chất lượng tốt</li><li><mark style="color:red;"><strong>MEDIUM</strong></mark> - Mức độ chất lượng trung bình</li><li><mark style="color:red;"><strong>LOW</strong></mark> - Mức độ chất lượng kém</li><li><mark style="color:red;"><strong>UNDEFINED</strong></mark> - Mức độ chất lượng OA chưa được xác định (trường hợp OA không gửi thông báo ZNS nào trong khung thời gian đánh giá)</li></ul></td></tr><tr><td>daily_quota</td><td>int</td><td>Số thông báo ZNS OA được gửi trong 1 ngày.</td></tr><tr><td>remaining_quota</td><td>int </td><td>Số thông báo ZNS OA được gửi trong ngày còn lại.</td></tr><tr><td>expires_at</td><td>string&#x3C;date-time></td><td>Thời gian hết hạn của refresh token</td></tr><tr><td>updated_at</td><td>string&#x3C;date-time></td><td>Ngày cập nhật</td></tr><tr><td>created_at</td><td>string&#x3C;date-time></td><td>Ngày tạo</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/zalo-cloud/zalo-cloud-api/ket-noi-oa.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.
