In this new feature, you can define a context to send or request information available in external systems, as well as request services from them using API calls.
Some examples of these actions are querying user information, checking order statuses or generating documents such as bills of exchange. By setting up an integration, you can customize how and when the chatbot makes these requests, as well as how it should handle the responses it receives, enhancing the customer service experience.
Example of use
Imagine that your customer needs to check if there is an open order. Using this new feature, you can configure the chatbot to connect to the order management system via API. The chatbot asks for the customer's CPF, makes the call to check for open orders and returns the information automatically.
Practical example tutorial
-
Access the Skills screen of the chatbot.
.
-
Click on Add skill
-
Select the Integration option and click Next.
-
Choose the option Manual configuration and follow the steps below to create the new integration.
Step 1: Basic data
Fill in the requested fields:
- Name: Give this integration a name, such as "Check order".
- Command: Define the command that will be executed, such as "Check order status".
- Click Next to go to the next step.
Step 2: Parameterizing the API call
Now, you will configure the API call that the chatbot will make.
- Método: Choose the appropriate method (GET, POST, PUT or DELETE), depending on the request that will be made. For example, to search for information, the GET method is usually used.
- URL: Enter the URL of the Endpoint of the external system that will be called. Example: https://api.sistemaexemplo.com/pedidos.
You can also include parameters within the URL. To do this, use the format {{parameterName}}
. This means you can define specific values for these parameters right below, in the URL Parameters section.
This functionality is useful when you need to customize the URL to make it more detailed. For example, if you need to pass specific information, such as an order ID, you can set this up and then insert those values into the URL exactly where needed. Your URL would look something like https://api.examplesystem.com/orders/{{orderId}}.
3. Head & Garlic: Click Add field and enter the information to set up the request header:
- Field: Add the necessary fields to the request header, such as CPF or authentication token.
- Value: Set whether the value will be fix or variant. If this is variable, create an instruction for the chatbot. Example: If the field é CPF, the instruction would be something like "Ask the user for the CPF".
4. Body: Click on Add field and enter the information to configure the request body:
- Field: Add the necessary fields in the body of the request, such as Request Number.
- Value: Set again whether the value will be fixed or variable, depending on the logic used in the header.
5. Click Next to go to the next step.
Step 3: Test the API call
In this step, you can test whether the integration is working correctly.
Click on Run test for the system to make the API call and display the response, which can be:
🟢 200 OK: Means that the test was successful and the system displays the returned attributes, such as Name, CPF, Address. Enable or disable which attributes you want to use to handle the return (step 4 below).
🔴403 – Authentication error": It means that the test was not successful. The system will display the error if it exists for correction.
Step 4: Handle feedback
Lastly, you define what will be done with the data in the AI chatbot's journey, choosing how it should treat the attributes selected in the previous step.
You have three options:
-
Confirm the result of the call: The chatbot can only confirm the answer. Example: If the customer has an open order, the chatbot can reply with a message confirming that there is an open order.
-
Send as file: If the reply contains a link to a file (such as a boleto), the chatbot can make this file available to the user.
-
Send as text message: The chatbot can generate a message with the returned attributes. Example: The chatbot can inform you of the order number and status, such as "Your order #12345 is in progress."
Finally, conclude with Create skill.
Done! Your skill is already added to the chatbot.
If you want to edit it, click on the ícone to the side of the skill and you will have this option.