# LINE Messenger: Deploy an Endpoint

**Cognigy Support**  
October 24, 2022

Within our **Cognigy.AI** platform you're able to connect your Cognigy resources to your **LINE** channel by using our Line Endpoint integration.

**Inject & Notify**  
You can use the **Inject** and **Notify** functionality with this type of Endpoint. For further details see the [Inject & Notify Documentation](https://docs.cognigy.com/docs/inject-notify) page.

## Description
With the implementation of a LINE Endpoint you can easily connect your **LINE Bot** with Cognigy.AI.

This article covers the necessary steps for connecting your virtual agent to LINE via a LINE Endpoint. If you require more information about assigning a Flow to the Endpoint and setting up the _Data Management,_ see [Endpoints](https://docs.cognigy.com/docs/endpoints).

**LINE@ Account**  
You'll need a **LINE Developer account** to successfully use the LINE Endpoint integration.

## Three Step Deployment Process
1. **Email Address Registration** for a Line@ Account  
2. **Create a LINE Channel** for the usage of the Cognigy Endpoint on [LINE Developers](https://developers.line.me/en/)
3. **Creation and Configuration of a LINE Endpoint** within Cognigy.AI

## 1. Email Address Registration  
[Location: LINE mobile app](https://line.me/en/download)  
Before you can login as a Line developer, you need to setup a Line account in your smartphone and add an email address to it.

Go to the accounts settings in the LINE mobile app ( **Settings/Account**). Tap on **Email Address** to add an email address and a password to your account.

_Line Account Settings_

## 2. Create a LINE Channel  
[Location: LINE@ Developers](https://developers.line.me/en/)

**Requirements**
✔ LINE Account

### 2.1 Login as a LINE Developer  
Go to [LINE Developers](https://developers.line.me/en/). In the upper right corner you'll find the login button (see **Figure 2.1**) which leads you to the login process with your Email Protected Account. Use the email address and password you set up in your smartphone app.

_Figure 2.1: LINE Developers_

### 2.2 Create a LINE Provider  
After a successful login, your account overview will be displayed (see **Figure 2.2**). Click on the **Create New Provider** button to start the creation process. Within this process you just need to enter a valid name for your provider.

_Figure 2.2: @LINE Account Overview_

### 2.3 Create a LINE Channel  
After you've created a LINE Provider in **Step 2.2** you're able to add a channel to this provider. When you go to your provider you'll see three cards for creating a channel. Choose the **Messaging API** card (see **Figure 2.3.1**).

_Figure 2.3.1: Messaging API_

Fill in the required information for the channel creation process and click confirm.

After successfully creating the channel you'll be redirected to your account overview where your provider is listed with the newly created channel (see **Figure 2.3.2**).

_Figure 2.3.2: Provider Overview_

### 2.4 Get the Channel Credentials  
After clicking on the channel of your choice, an overview of all the information about the channel is displayed.

You will need the following values:
- **Channel Secret** (see **Figure 2.4.1**)
- **Channel Access Token** (see **Figure 2.4.2**)

_Figure 2.4.1: Channel Secret_

_Figure 2.4.2: Channel Access Token_

You can store these credentials in a text file or leave the browser tab open. You'll need them for your LINE Endpoint within **Cognigy.AI**.

### 2.5 Disable Auto-Reply Messages  
In your LINE channel settings scroll down to the **Using LINE@ features** section. There you have to disable the **Auto-Reply Messages** feature, so our endpoint can work properly (see **Figure 2.5**).

_Figure 2.5: Auto-Reply Message Section_

## 3. Creation and Configuration of the LINE Endpoint  
Location: Cognigy.AI

**Requirements**  
✔ LINE Channel Access Token  
✔ LINE Channel Secret

### 3.1 Create a LINE Endpoint  
Firstly, you must create an Endpoint of the type _LINE_ (see **Figure 3.1**). To do this, navigate to the _Endpoints_ menu, found under _Deploy_ in the resources panel on the left side of the Cognigy.AI UI. Select _"\+ New Endpoint",_ give the endpoint a name and select LINE from the available options.

_Figure 3.1: LINE Endpoint Creation_

### 3.2 Configure the LINE Endpoint  
Expand the _LINE Setup_ panel (see **Figure 3.2**) at the bottom of the LINE endpoint settings menu and paste the saved channel access token and channel secret ( **Step 2.4**) into the corresponding fields.

_Figure 3.2: LINE Setup_

### 3.3 Get the Endpoint URL  
Move to the top of the Endpoint Configuration menu and copy the _Endpoint URL_ which is displayed above the _General Settings_ (see **Figure 3.3**).

_Figure 3.3: LINE Endpoint General Settings_

## Final Step: Connect Your LINE Channel to the Endpoint  
[Location: LINE Developers](https://developers.line.me/console/)

**Requirements**  
✔ Endpoint URL  
Go to your **LINE Channel** that you've created in **Step 2.3**. Scroll down to the **Messaging settings** section (see **Figure 4.1**).

_Figure 4.1: Messaging Settings Section_

There you have to edit two settings:
- Change **Use webhooks** to **enabled**.
- Enter the **Endpoint URL** you got in **Step 3.3** to the **Webhook URL** field.

**Requirement**  
Make sure that you enable webhooks, else you won't be able to talk to your Cognigy.AI endpoint.

You should be all set up to use the LINE Endpoint you've created with a Flow of your choice.

To test your channel, scroll to the bottom of the channel settings where you can find a QR code (see **Figure 4.2**). Use your smartphone LINE app to scan this QR code and add your channel. Send a message to your channel to test it.

_Figure 4.2: QR code to test your channel_
