The Assist bot's builder allows you to make extensive API calls to any external/internal system to fetch or push data and have it displayed as part of the bot conversation. What’s more, as Admins, you do not have to pass the parameters each time you trigger an API call from a dialog, instead, be able to reuse them from a previous or any other dialog, and also modify them quite easily by configuring all of them in the API Library.
Every single API call that needs to be made from a dialog can be configured in the API library and can be invoked by choosing the 'Trigger API' option from the Actions tab for the required dialog.
A quick guide to creating a new API:
- Login to your Freshdesk account as an Admin
- Go to Admin > Agent Productivity > Assist bot under Freddy configuration
Select the bot you want to edit from the bot list page
Click on the ‘API library’ icon from the right navigation bar
- The '+ New API' button will allow you to configure a new API call
Configuring the API:
- Name: Give your API call a suitable name.
- URL/JS function name: Provide the Callback URL here. The content picker option [+] in this field will allow you to append values from the conversations to the callback URL.
- Method: Configure the type of API call you’re looking to make - GET, PUT, POST, DELETE, or a JS function and then pass the payload accordingly. You can also configure a larger payload content in an expandable text editor that will format JSON automatically when pasted into it. For example, to create a ticket in your Freshdesk account, pass the email, priority, status, subject, and description in JSON. You can also make use of placeholders using the + icon on the bottom right.
- Add Headers: You can authorize your APIs in this field, and also pass any additional parameters as headers in this section.
- Test: To make sure the API call has been configured correctly, you can perform a sample test run, pass test values for the dynamic fields you have configured in the payload (for PUT, POST, and JSON methods) and verify the response headers.
-
Add the required response parameters: Attributes from the response headers can be referenced in any dialog in the chatbot conversation.
For example, if you want to display the status ID of an order, the ID field from the headers can be added to this field and be used in the consequent dialogs.
If an array of elements are needed, square brackets should be appended to that field, for the below example: data[].id, data[].name
For a particular element in an array, using the index number will display the corresponding value in that field: data[1].id will display the second value in the field, from the above example: 60002
API list page:
From the API library list page, you can search for the APIs you’ve configured using its name. The listed APIs will tell you the type of action the API has been set up to perform - GET or POST etc, show when the API was created and when it was last modified. Clicking the ‘more’ icon against an API will allow you to edit or delete it.
A quick guide to using the APIs:
- Login to your Freshdesk account as an Admin
- Go to Admin > Agent Productivity > Assist bot under Freddy configuration
Select the bot you want to edit from the bot list page
Click on the desired flow of that bot
- You can add an API's response under 'Message or Question' or 'Actions' or the 'Conditions' tab based on your use-case
-
Under Message or Question: Type out the message or question to be displayed to the agents in the text box and click on the content picker icon [+], and choose 'APIs'. You'll see the list of all the APIs configured under the API library for that bot. Choose the required API to append it to the text box.
For example: If you are fetching the order status, you can set up an API call to connect to your order management system and reference the order status from the response parameters.
-
Under Actions: Set the 'Action type' to 'Trigger API' and then go on to select the required API from the list of all the APIs configured under the API library of that bot.
For example: If you are configuring an API response to get the URL of a page, you can reference that API under actions so the agents can access the URL from the bot.
-
Under Conditions: Go to the 'Conditions' tab for the required dialog in the bot flow and click on the content picker [+] icon, and choose 'APIs' from the drop-down. You will be able to see the list of all the APIs configured under the API library for that bot. Select the required API call and then proceed to choose the response value. The API's response can be used both in the body of the condition and in the condition's value section.
For example: In the case of a simple subscription flow, you can get the 'status' of the payment from the API response and redirect agents to a different dialog/flow if the status is unpaid or set up a dialog to display a simple message to the agents if the status is paid so they can communicate the same to the customers.
-
Under Message or Question: Type out the message or question to be displayed to the agents in the text box and click on the content picker icon [+], and choose 'APIs'. You'll see the list of all the APIs configured under the API library for that bot. Choose the required API to append it to the text box.