> For the complete documentation index, see [llms.txt](https://developer.chatx.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.chatx.vn/document-chatx/huong-dan-su-dung/ket-noi.md).

# Kết Nối

## Kết Nối Fanpage cùng ChatX

#### Bước 1: Truy cập API của bot Chat

<figure><img src="/files/XFlSrDiq7Cb0eVV7wjF8" alt=""><figcaption></figcaption></figure>

#### Bước 2: Tạo ky API của bot

* Nhấn vào API key
* Nhấn tạo khoá bí mật mới
* Sao chép API key

<figure><img src="/files/SqD4BeSr3W4Tp4f36pqJ" alt=""><figcaption></figcaption></figure>

#### Bước 3: Truy cập Smax.bot

* Thử nghiệm miễn phí&#x20;
* Đăng nhập bằng tài khoản sở hữu page

<div align="center"><figure><img src="/files/BinsfdewXCQn67QvXAQU" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/qqdYK66N2uYyI2jytt3x" alt=""><figcaption></figcaption></figure>

#### Bước 4: tạo 1 bot trống mới, sau đó click vào bot

<figure><img src="/files/tKghzjaa5QlbJ0SeIyL5" alt=""><figcaption></figcaption></figure>

#### Bước 5: Kết nối với page nhấn vào Connect Page

<figure><img src="/files/NbWbwTfSlSAgpvEyOToX" alt=""><figcaption></figcaption></figure>

#### Bước 6: Chọn Default Block  sau đó nhấn vào hình cái bút&#x20;

<figure><img src="/files/l1Mm6Z28JZ4wHyiGKfna" alt=""><figcaption></figcaption></figure>

#### Bước 7:&#x20;

1. Chọn Json API rồi kéo vào Block
2. Chọn Post sau đó paste <https://app.chatx.vn/v1/chat-messages> vào URL&#x20;

<figure><img src="/files/L2qf3Nw7u7WEqsboFLUx" alt=""><figcaption></figcaption></figure>

3. Tạo 2 add header  sau đó paste như hình

`Authorization`: `Bearer {api_key}` (là key vừa tạo ở bước 2)

`Content-Type`: `application/json`

<figure><img src="/files/xQ0vlktmSisTBTRM2pXf" alt=""><figcaption></figcaption></figure>

4. Chọn json sau đó paste

```
{
    "inputs": {},
    "query": "{{last content by user}}",
    "response_mode": "blocking",
    "conversation_id": "{{chat-id}}",
    "user": "{{full name}}",
    "files": [
      {
        "type": "image",
        "transfer_method": "remote_url",
        "url": "https://cloud.chatx.vn/logo/logo-site.png"
      }
    ]
}
```

5. Tạo 2 Add Path  với nội dung sau:

* paste `answer` vào ô thứ nhất gõ “`{{answer`” vào ô thứ 2 sau đó nhấn `add item`&#x20;

<figure><img src="/files/NCB60ulOeuVsdUni9FhH" alt=""><figcaption></figcaption></figure>

* paste `conversation_id` vào dòng thứ 2 sau đó “`{{chat-id`” nhấn `Add item`

<figure><img src="/files/TI1SMdL0DAePFhDEzWhF" alt=""><figcaption></figcaption></figure>

#### Kết quả như này nhé&#x20;

<figure><img src="/files/7PmgA4FXS4NV43ecqPsH" alt=""><figcaption></figcaption></figure>

#### Bước 8: Thêm thẻ text và chọn `{{answer}}` trong phần text&#x20;

<figure><img src="/files/T7FPLGOf9qOBiK0NMPR3" alt=""><figcaption></figcaption></figure>

## Xem video hướng dẫn chi tiết tại [đây](https://drive.google.com/file/d/1xWgXIZTsUmz7TzRy_3Qia3KjqkWrhq4Z/view?usp=drive_link).

#### Rồi kiểm tra page nhé 😘😘😘

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://developer.chatx.vn/document-chatx/huong-dan-su-dung/ket-noi.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.
