Conversational Agents (Dialogflow CX)'s LINE integration lets you to easily create LINE bots with natural language understanding based on Conversational Agents (Dialogflow CX) 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
- Follow LINE's guide Getting started with the Messaging API to create a provider and a Messaging API channel (if not created before).
Copy the following information from the created channel in LINE Developers Console:
- Channel access token (long-lived)
- Channel ID
- Channel secret
Set up Conversational Agents (Dialogflow CX)
- Click Manage tab on the left panel.
- Click Integrations in the left menu.
- Click the Connect button on the Line tile.
- Fill in the following information:
- Channel access token
- Channel ID
- Channel secret
- Choose an environment, as applicable.
- Click Start.
- 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
After you configure the channel-specific responses, the channel DF_CX_LINE
is automatically used when the agent responds to Line messages.