> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-ja/conversations/line.md).

# 対話プラットフォーム連携：LINE

## <mark style="color:blue;">連携前の確認</mark> <a href="#pre-integration-checklist" id="pre-integration-checklist"></a>

* [MaiAgent プラットフォーム](https://admin.maiagent.ai/)上で「AI アシスタント」をすでに作成済みであること
* [LINE Developers](https://developers.line.biz/zh-hant/) の console プラットフォームで「Provider」と LINE 公式アカウント (Official Account) をすでに作成済みであること

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

## <mark style="color:blue;">連携を開始する</mark> <a href="#start-integration" id="start-integration"></a>

### 1. <https://manager.line.biz/> にアクセスし、連携したい公式アカウントを選択する <a href="#step-select-line-official-account" id="step-select-line-official-account"></a>

MaiAgent Testing をクリックします。

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

クリックすると、公式アカウントの設定画面に入ります。

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

### 2. 右上の設定 (Settings) をクリックする <a href="#step-open-settings" id="step-open-settings"></a>

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

続いて以下の画面に入り、左側の Messaging API リストをクリックします。

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

### 3. Messaging API サービスを有効化する <a href="#step-enable-messaging-api" id="step-enable-messaging-api"></a>

a. 画面に入ったら、<mark style="color:blue;">Enable Messaging API</mark> をクリックします。

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

b. 先ほど作成した Provider を選択します（まだ作成していない場合でも、このページで Provider を作成できます）。

選択が完了したら<mark style="color:blue;">確認 (Agree)</mark> を押します。

<figure><img src="/files/9qG7IupD11tTbKA7A5m4" alt=""><figcaption></figcaption></figure>

c. プライバシーポリシーなどの文書を入力する（任意）

次のステップでは、貴社内部のプライバシーポリシーなどの文書 URL を入力できます。完了したら「ok」を押して、次の最終確認ステップに進みます。

<figure><img src="/files/0QcYLkFAXbbxlaJyubeM" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
最後に ok を押す前に、連携している Provider が正しいか今一度ご確認ください。ok を押した後は元に戻せません。
{% endhint %}

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

### 4. <mark style="color:blue;">Channel ID</mark>、<mark style="color:blue;">Channel Secret</mark>、<mark style="color:blue;">Channel Access Token</mark> を取得する <a href="#step-get-channel-credentials" id="step-get-channel-credentials"></a>

a. OK を押すと、その Messaging API サービスの <mark style="color:blue;">Channel ID</mark> と <mark style="color:blue;">Channel secret</mark> を取得できます。

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

b. [LINE Developers ](https://developers.line.biz/console/)ページに戻り、Channel Access Token を取得します。

先ほど作成した MaiAgent Provider に入ります。

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

c. 先ほど作成した MaiAgent Testing Channel を見つけ、クリックして入ります。

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

d. Messaging API ページに切り替え、Channel access token のエリアまで下にスクロールします。

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

e. <mark style="color:blue;">Channel access token</mark> を発行してコピーする

まだ <mark style="color:blue;">Channel access token</mark> を発行していない場合は、<mark style="color:blue;">Issue</mark> をクリックします。

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

続いて、<mark style="color:blue;">Channel access token</mark> を取得し、コピーして使用できます。

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

### 5. MaiAgent の対話プラットフォームにアクセスし、LINE を選択する <a href="#step-select-line-in-maiagent" id="step-select-line-in-maiagent"></a>

a. 右上の<mark style="color:blue;">対話プラットフォーム連携</mark>をクリックします。

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

b. 連携プラットフォームとして LINE を選択します。

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

### 6. 名称を入力し、アシスタントを選択して、**先ほど取得した Channel ID、Channel Secret、**&#x43;hannel Access Token を貼り付ける <a href="#step-fill-channel-credentials" id="step-fill-channel-credentials"></a>

* **名称：**&#x30A6;ェブサイト上で表示したい AI アシスタントの名称
* **AI アシスタント：**&#x9023;携する AI アシスタントを選択
* **LINE チャネル：**「Channel ID」「Channel Secret」「Channel Access Token」を入力

完了したら右下の「対話プラットフォーム連携」ボタンを押すと、対話プラットフォームの準備が整います。

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

### 7. Webhook URL を取得する <a href="#step-get-webhook-url" id="step-get-webhook-url"></a>

対話プラットフォームで先ほど作成した LINE チャネルを選択し、操作をクリックして、API ブロックで Webhook URL を取得します。

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

### 8. <https://manager.line.biz/> で「Settings/Messaging API」をクリックし、先ほど取得した Webhook URL を貼り付ける <a href="#step-set-webhook-url-in-line" id="step-set-webhook-url-in-line"></a>

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

### 9. <https://developers.line.biz/console/> で先ほど作成した Messaging API チャネルに再度戻り、対話設定を行う <a href="#step-configure-messaging-api-channel" id="step-configure-messaging-api-channel"></a>

Auto-reply messages で <mark style="color:blue;">Edit</mark> ボタンをクリックします。

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

応答設定を下図のように調整します。

<figure><img src="/files/8NwXNYy3hNq9B0KJxIcZ" alt=""><figcaption></figcaption></figure>

### **10. 連携が成功したか確認する** <a href="#step-verify-integration" id="step-verify-integration"></a>

ご自身の LINE で **AI アシスタント**アカウントを友だち追加し、対話を試してみてください。

<figure><img src="/files/3LZ3lCyv4XnQTWYTlSwy" alt=""><figcaption></figcaption></figure>

関連する対話が <https://manager.line.biz/> と MaiAgent のすべての対話で確認できれば、連携成功です。

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

## ⚠️ 重要な注意事項 <a href="#important-notes" id="important-notes"></a>

**制限事項**

* LINE グループには 1 つの AI アシスタントしか追加できません
* 新しく追加された AI アシスタントは、以前のものを自動的に削除します


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-ja/conversations/line.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
