How to connect chatbot with Line and How Intent and Entity in Amity Bot work
  • This is some text inside of a div block.
  • This is some text inside of a div block.
  • This is some text inside of a div block.
  • This is some text inside of a div block.

How to connect chatbot with Line and How Intent and Entity in Amity Bot work

Amity Bots is one of the products of Amity Social Cloud. It’s an Enterprise Chat Management that can create a Chatbot with many platforms such as Facebook, Line, or Web platform’s chat. Today I am going to show you how to connect our Chatbot with Line’s platform and show How Intent and Entity which is the fundamental of Amity Bots work.

Connect with Line

To Connect with Line you must have a Line Developer Account, You can create a Line Developer Account from here. After entering to Line Developer Console click Create button in Provider’s panel, typing your desired name.

After you click Create button, You will see Provider’s layout likes this:

Click Create a Messaging API channel, fill the Channel name and other information out, and then click Create.

Now, We have a Messaging API to connect with a Chatbot but we have to set some configuration to make it works.

  • Go to Messaging API
  • Issue Channel access token, We will use it later.
  • At LINE Official Account click Edit at Auto-reply messages. Change the settings to match with the image below:

Now, We will jump to Amity Bots to hookup with Line Message API. Go to Channel Page and click add Channel.

Put your desired Channel name and then copy Channel ID and Channel Token (Channel access token) from Line Message API.

Now you see a webhook URL appears copy it and then go to Line Message API click Edit on Webhook URL and then parse the URL. After you parsed the URL, you will see a Verify button to check if it connects successfully with Amity Bots.

Congratulations! 🥳 Your chatbot is hooked with Line now. To use it, Go to Amity Bots and then go to Bot panel, click Chatlogic. In order to receive messages from Line, you have to use a receive-msg node, add a new channel, and set Channel likes below the picture.

Note: You don’t have to put any details such as Channel ID, Token in this panel because It will automatically match with the channel you set previously unless you have multiple Line accounts to work with.

To test it we gonna connect our receive-msg node with debug node likes below the picture.

Now after you create a Line’s chat with the provider we created. We will create a Line chat to make a conversation with the chatbot. You can do that by using QR code in Messaging API settings on the Line Developer console then try to text something to that chat when you text the message, the message you send will appear in debug panel on the Chatlogic in Amity Bots.

So after we have connected with Line message API, we will create an Intent Entity, but first:

What are Intent and Entity?

The intent is a group of users’ input text. It makes chatbots learn the words it should react to.

The entity is a chatbot question, It will ask the user and waits for the user to respond answer back to the chatbot. It usually uses to collect user data to make a decision on which response it should do.

How do we use Intent and Entity in AmityBot?

We use Intent and Entity by mapping it with Mapper. Mapper is like a connector between intent and action or entity. It will help the chatbot know which message they should act to, and how.

To make you understand better let’s create real stuff. First, create the Intent. Go to Bot > Intent > add Intent then put the related message in the Intent. We recommend you add a related message as much as you can to make a chatbot smarter. After completed 'Add a message' click on the Save button on the right.

Next, We will create an entity, Entity has two types, Static type which will fix the format and data, and User-defined type which the user can set data dynamically. In this walkthrough, we will use Static type and define the format to receive a text. Go to Bot > Entity > add Entity and fill in the information. after fill in the information click Deploy.

We have already created Intent and Entity. Now we are going to implement them, to implement we will create a flow first go to chat logic page and create flow like this:

  1. Receive-msg node we created last time.
  2. Classify node to filter unwanted messages from users.
  3. Interpret node, naming it with prefix @ will make this node visible in Mapper and inside interprets node sets rules to “otherwise”
  4. Entity node, inside entity node we will use entity we created and sets node like below picture.
  5. Debug node

After we finished creating flow, now we gonna connect The flow, Intent into the Mapper. Go to Bot > Mappers > add Mapper. Put Intent using Intent we created and Action puts Start, Like below picture and then click Deploy.

Now everything is connected, if you enter the words via Line Chat which we created using the words in The Intent which, it will show the question.

And Here’s the debug node’s output:

You will see our text appears in debug panel on the right of chatlogic page.

That’s it! I hope this walkthrough helps to connect the chatbot and how intent and entity works in Amity Bots.

See you next time!