Add-on | AI agents - Advanced |
A fake integration allows for custom functionality to be added to dialogues using data already present in the conversation, without making actual API calls or retrieving external data. This allows you to implement logic using JSONata for data manipulation, comparisons, or other tasks within the dialogue flow.
This type of integration is useful for handling tasks that don’t require real-time external data, acting as a “helper” integration to extend an AI agent’s capabilities beyond standard features.
This article contains the following topics:
About fake integrations
A fake integration is useful when you want to process or manipulate data already available within the conversation. For example, you can accomplish the following tasks using a fake integration:
- Transform your data to a more appropriate format.
- Format and filter complex CRM or API data.
- Compare dates to find the most recent one.
- Retrieve the current day and time.
- Check whether a date is within a certain time frame.
- Check whether a URL contains specific words.
- Check for and replace any null values.
- Replace letters or symbols in your data.
- Use a case-insensitive filter to go through data and return the first matching value or provide a fallback response if there are no matches
If you can define logic using JSONata, then you can enhance your conversations with these helpful integrations.
Building a fake integration
Tip: Before building a fake integration, we suggest that you familiarize yourself with using JSONata with the Integration Builder. See JSONata Enablement.
To build a fake integration, you create an API Integration as usual. However, no request for data is ever made.
To build a fake integration
- In the main menu, click API Integrations.
- In the top right, click Add Integration.
- In the Add Integration window:
- In the Integration name field, give your integration a descriptive name.
- (Optional) In the Description field, enter a description of the integration that helps you remember what it’s for.
- Click Save.
- In the left sidebar, under Environments, select an environment (such as Production).
- Set Method type to GET.
- In the URL field, enter a dummy URL (for example, https://dummyjson.com/http/200).
-
Note: Because fake integrations are hosted within the integration framework, they must point to a valid URL. The example above uses https://dummyjson.com/http/200, but its availability can’t be guaranteed. You can use whatever dummy URL makes sense for you. While an API call will be made to the specified URL, no data from the response will be processed in the fake integration.
-
- Make sure Authorization type is set to No Authorization.
- (Optional) In the left sidebar, under Scenarios, hover over Failure, select the options menu (
), and select Delete. You don’t need a failure scenario for a fake integration.
- In the left sidebar, under Scenarios, select Success.
- Depending on your scenario, do one of the following:
- If you have a simple query, enter it in the Scenario Query field. For example, if you just need a boolean response, then having the query here is all you need.
- If you need to define logic based on request parameters (coming from the conversation):
- Enter requestParameters in the Scenario Query field.
- Under Session Parameters, enter the parameters for your fake integration. The screenshot below includes example parameters and JSONata expressions for returning the day of the week and the current time.
- Click Save.
Adding a fake integration within a dialogue
In the dialogue builder, you can add an API integration node and select your fake integration.
To add a fake integration within a dialogue
- In the top-right corner, use the AI agent drop-down field to select the AI agent you want to update the dialogue for.
- In the main menu on the left, select Content > Intents.
- Select the intent you want to update the dialogue for.
- Select the Replies tab.
- Select the reply you want to update the dialogue for, and then click Edit Dialogue.
- Click the plus icon (+) at the appropriate point in the dialogue and add an API integration block.
- Select the fake integration you created above.
Now, when the fake integration branch is hit in the conversation, your fake API integration is called and the session parameters you defined in your success scenario will be available to the dialogue. The example below shows a fake integration feeding into a conditional block using day-of-week-based parameters returned by the fake integration.
0 comments