Every business, from small stores to large-scaled enterprises, has its own customer data sources; and these sources have to be connected to chatbot to personalize and improve customer care. FPT.AI offers a smart chatbot built on FPT.AI Conversation, making this process much faster and easier for businesses.
FPT.AI Chatbot can connect to the external data sources through API using JSON API, in order to receive/send users’ information via URL.
This feature is useful in many business processes, for example, checking order status in stores or locking lost cards in banks.
In the article, we will show you how to integrate a chatbot with Customer Relationship Management system (CRM), specifically Google Sheet, to lock card in banks.
(Learn how to use Google Sheet API at: Sheets API)
Here are step-by-step instructions for locking cards with Chatbot and setting up and integrating Chatbot with external data sources:
Step 1: Create a “lock card” script:
– Create Step
– Create Intent
– Create Sample
– Create responses for Chatbot with Text Card
Step 2: Set up and create variables
– Set up variables
– Create questions for users to provide information with Form card
Step 3: Send data to API for processing
– Prepare data in Google Sheet (excel sheet) format
– Create JSON API Card
Step 4: Handle users’ responses
– When customers enter correct information
– When customers enter incorrect information
Step 5: Delete variables
Detailed instructions
Step 1: Create the “lock card” script
- Create and name a new step. For example, Lock Card.
- Create Intent
Intent is the purpose of users’ sentences, in this case, the Intent of users is to lock their cards.
- Name: lock_card_khoathe
Note: Intent’s name is written without accent marks, each word is separated by “_”.
- Create Sample
Sample is a set of sentences that users use to communicate with chatbot. In this case, users tend to ask questions about “locking card”.
For example:
-
-
- I want to lock my card
- Lock my visa card immediately, please
- I just lost my card, please lock it immediately
- Please lock the visa card for me I just lost it
- Admin, please help me lock the card
- Lock the card for me.
- Etc.
-
Note:
- You have to enter all the variants and synonyms of the intent to make sure chatbot identify the intent of users accurately. You should enter a minimum of 20 sample sentences for 1 intent.
- Then click the “Train” button, chatbot will “learn” all sample sentences you had provided, helping it identify users’ intent and give accurate answers quickly.
- Create responses for Chatbot with Text card
– Select Text tag (1)
– Enter the answers of Chatbot (2)
As users’ questions are similar to Sample Sentences you had created, the chatbot will give the answer according to what you set up.
Step 2: Set up and create variables
-
Set up variables
- In the Conversation Management (1) section, click Set up variables (2) to create variables that store customer data.
- Click Add variable: Enter the Variable Name (3), select the Entity type, authentication type, and then click Save (4) to create the variable.
- Create Variables to store user information:
– id_number: To store the ID number of users
– Card_numbers: To save the card number that users provided
– DoB: To save the customers’ date of birth
- Create questions for users to provide information with Form Card
After storing user information according to variables, you create questions for users to provide information with Form tag.
- Select Form card
- Select Variables and enter the corresponding questions to ask users to provide further information
For example: id_number: Please enter your ID number
When users answer the questions, the data will be saved in the corresponding variable.
Demo chat interface of chatbot and users. Here are the values that chatbot saves in its system:
- id_number: 510858545
- card_numbers: 3431
- dob: 26
Step 3: Send data to API for processing
- Prepare data in Google Sheet (excel sheet) format
In this step, we send data to API for processing.
FPT.AI created an API to check the data provided by users and send the results.
To simulate a tabular database, FPT.AI created a file on Google Sheet and connected user data to this file.
User data file includes: Customer name, ID number, Date of birth, Card number, Card status.
- Create JSON API card
We use the JSON API card to send/receive data to an API,
In the JSON API card, there are two methods to call the API, namely POST and GET. Select the method that is suitable to API URL.
If selecting GET method, you can send data to the API via API URL link.
Or you can send via the Variables section (with both POST and GET methods)
You can return any data you want in the API with the following response:
The API returns the complete information of users with the word “success”.
– If success = 1, the data exists on the database.
– If success = 0, it means that user data is Wrong or Not yet in the database.
To capture data returned from the API, you set additional variables with the same name.
- success
- full_name
- full_card_number
Step 4: Handle users’ responses
- If information users provided is wrong or “does not exist”, set up the appropriate response for chatbot.
- If information users provided is correct, set up the answer providing information that users need.
Step 5: Delete variables
You should add the Delete step with Memory card to make sure chatbot not to use the old data in the next conversation with users.
- Select the Memory card
- Select the variables you want to delete
Experience with chatbot
When users enter correct information
When users enter wrong information
Data was successfully updated in the database:
More specifically, please watch in the following video tutorial:
————————————-
? Try #FPT_AI latest product at: https://fpt.ai/en/
☎ Hotline: 0911886353
? Email: [email protected]