🇹🇭 วิธีสร้าง LINE OA เพื่อนำมาทำ Bot ต่าง ๆ ผ่าน Messaging API
ใครที่อยากทำบอทใน LINE ไม่ว่าจะเป็นบอทเก็บไฟล์ บอทตอบแชท หรือบอทต่อกับ automation ต่าง ๆ จุดเริ่มต้นเหมือนกันหมดค่ะ นั่นคือต้องมี LINE Official Account (LINE OA) ที่เปิดใช้ Messaging API ให้เรียบร้อยก่อน บทความนี้สรุปจากคลิปของช่อง Lin Davoy ที่พาทำทีละคลิกตั้งแต่ศูนย์จนได้ของครบ 2 ชิ้นที่บอททุกตัวต้องใช้ คือ Channel Access Token กับช่องใส่ Webhook URL ค่ะ
สเต็ปที่ 1 — สร้าง LINE OA ที่ manager.line.biz
เข้าไปที่เว็บ manager.line.biz แล้วกด Create New ได้เลยค่ะ บัญชี LINE OA สร้างได้หลายตัวมาก (ในคลิปมีอยู่ 13 ตัวแล้วก็ยังสร้างเพิ่มได้เรื่อย ๆ) ลิมิตจริง ๆ มีอยู่แต่สำหรับคนทั่วไปใช้ไม่ถึงแน่นอน จากนั้นตั้งชื่อบัญชี เช่นในคลิปตั้งว่า “ไฟล์ไม่หายตลอดไป” เลือกประเภทธุรกิจอะไรก็ได้ กรอกอีเมล แล้วกดเสร็จสิ้น เท่านี้ก็ได้ LINE OA มาแล้ว 1 ตัว ถ้าใครมาแอดก็จะเจอบัญชีนี้ ส่วนเรื่องการจัดการเพื่อน/ผู้ติดตามจะไปเซตทีหลังก็ได้ ในเคสที่ทำบอทเก็บไฟล์เราไม่ต้องยุ่งตรงนั้นเลยค่ะ
สเต็ปที่ 2 — ปิด auto-response แล้วเตรียมเปิด webhook
เข้า Settings ที่มุมบนขวา แล้วไปที่ Response settings ค่ะ เพราะเราจะใช้ OA ตัวนี้เป็นบอทผ่าน API ไม่ได้อยากให้มันตอบเอง ให้ปิด welcome message (ข้อความต้อนรับตอนมีคนแอดหรือ unblock) และปิด auto-response message (ที่ตอบตามคีย์เวิร์ด) ทิ้งไปเลย สิ่งเดียวที่เราต้องการคือ webhook แต่จะสังเกตว่าตอนแรกสวิตช์ webhook ยังเปิดไม่ได้ เพราะต้องไป enable Messaging API ก่อนค่ะ
สเต็ปที่ 3 — เปิดใช้ Messaging API และสร้าง Provider
ไปที่ Messaging API settings แล้วกด Enable Messaging API ค่ะ ระบบจะให้เลือกหรือสร้าง Provider ถ้ายังไม่มีก็สร้างใหม่ได้เลย เช่นตั้งชื่อว่า n8n ตามเครื่องมือที่จะเอาไปต่อ กด Agree แล้วกด OK (ช่อง URL ต่าง ๆ ยังไม่ต้องใส่ก็ได้) พอเสร็จแล้วระบบจะสร้างฝั่ง Developer ให้เรา และมีลิงก์พาไปที่ LINE Developers Console ซึ่งเปิดมาอีกหน้าหนึ่ง ในนั้นจะเห็น Provider ที่เพิ่งตั้ง และมี channel ชื่อเดียวกับ LINE OA ของเราอยู่ข้างในเรียบร้อยค่ะ
สเต็ปที่ 4 — Issue Channel Access Token
ใน LINE Developers Console ให้ไปที่แท็บ Messaging API แล้วเลื่อนลงล่างสุด จะเจอสิ่งที่เรียกว่า Channel Access Token ให้กดปุ่ม Issue ค่ะ Token ตัวนี้สำคัญมาก เพราะมันคือหลักฐานยืนยันตัวตน (authorization) ที่บอก LINE ว่าเราเป็นเจ้าของ channel นี้จริง ๆ เวลาบอทของเราจะยิง API ไปดึงข้อความหรือไฟล์ LINE จะเช็คจาก Token ตัวนี้แหละค่ะ
สรุป: ของ 2 ชิ้นที่ต้องได้ก่อนไปทำบอท
จบขั้นตอนนี้เราจะมีของครบ 2 ชิ้นที่บอททุกตัวต้องใช้ คือ (1) Channel Access Token สำหรับยืนยันตัวตนกับ LINE และ (2) ช่อง Webhook URL ที่เราจะเอา URL จากเครื่องมือ automation อย่าง n8n มาวาง ในมุมคนทำงานจริง ขั้นตอนทั้งหมดนี้ใช้เวลาไม่กี่นาทีและทำครั้งเดียวจบ จากนั้นจะต่อยอดไปทำบอทเก็บไฟล์ บอทสรุปแชท หรือบอทอะไรก็ได้ตามต้องการ ภาคต่อของการเอาไปใช้งานจริงดูได้ในคลิปถัดไปของช่อง สรุปจากคลิปของช่อง Lin Davoy ค่ะ
🇬🇧 How to Create a LINE Official Account for Building Bots (Messaging API)
Every LINE bot — a file archiver, an auto-responder, anything you wire into an automation tool — starts from the same place: a LINE Official Account (LINE OA) with the Messaging API enabled. This post, summarized from a video on the Lin Davoy channel, walks through the setup click by click until you hold the two things every bot needs: a Channel Access Token and the Webhook URL field.
Step 1 — Create the LINE OA at manager.line.biz
Go to manager.line.biz and hit Create New. You can create many OAs — the video shows an account with 13 bots and counting; the practical limit is far beyond what most people need. Name the account (the video uses “Files Never Lost”), pick any business category, enter your email, and finish. That is your LINE OA. Friend management settings exist, but for an API bot you can skip them entirely.
Step 2 — Turn off auto-responses, aim for webhook-only
Open Settings (top right) and go to Response settings. Since the bot will be driven by the API, switch off the welcome message (sent when someone adds or unblocks the account) and the keyword-based auto-response messages. The only feature you want is the webhook — but you will notice the toggle cannot be enabled yet, because the Messaging API must be activated first.
Step 3 — Enable Messaging API and create a Provider
In Messaging API settings, click Enable Messaging API. You will be asked to choose or create a Provider — create a new one (the video names it n8n after the automation tool it will connect to), agree to the terms, and confirm; the optional URL fields can stay empty. LINE then sets up the developer side and links you to the LINE Developers Console, where you will find your new Provider containing a channel with the same name as your LINE OA.
Step 4 — Issue the Channel Access Token
Inside the LINE Developers Console, open the Messaging API tab and scroll to the very bottom to find the Channel Access Token. Click Issue. This token is your proof of ownership — whenever your bot calls the LINE API to fetch messages or files, LINE verifies you through it.
Wrap-up: the two things you leave with
After this setup you have the two essentials for any LINE bot: (1) the Channel Access Token for authentication, and (2) the Webhook URL field where you will paste the URL from your automation tool such as n8n. From a practitioner’s point of view this is a one-time, few-minutes job that unlocks everything — file-archiving bots, chat-summary bots, and more. See the follow-up video on the channel for putting it to work. Summarized from the Lin Davoy channel.
ติดตามข่าวสาร Data & AI ได้ที่:
Facebook: https://www.facebook.com/davoytech
YouTube: https://www.youtube.com/@linlinmhee
📌 อย่าลืมกด Like, Share และ Subscribe เป็นกำลังใจให้ด้วยนะคะ!
💬 ถ้าได้ LINE OA มาแล้ว คุณอยากลองทำบอทแบบไหนเป็นตัวแรกคะ? บอทเก็บไฟล์ บอทตอบลูกค้า หรือบอทสรุปแชท มาเล่าไอเดียกันในคอมเมนต์ได้เลยนะคะ
#Davoy #DavoyTech #Linlinmhee #เรียนAI #คอร์สAI #DataAndAI #LINEOA #LINEBot #MessagingAPI #Chatbot #Automation
