# LINE OA Streaming Export Integration

LINE Official Account (LINE OA) Streaming Export Integration enables real-time message delivery to LINE users as part of Treasure Data's activation workflows.

With this integration, you can send messages to LINE users instantly using real-time trigger activations.

## Prerequisites

- Basic knowledge of Treasure Data
- Basic knowledge of LINE Official Account and LINE Messaging API
- Access to a LINE Official Account with Messaging API enabled
- Channel access token and secret for your LINE OA


## Use Cases

The primary use case for this streaming integration is to incorporate it into a real-time activation workflow to:

- Trigger a message delivery to LINE OA users


Here is an overview of how to configure that workflow to trigger a delivery:

1. On the LINE Developers Console, create or select your LINE Official Account and enable the Messaging API.
2. Obtain your Channel Secret Access Token from the Messaging API settings.
3. Create an authentication for this integration to communicate with LINE OA.
4. In a Real-time Journey, select this authentication for a new triggered activation.


## Requirements and Limitations

- This connector is subject to LINE Messaging API limitations. Please refer to [LINE Messaging API Rate Limits](https://developers.line.biz/en/docs/messaging-api/limits/) for details.


## LINE OA Streaming Export via Treasure Console

You must create and configure the data connection in Treasure Data. As part of the data connection, you provide authentication credentials to access the integration.

### Create Authentication

Perform the following steps to create a new authentication with a set of credentials.

1. Select Integrations Hub.
2. Select Catalog.
3. Search for your Integration in the Catalog; hover your mouse over the icon and select Create Authentication.


![LINE OA connector tile in the Integrations Hub Catalog](/assets/line-oa-streaming-logo.4b5114345157c2691bd2f667419dc9b3854d7359aa557f451dbd3ab7415b01aa.c9dfba80.png)

1. Ensure that the Credentials tab is selected and then enter credential information for the integration.


### New Authentication Fields

![Authentication configuration screen showing the Channel Access Token and Channel Secret fields](/assets/line-oa-streaming-authen.c1ab871f1333250b9f237665e8d447345d1033de64cda23f422c7214d07c1b33.c9dfba80.png)

| Parameter | Description |
|  --- | --- |
| Channel Secret Key | The secret access key for your LINE Official Account channel |


1. Select **Continue**.
2. Enter a name for your connection.
3. Select **Done.**


After configuring the LINE OA Streaming integration, it is now available to be incorporated into real-time customer journey activations. See [Creating a Real-time Triggered Activation](https://docs.treasuredata.com/smart/project-product-documentation/creating-a-real-time-triggered-activation) for additional information.

### Real-time Triggered Activation

To create or update a triggered activation:

1. Select the triggered activation you want to configure ![](/assets/triggeredactivation.66e546b8c4cc774c0bdd804d0d099b63cf12b1916181d85d7c715be95bd61810.9e7171ae.png).
2. In the triggered activation window, select an activation from the Copy triggered activation from drop-down menu.
3. Enter a Triggered activation name.
4. Enter an Optional description of the activation.
5. From the Authentication drop-down menu, select the authentication the activation should use.


Depending on the type of authentication you choose, the details you will need to provide will vary. Refer to the integration-specific table below for more information.

![LINE OA Output Streaming Activation Config](/assets/line-oa-streaming-triggered-activation.ad4a4275fb903f91424542bf22936676048cb277690b2d8b74f7ceb11880d36c.c9dfba80.png)

1. Verify or provide the information required for the fields on the Details page.
2. After the Details are configured, select **Create** or **Update**.


### Integration Parameters

| Parameter | Values | Description |
|  --- | --- | --- |
| **Recipient ID** | required - String | The user ID of the recipient (as provided by LINE) |
| **Messages Payload** | required - JSON Array | The array of message objects to send (see [LINE Messaging API reference](https://developers.line.biz/en/reference/messaging-api/#send-message)) |
| **Maximum Number Of Retry** | optional, default 3 | Number of retries before it gives up. |
| **Initial Retry Delay** | optional, default -2 | How long wait before retrying the first one |
| **Retry Delay Multiple** | optional, default 2 | The factor to multiply the delay after each retry |


## Retry and Logging Logic

- The connector will retry to send the request when it gets the status code 429, 500, 502, 503, or 504.
- If the request is sent successfully before the **Maximum Number of Retry** is reached, the logging will show successfully.
- If the request still fails after reaching the **Maximum Number of Retry**, the connector will stop the job.
- We will see the error message and the status code in the client's activation table whenever the request sent fails.
- The **Maximum Number of Retry** can be configured in the Activation Config.