> For the complete documentation index, see [llms.txt](https://help.zaapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.zaapi.com/th/integrations/line/how-to-connect.md).

# วิธีเชื่อมต่อ

### ขั้นตอนการเชื่อมต่อ

1. รับ Channel Secret จากบัญชี LINE Official Account [https://manager.line.biz](https://manager.line.biz/)
2. รับ Channel Access Token จาก LINE Developers Console [developers.line.biz](https://developers.line.biz)
3. กรอกข้อมูลเหล่านี้ใน Zaapi แล้วเชื่อมต่อ
4. กลับไปที่ LINE Developers Console แล้วเปิดใช้งาน webhook และ webhook redelivery

{% hint style="warning" %}
ต้องรับ Channel Secret จากบัญชี LINE Official Account และ Channel Access Token จาก LINE Developers Console — ตรวจสอบให้แน่ใจว่าสามารถเข้าถึงทั้งสองรายการได้

หากไม่สามารถเข้าถึง LINE Developers Console ได้ [ติดต่อทีม Zaapi](https://www.zaapi.com/contact-us) เพื่อขอความช่วยเหลือเพิ่มเติม
{% endhint %}

### คำแนะนำฉบับเต็ม

**ขั้นตอนที่ 1: รับ Channel Secret จากบัญชี LINE Official Account**

1. ลงชื่อเข้าใช้บัญชี LINE Official Account [https://manager.line.biz](https://manager.line.biz/)
2. เลือกบัญชี LINE ที่ต้องการเชื่อมต่อ
3. ไปที่ Settings -> Messaging API -> คลิก "Enable Messaging API"

   <div align="center"><figure><img src="/files/045af64c68564499e16a8881d1bc7181be2609ae" alt="" width="563"><figcaption></figcaption></figure></div>
4. สร้าง Provider ใน LINE Developers และระบุ URL นโยบายความเป็นส่วนตัวและข้อกำหนดการใช้งานได้ตามต้องการ
5. ยืนยันและสร้าง Provider
6. บันทึก Channel Secret ไว้ — ต้องใช้ค่านี้ใน Zaapi ภายหลัง

   <div align="center"><figure><img src="/files/b1e672b7c942f839ff1653a6b75c2e3b4588a110" alt="" width="375"><figcaption></figcaption></figure></div>

**ขั้นตอนที่ 2: รับ Channel Access Token จาก LINE Developers Console**

1. ไปที่ LINE Developers Console [developers.line.biz](https://developers.line.biz)
2. เลือก Provider ที่สร้างไว้ข้างต้น
3. เลือกช่องทาง Messaging API และไปที่แท็บ Messaging API

<div><figure><img src="/files/185a3d78c6a49d7639fc28a08f49123695ee4009" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/6caac45fa8fd6cf4a8d20097517e832f1bf4cf06" alt=""><figcaption></figcaption></figure></div>

4. เลื่อนลงไปด้านล่าง แล้วออก Channel access token (long-lived) — ต้องใช้ค่านี้ใน Zaapi ภายหลัง

<div align="center"><figure><img src="/files/3e3d093d8ec8586de2684c8589105c0d3d4023d4" alt="" width="294"><figcaption></figcaption></figure></div>

**ขั้นตอนที่ 3: เชื่อมต่อใน Zaapi และเปิดใช้งาน webhook ใน LINE Developers**

1. ไปที่ส่วนการผสานการทำงาน — ไปที่ Settings > Integrations ใน Zaapi
2. คลิก "LINE Official Account"
3. กรอก Channel Secret และ Access Token ที่ได้รับข้างต้น แล้วคลิก Connect รอให้บัญชี LINE OA แสดงขึ้นมา

<div align="center"><figure><img src="/files/e707395c094544df08ea0747ba4efdc30fb26942" alt="" width="375"><figcaption></figcaption></figure></div>

4. กลับไปที่ [LINE Developers Console](https://developers.line.biz/) แท็บ Messaging API แล้วรีเฟรชหน้า จะเห็น Webhook URL แสดงในส่วนการตั้งค่า Webhook
5. เปิดใช้งานทั้ง "Use webhook" และ "Webhook delivery" สำหรับ Webhook delivery ระบบจะขอให้ยืนยัน ซึ่งสามารถยืนยันได้ ข้อความใหม่จะเริ่มแสดงใน Zaapi

<div align="center"><figure><img src="/files/9e99ddcc7fb934ea2e06cc95a265bdd06be18b00" alt="" width="563"><figcaption></figcaption></figure></div>
