> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pathors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LINE Bot 整合快速入門指南

> 學習如何在 Pathors 中快速整合 LINE Bot，包括 Messaging API、Channel Secret、Access Token 獲取等

## 概述

本教學將指導你如何在 Pathors 中整合 LINE Bot，包含 provider 建立、Messaging API、LINE login、access token、channel secret 獲取與 webhook 設置。

## 步驟 1：建立 Provider

1. 前往 [LINE Developers 控制台](https://developers.line.biz/console/)
2. 點擊「Create a new provider」，輸入 provider 名稱（只能輸入中文）

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step1-create-provider.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=165207185933c52223f16becbbc2cb2a" alt="建立 Provider" width="2672" height="1440" data-path="images/linebot/step1-create-provider.png" />
</Frame>

## 步驟 2：建立 Messaging API

1. 由於 Messaging API 已改版，需前往 [專用表單](https://entry.line.biz/form/entry/unverified) 創建 Messaging API
2. 填寫相關資料（帳號名稱、郵箱、公司信息等），提交後即可建立

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step2-messaging-api-form.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=a916dac4d3ca21288ae86ca973b8ac64" alt="Messaging API 建立表單" width="2672" height="1440" data-path="images/linebot/step2-messaging-api-form.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step3-messaging-api-form-filled.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=3bc2f3203bc248109b921d730c9bcbb4" alt="填寫資料後建立 Messaging API" width="2672" height="1440" data-path="images/linebot/step3-messaging-api-form-filled.png" />
</Frame>

3. 建立後，需在頁面點擊「啟用 Messaging API」

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step4-enable-messaging-api.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=b0891f30074db1d9aa3b2d963abc6f59" alt="啟用 Messaging API" width="2672" height="1440" data-path="images/linebot/step4-enable-messaging-api.png" />
</Frame>

## 步驟 3：建立 LINE login

1. 在 provider 下選擇「Create a LINE Login channel」
2. 按照頁面指引填寫相關信息

## 步驟 4：取得 Channel Secret 與 Access Token

1. 前往 [LINE Biz 管理後台](https://manager.line.biz/account/)
2. 選擇剛剛創建的 Messaging API

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step5-biz-select-messaging-api.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=24f47934d072bb10607f11204b2251fc" alt="選擇 Messaging API 並進入設定" width="2672" height="1440" data-path="images/linebot/step5-biz-select-messaging-api.png" />
</Frame>

3. 點擊右上角「設定」
4. 在左側菜單選擇「Messaging API」

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step6-biz-messaging-api-menu.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=ea7ee0a27e76ad21d5f78e639f022eab" alt="點擊 Messaging API 菜單" width="2672" height="1440" data-path="images/linebot/step6-biz-messaging-api-menu.png" />
</Frame>

5. 可在頁面上找到 Channel Secret，並可設定 webhook URL

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step7-set-webhook-and-get-secret.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=5a093a3bcdcd4fa03e0ba95341b43ec2" alt="設定 webhook 與取得 Channel Secret" width="2672" height="1440" data-path="images/linebot/step7-set-webhook-and-get-secret.png" />
</Frame>

6. 點擊「Channel access token」按鈕，依指引取得 long live channel access token

<Frame>
  <img src="https://mintcdn.com/pathorstechnology/KdB-f_Xl4XvHDQAi/images/linebot/step8-issue-access-token.png?fit=max&auto=format&n=KdB-f_Xl4XvHDQAi&q=85&s=69af3e165a239554dacff610140c39bf" alt="取得 Channel Access Token" width="2672" height="1440" data-path="images/linebot/step8-issue-access-token.png" />
</Frame>

* 參考官方文檔：[issue long live channel access token](https://developers.line.biz/en/docs/basics/channel-access-token/#long-lived-channel-access-token)

## 常見問題

* Channel access token 與 channel secret 都不可或缺，需分別於 Messaging API 與 LINE login 頁面取得
* webhook URL 可在 Messaging API 頁面設定

## 相關資源

* [LINE Developers 官方文檔](https://developers.line.biz/zh-hans/docs/)
