LINE

Dialogflow CX's LINE integration lets you create LINE bots with natural language understanding based on Dialogflow CX technology.

Set Up LINE

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 you don't have one.
  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 CX

  1. Go to the Manage tab on the navigation menu.
  2. Select Integrations.
  3. Click Connect 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

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

Testing

To test your agent, follow LINE's guide Adding friends using a 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

Rich response messages are supported using Custom Payload in Fulfillment. See LINE Message Objects for the message format.

For example, the following custom payload provides a 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

After you configure the channel-specific responses, the channel DF_CX_LINE is automatically used when the agent responds to LINE messages.