> 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/tech/en/serve/whatislineliff/setting.md).

# LINE LIFF: How to Integrate

LINE LIFF integration steps: create a LIFF app in LINE Developers and set the conversation platform's public URL as the Endpoint URL to open Web Chat within a LINE chat window.

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

* You have created a “Website” conversation platform on the [MaiAgent platform](https://admin.maiagent.ai/).
* You have created a “Provider” and a “LINE Login” channel in the [LINE Developers](https://developers.line.biz/zh-hant/) console.

<figure><img src="https://3415477754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNBTi475lqozGpB7xObpE%2Fuploads%2Fgit-blob-dd3350c5121d7228cf1e7f5b7de7a63f86c2ff5b%2Fimage%20(4)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3415477754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNBTi475lqozGpB7xObpE%2Fuploads%2Fgit-blob-3a561089a06f504505da12ec371b943e79e2a24d%2Fimage%20(2)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">Setup Steps:</mark>

1\. In the [LINE Developers](https://developers.line.biz/zh-hant/) console, name your **LIFF app** in the “**LIFF app name**” field on the LIFF detail page.

**2. Size**: Select **Full**.

**3. Endpoint URL**

Copy the conversation platform's “**Public Access URL**” into the “**Endpoint URL**” field and append “**/line-liff/**”.

4\. In the **Scopes** field, select both **openid** and **profile**.

{% hint style="warning" %}
**openid** must be selected. MaiAgent uses the ID token issued by LINE to verify the user's identity with LINE. Only after verification succeeds are conversations recorded under that LINE user. If openid is not selected, users can still chat on the LIFF page, but conversations are recorded under anonymous contacts, and the LINE user's name and profile picture are not visible in the admin console. For a LIFF app that is already live, return to the LIFF detail page, select openid, and click “Update”.
{% endhint %}

5\. In the **Add friend option** field, select \*\*\*\*On (normal).

6\. Click the “Save” button at the bottom of the page, then return to the LIFF detail page. You will see that the system has generated a **LIFF ID. Append this ID to** the URL after “.../line-liff/” in the “Endpoint URL” field, then click “**Update**”.

7\. Finally, go to the top of the page and set this **LIFF** app to <mark style="color:blue;">**Published**</mark> to complete setup and go live.

<figure><img src="https://3415477754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNBTi475lqozGpB7xObpE%2Fuploads%2Fgit-blob-f3f2b36fbf9047e6fe13237a1e5ae7b01fc53eda%2Fimage%20(7).png?alt=media" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">Start Using It!</mark>

1. “**LIFF URL**” is the URL for this **LIFF** app.
2. Users who open the “**LIFF URL**” link in a LINE chat (via a rich menu) are taken to the Web Chat page to chat with the Agent. The MaiAgent admin console can then receive user and conversation information.

<figure><img src="https://3415477754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNBTi475lqozGpB7xObpE%2Fuploads%2Fgit-blob-6abe39cd45ce7f907a720c43bac23b24365d18a8%2Fimage%20(9).png?alt=media" alt="" width="188"><figcaption></figcaption></figure>

### <mark style="color:blue;">Contact Synchronization Behavior and Limitations</mark> <a href="#contact-sync-behavior" id="contact-sync-behavior"></a>

1. **How contacts are created**: When a user opens Web Chat through LIFF and sends a message, MaiAgent creates a contact on this conversation platform using the user's **LINE User ID**. When the same user chats again, the contact's **name** and **profile picture** are updated.
2. **Only data within the openid and profile scopes is retrieved**: LIFF retrieves only the ID token used for identity verification and the LINE profile (LINE User ID, display name, and profile picture). It **cannot retrieve phone numbers, Email**, or other personal information.
3. **Contacts are matched within each conversation platform**: Contacts are matched by LINE User ID only within the same conversation platform and are not merged across platforms. If the same user arrives through a **LINE Official Account** (a LINE conversation platform) and a **LIFF web page** (a Website conversation platform), they appear as **two separate contacts** in the admin console.
4. **The LINE Login channel and Messaging API channel must be under the same Provider**: LINE User IDs are specific to each Provider. The same user receives different LINE User IDs under different Providers. Create the LINE Login channel used by LIFF and the LINE Official Account's Messaging API channel under the same Provider so that contacts on both sides share the same LINE User ID, making it easier to identify the same user.

{% hint style="info" %}
To synchronize member information (such as member IDs and membership levels) to contacts, see [Contact Overview and Integration](/tech/en/serve/contacts.md) and [Contact Identity Synchronization and Token Updates](/tech/en/serve/contacts/contact-credentials-sync.md).
{% endhint %}

### <mark style="color:blue;">Use Cases</mark>

Rich menu links in Official Accounts, online store integration, membership system integration, event registration systems, and customer service systems


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/tech/en/serve/whatislineliff/setting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
