Build an HTTP Service With BI Copilot¶
In this tutorial, you’ll create an HTTP service to add key-value pairs to a Redis database. The integrated AI-assistant will help you generate the integration flow.
Prerequisites¶
- Docker installed on your machine.
Step 1: Create a new integration project¶
- Click on the BI icon on the sidebar.
- Click on the Create New Integration button.
- Enter the project name as
RedisService. - Select project directory location by clicking on the Select Location button.
- Click on the Create New Integration button to create the integration project.
Step 2: Create a new integration¶
- In the design view click on the Generate with AI button.
-
Enter the following prompt and press
Enter:Create an integration service with a base path of /cache and a POST resource at /add that accepts key-value pairs and adds them to Redis. -
As shown, click on Keep if the generated integration is as expected. Otherwise, you can keep generating until you get the desired integration.
-
The generated integration will look like below:
Step 3: Add a resource to get value¶
- Add the following prompt and press
Enter:Add a resource to get the value of a key from Redis. - Click on Keep button after reviewing the generated integration to add it to the project.
-
The generated integration will look like below:
Step 4: Start the Redis server¶
- Start the Redis server by running the following command:
docker run --name some-redis -d -p 6379:6379 redis -
The redis server will start on port
6379without password protection.
Step 5: Configure the Redis client¶
- In the
Design View, click on the Configure button on the top-right side. - Set
redisHostvalue tolocalhost. - Set
redisPortvalue to6379. - Set
redisPasswordvalue to"".
Note: No need to set the above values if the configurable variables are generated with default values.
Step 6: Test the integration¶
- Click on the Run button to start the integration.
-
Tweak and execute the generated
curlcommands from the AI response to add a key-value pair.curl -X POST http://localhost:8080/cache/add -H "Content-Type: application/json" -d '{"key": "BI", "value": "BI is an AI-assisted integration platform."}' {"message":"Successfully added to cache", "key":"BI"} -
Execute the generated
curlcommand to get the value of the key.curl http://localhost:8080/cache/BI - The response will be the value of the key
BIstored in the Redis server.BI is an AI-assisted integration platform.
Step 7: Stop the integration¶
- Click on the Stop button to stop the integration.
- Stop the Redis server by running the following command:
docker stop some-redis




