LINE

Dialogflow's LINE Integration allows you to easily create LINE bots with natural language understanding based on Dialogflow technology.

Set Up LINE

In order to set up the LINE integration for your agent, you'll need the following:

  • A LINE account
  • The LINE app installed on a mobile device

Create a LINE bot

  1. Follow LINE's guide Getting started with the Messaging API to create a provider and a Messaging API channel (if not created before).
  2. Copy the following information from the created channel in LINE Developers Console:

    • Channel access token (long-lived)
    • Channel ID
    • Channel secret

Set up Dialogflow

  1. Click Manage tab on the left panel.
  2. Click Integrations in the left menu.
  3. Click the Connect button on the Line tile.
  4. Fill in the following information:
    • Channel access token
    • Channel ID
    • Channel secret
  5. Choose an environment, as applicable.
  6. Click Start.
  7. Copy the Webhook URL.

Enable webhook in LINE

Follow LINE's guide Set a Webhook URL to finish the setup.

Testing

To test your agent, follow LINE's guide Adding friends via QR code to add the bot to the conversation list. The QR code can be found on the Messaging API tab in the LINE Developers Console. After that, you can send messages to the bot for testing.

Rich response messages

The rich response messages are supported via Custom Payload in Fulfillment. Please see LINE Message Objects for the message format.

For example, the following custom payload provides a simple LINE text message:

{
  "type": "text",
  "text": "Hello, world"
}

The following custom payload provides a LINE template message:

{
  "type": "template",
  "altText": "this is a buttons template",
  "template": {
    "type": "buttons",
    "thumbnailImageUrl": "https://example.com/bot/images/image.jpg",
    "title": "Menu",
    "text": "Please select",
    "actions": [
      {
        "type": "postback",
        "label": "Buy",
        "data": "action=buy&itemid=123"
      },
      {
        "type": "postback",
        "label": "Add to cart",
        "data": "action=add&itemid=123"
      },
      {
        "type": "uri",
        "label": "View detail",
        "uri": "http://example.com/page/123"
      }
    ]
  }
}

Channel specific responses

When configured, channel specific responses with channel DF_CX_LINE will be automatically used when the agent responds to Line messages.