Send/get information via Json API Card
The Json API card allows sending variable values to the system, or receive information returned from the external system via API.
Example: In the delivery scenario, after the Bot get the customer’s address and phone number, it will send these to the order management system via API.
To transfer data via the Json API card, follow these steps:
Step 1: After finishing the order confirmation scenario, choose Json API card in out-put.
Step 2: Select and enter information in the JSON Card
Method: GET (takes data from the management system); or POST (transfer data from variables to the management system). In this example, we will choose POST.
URL field: Enter the URL of the connecting API.
Header: Verify security between the 2 systems.
Variable: Choose variables which data will be sent to API, or which stores data from API.
You can add more variables by selecting Variables in the hidden menu.
To delete variables, choose the variables, then click “x” on the right of each variable.
In this example, variables chosen to send data to API are: send_name, address, and phone_number.
Step 3: When customers converse with the Bot, the data from variables will be sent to API, you can go to API URL to review these data.
Notice: At the end of the JSON API Card, you can see the option Display notifications in case of errors. In this option, if the API is faulty, the bot will display the error in conversations with end users. Therefore, this option should only be used in testing, not in practical use.