JSON API: Connecting Chatbot to External Systems
JSON API allows the chatbot to retrieve data from 3rd parties. Return data is in JSON format
{
"variable1": "Value 1",
"variable2": "Value 2",
...
}
Example: Using API to create an order, the return order code and message are:
{
"order_id": "123"
"message": "Successfully created order, your order code is: 123",
}
In Fchat message scenario you can use JSON variables in the message below
For example, with the returned results above, the variables are: {order_id}, {message}
Note: these variables are only available in the Block scope, below the JSON API object
EXAMPLE: USING JSON API TO CREATE A COURSE COUPON ON UNICA.VN
Step 1: Get the link to create a course coupon
Step 2: Go to fchat.vn, put the link in JSON API