# Integrate Chat Platform: LINE

## <mark style="color:blue;">Pre-Connection Checklist</mark>

* You have already created an "AI Assistant" on the [MaiAgent Platform](https://admin.maiagent.ai/)
* You have already created a "Provider" and a LINE Official Account on the [LINE Developers](https://developers.line.biz/zh-hant/) console platform

<figure><img src="/files/4NIBQAbpgXt7uFzZuQJP" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">Start Connection</mark>

### 1. Go to <https://manager.line.biz/> and select the Official Account you want to connect

Click on MaiAgent Testing:

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

After clicking, you will enter the Official Account settings screen:

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

### 2. Click on Settings in the upper right corner

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

Then enter the following screen and click on the Messaging API list on the left:

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

### 3. Enable Messaging API Service

a. After entering, click <mark style="color:blue;">Enable Messaging API</mark>

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

b. Select the Provider you just created (if you haven't created one yet, you can still create a Provider on this page)

After making your selection, click <mark style="color:blue;">Agree</mark>

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

c. Submit privacy policy and other documents (optional)

In the next step, you can enter the URL of your company's internal privacy policy and other documents. After completion, click "ok" to proceed to the final confirmation.

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

{% hint style="danger" %}
Before clicking ok, please confirm again that the Provider you are connecting to is correct. Once you click ok, it cannot be undone
{% endhint %}

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

### 4. Obtain <mark style="color:blue;">Channel ID</mark>, <mark style="color:blue;">Channel Secret</mark>, <mark style="color:blue;">Channel Access Token</mark>

a. After clicking OK, you can obtain the <mark style="color:blue;">Channel ID</mark> and <mark style="color:blue;">Channel secret</mark> for the Messaging API service:

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

b. Return to the [LINE Developers](https://developers.line.biz/console/) page to obtain the Channel Access Token

Enter the MaiAgent Provider you just created

<figure><img src="/files/2KmBmsKBzvr9wUxL5gwE" alt=""><figcaption></figcaption></figure>

c. Find the MaiAgent Testing Channel you just created and click to enter

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

d. Switch to the Messaging API page and scroll down to the Channel access token section

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

e. Issue and copy the <mark style="color:blue;">Channel access token</mark>

If you haven't issued a <mark style="color:blue;">Channel access token</mark> yet, please click <mark style="color:blue;">Issue</mark>:

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

Then you can obtain and copy your <mark style="color:blue;">Channel access token</mark>:

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

### 5. Go to your MaiAgent chat platform and select LINE

a. Click on <mark style="color:blue;">Connect Chat Platform</mark> in the upper right corner

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

b. Select LINE as the connection platform

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

### 6. Enter the name, select the assistant, and paste the Channel ID, Channel Secret, and Channel Access Token you just obtained

* **Name:** The AI assistant name you want to display on the website
* **AI Assistant:** Select the AI assistant you want to connect
* **LINE Channel:** Enter your "Channel ID", "Channel Secret", "Channel Access Token"

After completion, click the "Connect Chat Platform" button in the lower right corner, and the chat platform will be ready.

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

### 7. Obtain Webhook URL

Go to the chat platform, select the LINE channel you just created, click on operations, and obtain the Webhook URL in the API section

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

### 8. On <https://manager.line.biz/>, click "Settings/Messaging API" and paste the Webhook URL you just obtained

<figure><img src="/files/85PhuM4WiCpD4afxX7B8" alt=""><figcaption></figcaption></figure>

### 9. Return to the Messaging API channel you just created on <https://developers.line.biz/console/> to configure chat settings

Click the <mark style="color:blue;">Edit</mark> button under Auto-reply messages

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

Adjust the response settings as shown below

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

### **10. Verify successful connection**

You can try adding your own LINE **AI Assistant** account for a conversation

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

If the related conversations can be viewed on <https://manager.line.biz/> and in all MaiAgent conversations, it means the connection was successful!

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

## ⚠️ Important Notes

**Restrictions**

* A LINE group can only add one AI assistant
* Newly added AI assistants will cause the previous one to be automatically removed


---

# Agent Instructions: 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://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/release/line.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.
